@Beta
public interface BatchClient
All events written to a stream will be visible to SegmentIterators
Events within a segment are strictly ordered, but as this API allows for reading from multiple
segments in parallel without adhering to time ordering. This allows for events greater
parallelization at the expense of the ordering guarantees provided by EventStreamReader
.
Modifier and Type | Method and Description |
---|---|
StreamSegmentsIterator |
getSegments(Stream stream,
StreamCut fromStreamCut,
StreamCut toStreamCut)
Provide a list of segments for a given stream between fromStreamCut and toStreamCut.
|
java.util.concurrent.CompletableFuture<StreamInfo> |
getStreamInfo(Stream stream)
Get information about a given Stream,
StreamInfo . |
<T> SegmentIterator<T> |
readSegment(SegmentRange segment,
Serializer<T> deserializer)
Provides a SegmentIterator to read the events in the requested segment starting from the
beginning of the segment and ending at the current end of the segment.
|
java.util.concurrent.CompletableFuture<StreamInfo> getStreamInfo(Stream stream)
StreamInfo
.stream
- the stream.StreamSegmentsIterator getSegments(Stream stream, StreamCut fromStreamCut, StreamCut toStreamCut)
Note: In case of stream truncation:
- Passing a null to fromStreamCut will result in using the current start of the Stream post truncation.
- Passing a fromStreamCut which points to the truncated stream will result in a NoSuchSegmentException
while
iterating over SegmentRange iterator obtained via StreamSegmentsIterator.getIterator()
stream
- the stream.fromStreamCut
- starting stream cut.toStreamCut
- end stream cut.<T> SegmentIterator<T> readSegment(SegmentRange segment, Serializer<T> deserializer)
T
- The type of events written to the segment.segment
- The segment to read fromdeserializer
- A deserializer to be used to parse events