use of com.hazelcast.jet.JetException in project hazelcast-jet by hazelcast.
the class SnapshotOperation method doRun.
@Override
protected void doRun() throws Exception {
JetService service = getService();
ExecutionContext ctx = service.getJobExecutionService().assertExecutionContext(getCallerAddress(), jobId(), executionId, this);
ctx.beginSnapshot(snapshotId).thenAccept(r -> {
logFine(getLogger(), "Snapshot %s for job %s finished successfully on member", snapshotId, idToString(jobId()));
doSendResponse(null);
}).exceptionally(e -> {
getLogger().warning(String.format("Snapshot %d for job %s finished with error on member", snapshotId, idToString(jobId())), e);
doSendResponse(new JetException("Exception during snapshot: " + e, e));
return null;
});
}
use of com.hazelcast.jet.JetException in project hazelcast-jet by hazelcast.
the class SessionWindowP method restoreFromSnapshot.
@Override
@SuppressWarnings("unchecked")
protected void restoreFromSnapshot(@Nonnull Object key, @Nonnull Object value) {
if (key instanceof BroadcastKey) {
BroadcastKey bcastKey = (BroadcastKey) key;
if (!Keys.CURRENT_WATERMARK.equals(bcastKey.key())) {
throw new JetException("Unexpected broadcast key: " + bcastKey.key());
}
long newCurrentWatermark = (long) value;
assert processingGuarantee != EXACTLY_ONCE || minRestoredCurrentWatermark == Long.MAX_VALUE || minRestoredCurrentWatermark == newCurrentWatermark : "different values for currentWatermark restored, before=" + minRestoredCurrentWatermark + ", new=" + newCurrentWatermark;
minRestoredCurrentWatermark = Math.min(newCurrentWatermark, minRestoredCurrentWatermark);
return;
}
keyToWindows.put((K) key, (Windows) value);
}
Aggregations