Package io.pravega.client.stream.impl
Class Orderer
- java.lang.Object
-
- io.pravega.client.stream.impl.Orderer
-
public class Orderer extends java.lang.ObjectUsed 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>
TnextSegment(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.
-
-
-
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 callingEventSegmentReader.isSegmentReady()on each segment. This method will prefer to return streams where that method is true. This method should reflect that the next call toEventSegmentReader.read()will not block (either because it has data or will throwEndOfSegmentException- 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.
-
-