Class SegmentDescriptor

java.lang.Object
org.apache.druid.query.SegmentDescriptor

public class SegmentDescriptor extends Object
This class is a pointer to a time range of a segment to be queried. The three pieces of this class (interval, version, and partition number) are typically passed to VersionedIntervalTimeline.findChunk(org.joda.time.Interval, VersionType, int) to retrieve an actual queryable object. Like SegmentId, instances of this class reference a segment. However, there are two major differences: 1) The getInterval() of this class may be narrower than the SegmentId.getInterval() of the segment being referenced. This happens when this class is being used to reference a specific time range of a segment, rather than the entire segment. 2) The SegmentId.getDataSource() field is absent from this class. Whenever this class is used, the datasource is known from some out-of-band information, such as the DataSource object of a query. Omitting the datasource, and abbreviating JSON field names, helps limit the serialized size of this class.
  • Constructor Details

    • SegmentDescriptor

      public SegmentDescriptor(org.joda.time.Interval interval, String version, int partitionNumber)
  • Method Details

    • getInterval

      public org.joda.time.Interval getInterval()
    • getVersion

      public String getVersion()
    • getPartitionNumber

      public int getPartitionNumber()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object