Hi,

I have come across the issue of the state of the AbstractStreamProcessor in
partitioned queries not getting persisted in Siddhi. The issue has been
explained with more details in [1]. In the solution which I have suggested
[2] there will be an API change to the StreamRuntime interface [3]. This
API change will basically add query name as a parameter to the clone()
method of StreamRuntime. Propagating the query name via clone() as a
parameter will allow us to properly add the AbstractStreamProcessor
instances (which are to be persisted) to the snapshotableMap HashMap
located in the SnapshotService [4] class. Furthermore, in the
AbstractStreamProcessor class we will generate and assign a new elementID
when cloning an instance out of it. We also need to access SiddhiAppContext
object in the SingleStreamRuntime class in order to add the newly cloned
AbstractStreamProcessor instances to the snapshotableMap. Hence we pass a
SiddhiAppContext object as a parameter in the SingleStreamRuntime class's
constructor.

@Suho,
We need to discuss and decide whether there will be significant impact of
doing such API level change for the StreamRuntime interface. An alternative
would be (as Tishan suggested in [2]), rather than modifying the existing
clone() method parameters, we could add a second clone() method with both
query name and partition key as the parameters. WDYT?


[1] https://github.com/wso2/siddhi/issues/774

[2] https://github.com/wso2/siddhi/pull/775

[3]
https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/query/input/stream/StreamRuntime.java

[4]
https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/util/snapshot/SnapshotService.java

-- 
Thanks,
Miyuru Dayarathna
Senior Technical Lead
Mobile: +94713527783
Blog: http://miyurublog.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to