Class Orderer


  • public class Orderer
    extends java.lang.Object
    Used to select which event should go next when consuming from multiple segments.
    • Constructor Summary

      Constructors 
      Constructor Description
      Orderer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends EventSegmentReader>
      T
      nextSegment​(java.util.List<T> segments)
      Given a list of segments this reader owns, (which contain their positions) returns the one that should be read from next.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Orderer

        public Orderer()
    • Method Detail

      • nextSegment

        public <T extends EventSegmentReader> T nextSegment​(java.util.List<T> segments)
        Given a list of segments this reader owns, (which contain their positions) returns the one that should be read from next. This is done in way to minimize blocking and ensure fairness. This is done by calling EventSegmentReader.isSegmentReady() on each segment. This method will prefer to return streams where that method is true. This method should reflect that the next call to EventSegmentReader.read() will not block (either because it has data or will throw EndOfSegmentException
        Type Parameters:
        T - The type of the SegmentInputStream that is being selected from.
        Parameters:
        segments - The logs to get the next reader for.
        Returns:
        A segment that this reader should read from next.