use of io.pravega.segmentstore.contracts.tables.TableStore in project pravega by pravega.
the class ReaderGroupTest method testMultiSegmentsPerReader.
@Test(timeout = 10000)
public void testMultiSegmentsPerReader() throws Exception {
String endpoint = "localhost";
int servicePort = TestUtils.getAvailableListenPort();
@Cleanup ServiceBuilder serviceBuilder = ServiceBuilder.newInMemoryBuilder(ServiceBuilderConfig.getDefaultConfig());
serviceBuilder.initialize();
StreamSegmentStore store = serviceBuilder.createStreamSegmentService();
TableStore tableStore = serviceBuilder.createTableStoreService();
@Cleanup PravegaConnectionListener server = new PravegaConnectionListener(false, servicePort, store, tableStore, serviceBuilder.getLowPriorityExecutor());
server.startListening();
@Cleanup MockStreamManager streamManager = new MockStreamManager(SCOPE, endpoint, servicePort);
streamManager.createScope(SCOPE);
streamManager.createStream(SCOPE, STREAM_NAME, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(2)).build());
@Cleanup MockClientFactory clientFactory = streamManager.getClientFactory();
ReaderGroupConfig groupConfig = ReaderGroupConfig.builder().automaticCheckpointIntervalMillis(-1).stream(Stream.of(SCOPE, STREAM_NAME)).build();
streamManager.createReaderGroup(READER_GROUP, groupConfig);
writeEvents(100, clientFactory);
new ReaderThread(100, "Reader", clientFactory).run();
streamManager.deleteReaderGroup(READER_GROUP);
}
Aggregations