public class DruidDataSource extends Object
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.- an immutable counterpart of this class| Constructor and Description |
|---|
DruidDataSource(String name,
Map<String,String> properties) |
| Modifier and Type | Method and Description |
|---|---|
DruidDataSource |
addSegment(DataSegment dataSegment) |
boolean |
addSegmentIfAbsent(DataSegment dataSegment)
Returns true if the segment was added, false if a segment with the same
SegmentId already existed in this
DruidDataSource. |
boolean |
equals(Object o) |
String |
getName() |
Map<String,String> |
getProperties() |
DataSegment |
getSegment(SegmentId segmentId) |
Collection<DataSegment> |
getSegments() |
int |
hashCode() |
boolean |
isEmpty() |
DataSegment |
removeSegment(SegmentId segmentId)
Returns the removed segment, or null if there was no segment with the given
SegmentId in this
DruidDataSource. |
void |
removeSegmentsIf(Predicate<DataSegment> filter)
Removes segments for which the given filter returns true.
|
ImmutableDruidDataSource |
toImmutableDruidDataSource() |
String |
toString() |
public String getName()
@Nullable public DataSegment getSegment(SegmentId segmentId)
public Collection<DataSegment> getSegments()
public void removeSegmentsIf(Predicate<DataSegment> filter)
public DruidDataSource addSegment(DataSegment dataSegment)
public boolean addSegmentIfAbsent(DataSegment dataSegment)
SegmentId already existed in this
DruidDataSource.@Nullable public DataSegment removeSegment(SegmentId segmentId)
SegmentId in this
DruidDataSource.public boolean isEmpty()
public ImmutableDruidDataSource toImmutableDruidDataSource()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.