use of io.siddhi.core.util.snapshot.AsyncSnapshotPersistor in project siddhi by wso2.
the class PersistenceHelper method persist.
public static PersistenceReference persist(byte[] serializeObj, SiddhiAppContext siddhiAppContext) {
long revisionTime = System.currentTimeMillis();
// start the snapshot persisting task asynchronously
AsyncSnapshotPersistor asyncSnapshotPersistor = new AsyncSnapshotPersistor(serializeObj, siddhiAppContext.getSiddhiContext().getPersistenceStore(), siddhiAppContext.getName(), revisionTime);
Future future = siddhiAppContext.getExecutorService().submit(asyncSnapshotPersistor);
return new PersistenceReference(future, asyncSnapshotPersistor.getRevision());
}
Aggregations