use of io.pravega.client.stream.impl.ReaderGroupState.CheckpointReader in project pravega by pravega.
the class ReaderGroupStateManager method checkpoint.
void checkpoint(String checkpointName, PositionInternal lastPosition) throws ReinitializationRequiredException {
AtomicBoolean reinitRequired = new AtomicBoolean(false);
sync.updateState(state -> {
if (!state.isReaderOnline(readerId)) {
reinitRequired.set(true);
return null;
}
return Collections.singletonList(new CheckpointReader(checkpointName, readerId, lastPosition.getOwnedSegmentsWithOffsets()));
});
if (reinitRequired.get()) {
throw new ReinitializationRequiredException();
}
}
Aggregations