Class BatchClientFactoryImpl

    • Method Detail

      • getSegments

        public StreamSegmentsIterator getSegments​(Stream stream,
                                                  StreamCut fromStreamCut,
                                                  StreamCut toStreamCut)
        Description copied from interface: BatchClientFactory
        Provides a list of segments for a given stream between fromStreamCut and toStreamCut. Passing StreamCut.UNBOUNDED or null to fromStreamCut and toStreamCut will result in using the current start of stream and the current end of stream respectively. 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()

        Specified by:
        getSegments in interface BatchClientFactory
        Parameters:
        stream - the stream.
        fromStreamCut - starting stream cut.
        toStreamCut - end stream cut.
        Returns:
        Segment information between the two stream cuts.
      • readSegment

        public <T> SegmentIterator<T> readSegment​(SegmentRange segment,
                                                  Serializer<T> deserializer)
        Description copied from interface: BatchClientFactory
        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.
        Specified by:
        readSegment in interface BatchClientFactory
        Type Parameters:
        T - The type of events written to the segment.
        Parameters:
        segment - The segment to read from
        deserializer - A deserializer to be used to parse events
        Returns:
        A SegmentIterator over the requested segment
      • close

        public void close()
        Description copied from interface: BatchClientFactory
        Closes the client factory. This will close any connections created through it.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface BatchClientFactory
        See Also:
        AutoCloseable.close()