Search in sources :

Example 1 with ClearCheckpoints

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);
}
Also used : ClearCheckpoints(io.pravega.client.stream.impl.ReaderGroupState.ClearCheckpoints) Segment(io.pravega.client.segment.impl.Segment) SneakyThrows(lombok.SneakyThrows)

Aggregations

Segment (io.pravega.client.segment.impl.Segment)1 ClearCheckpoints (io.pravega.client.stream.impl.ReaderGroupState.ClearCheckpoints)1 SneakyThrows (lombok.SneakyThrows)1