use of io.pravega.client.stream.impl.ReaderGroupState.ClearCheckpoints in project pravega by pravega.
the class ReaderGroupImpl method completeCheckpoint.
@SneakyThrows(CheckpointFailedException.class)
private Checkpoint completeCheckpoint(String checkpointName, StateSynchronizer<ReaderGroupState> synchronizer) {
ReaderGroupState state = synchronizer.getState();
Map<Segment, Long> map = state.getPositionsForCompletedCheckpoint(checkpointName);
synchronizer.updateStateUnconditionally(new ClearCheckpoints(checkpointName));
if (map == null) {
throw new CheckpointFailedException("Checkpoint was cleared before results could be read.");
}
return new CheckpointImpl(checkpointName, map);
}
Aggregations