use of io.pravega.test.integration.selftest.Event in project pravega by pravega.
the class SegmentStoreReader method readExact.
@Override
public CompletableFuture<ReadItem> readExact(String segmentName, Object address) {
Exceptions.checkNotNullOrEmpty(segmentName, "segmentName");
Preconditions.checkArgument(address instanceof Address, "Unexpected address type.");
Address a = (Address) address;
return this.store.read(segmentName, a.offset, a.length, this.testConfig.getTimeout()).thenApplyAsync(readResult -> {
byte[] data = new byte[a.length];
readResult.readRemaining(data, this.testConfig.getTimeout());
return new SegmentStoreReadItem(new Event(new ByteArraySegment(data), 0), address);
}, this.executor);
}
Aggregations