我有查询和执行计划,我想对其进行快照,以便我可以在接收方恢复它并再次开始执行它。
- 应该以什么格式发送给接收方?
- 如何在接收端恢复?
以下是我从 Siddhi 存储库中获取的一些代码。
SiddhiManager siddhiManager = new SiddhiManager();
String query =
"define stream inStream(meta_roomNumber int,meta_temperature double);" +
"from inStream#window(10)[meta_temperature > 50]\n" +
"select *" +
"insert into outStream;";
ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(query);
executionPlanRuntime.start();
SiddhiContext siddhicontext = new SiddhiContext();
context.setSiddhiContext(siddhicontext);
context.setSnapshotService(new SnapshotService(context));
executionPlanRuntime.snapshot();