use of io.pravega.client.stream.impl.StreamCutImpl in project pravega by pravega.
the class ControllerServiceImplTest method createReaderGroup.
protected void createReaderGroup(String scope, String stream, String rgName, UUID rgId) {
final Segment seg0 = new Segment(scope, stream, 0L);
final Segment seg1 = new Segment(scope, stream, 1L);
ImmutableMap<Segment, Long> startStreamCut = ImmutableMap.of(seg0, 10L, seg1, 10L);
Map<Stream, StreamCut> startSC = ImmutableMap.of(Stream.of(scope, stream), new StreamCutImpl(Stream.of(scope, stream), startStreamCut));
ImmutableMap<Segment, Long> endStreamCut = ImmutableMap.of(seg0, 200L, seg1, 300L);
Map<Stream, StreamCut> endSC = ImmutableMap.of(Stream.of(scope, stream), new StreamCutImpl(Stream.of(scope, stream), endStreamCut));
ReaderGroupConfig config = ReaderGroupConfig.builder().automaticCheckpointIntervalMillis(30000L).groupRefreshTimeMillis(20000L).maxOutstandingCheckpointRequest(2).retentionType(ReaderGroupConfig.StreamDataRetention.AUTOMATIC_RELEASE_AT_LAST_CHECKPOINT).startingStreamCuts(startSC).endingStreamCuts(endSC).build();
config = ReaderGroupConfig.cloneConfig(config, rgId, 0L);
ResultObserver<CreateReaderGroupResponse> result = new ResultObserver<>();
this.controllerService.createReaderGroup(ModelHelper.decode(scope, rgName, config), result);
CreateReaderGroupResponse createRGStatus = result.get();
assertEquals("Create Reader Group", CreateReaderGroupResponse.Status.SUCCESS, createRGStatus.getStatus());
}
Aggregations