use of io.pravega.client.stream.impl.UTF8StringSerializer in project pravega by pravega.
the class RestoreBackUpDataRecoveryTest method readAllEvents.
// Reads the required number of events from the stream.
private void readAllEvents(String streamName, ClientFactoryImpl clientFactory, ReaderGroupManager readerGroupManager, String readerGroupName, String readerName) {
readerGroupManager.createReaderGroup(readerGroupName, ReaderGroupConfig.builder().stream(Stream.of(SCOPE, streamName)).build());
EventStreamReader<String> reader = clientFactory.createReader(readerName, readerGroupName, new UTF8StringSerializer(), ReaderConfig.builder().build());
for (int q = 0; q < TOTAL_NUM_EVENTS; ) {
String eventRead = reader.readNextEvent(READ_TIMEOUT.toMillis()).getEvent();
Assert.assertEquals("Event written and read back don't match", EVENT, eventRead);
q++;
}
reader.close();
}
Aggregations