Class DruidDataSource

java.lang.Object
org.apache.druid.client.DruidDataSource

public class DruidDataSource extends Object
A mutable collection of metadata of segments (DataSegment objects), belonging to a particular data source. Concurrency: could be updated concurrently via addSegment(org.apache.druid.timeline.DataSegment), removeSegment(org.apache.druid.timeline.SegmentId), and removeSegmentsIf(java.util.function.Predicate<org.apache.druid.timeline.DataSegment>), and accessed concurrently (e. g. via getSegments()) as well.
See Also:
  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • getProperties

      public Map<String,String> getProperties()
    • getSegment

      @Nullable public DataSegment getSegment(SegmentId segmentId)
    • getSegments

      public Collection<DataSegment> getSegments()
    • removeSegmentsIf

      public void removeSegmentsIf(Predicate<DataSegment> filter)
      Removes segments for which the given filter returns true.
    • addSegment

      public DruidDataSource addSegment(DataSegment dataSegment)
    • addSegmentIfAbsent

      public boolean addSegmentIfAbsent(DataSegment dataSegment)
      Returns true if the segment was added, false if a segment with the same SegmentId already existed in this DruidDataSource.
    • removeSegment

      @Nullable public DataSegment removeSegment(SegmentId segmentId)
      Returns the removed segment, or null if there was no segment with the given SegmentId in this DruidDataSource.
    • isEmpty

      public boolean isEmpty()
    • toImmutableDruidDataSource

      public ImmutableDruidDataSource toImmutableDruidDataSource()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object