use of com.hazelcast.cp.internal.raft.SnapshotAwareService in project hazelcast by hazelcast.
the class RestoreSnapshotOp method run.
@Override
public Object run(CPGroupId groupId, long commitIndex) {
SnapshotAwareService service = getService();
service.restoreSnapshot(groupId, commitIndex, snapshot);
return null;
}
use of com.hazelcast.cp.internal.raft.SnapshotAwareService in project hazelcast by hazelcast.
the class NodeEngineRaftIntegration method takeSnapshot.
@Override
public Object takeSnapshot(long commitIndex) {
try {
List<RestoreSnapshotOp> snapshotOps = new ArrayList<>();
for (ServiceInfo serviceInfo : nodeEngine.getServiceInfos(SnapshotAwareService.class)) {
SnapshotAwareService service = serviceInfo.getService();
Object snapshot = service.takeSnapshot(groupId, commitIndex);
if (snapshot != null) {
snapshotOps.add(new RestoreSnapshotOp(serviceInfo.getName(), snapshot));
}
}
return snapshotOps;
} catch (Throwable t) {
return t;
}
}
use of com.hazelcast.cp.internal.raft.SnapshotAwareService in project hazelcast by hazelcast.
the class UnsafeSnapshotReplicationOp method run.
@Override
public void run() throws Exception {
SnapshotAwareService service = getService();
for (Entry<CPGroupId, Object> entry : snapshots.entrySet()) {
CPGroupId groupId = entry.getKey();
service.restoreSnapshot(groupId, 0, entry.getValue());
}
}
Aggregations