@Beta
public interface BatchClientFactory
extends java.lang.AutoCloseable
EventStreamReader
.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the client factory.
|
StreamSegmentsIterator |
getSegments(Stream stream,
StreamCut fromStreamCut,
StreamCut toStreamCut)
Provides a list of segments for a given stream between fromStreamCut and toStreamCut.
|
<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.
|
static BatchClientFactory |
withScope(java.lang.String scope,
ClientConfig config)
Creates a new instance of BatchClientFactory.
|
static BatchClientFactory withScope(java.lang.String scope, ClientConfig config)
scope
- The scope of the stream.config
- Configuration for the client.StreamSegmentsIterator getSegments(Stream stream, StreamCut fromStreamCut, StreamCut toStreamCut)
- 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 eventsvoid close()
close
in interface java.lang.AutoCloseable
AutoCloseable.close()