Package org.apache.druid.client
Class ImmutableDruidDataSource
- java.lang.Object
-
- org.apache.druid.client.ImmutableDruidDataSource
-
public class ImmutableDruidDataSource extends Object
An immutable collection of metadata of segments (DataSegmentobjects), belonging to a particular data source.- See Also:
- a mutable counterpart of this class
-
-
Constructor Summary
Constructors Constructor Description ImmutableDruidDataSource(String name, Map<String,String> properties, Collection<org.apache.druid.timeline.DataSegment> segments)ImmutableDruidDataSource(String name, Map<String,String> properties, Map<org.apache.druid.timeline.SegmentId,org.apache.druid.timeline.DataSegment> idToSegments)Concurrency: idToSegments argument might be aConcurrentMapthat is being updated concurrently while this constructor is executed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ImmutableDruidDataSource should be considered a container, not a data class.booleanequalsForTesting(Object o)This method should only be used in tests.StringgetName()Map<String,String>getProperties()org.apache.druid.timeline.DataSegmentgetSegment(org.apache.druid.timeline.SegmentId segmentId)Collection<org.apache.druid.timeline.DataSegment>getSegments()longgetTotalSizeOfSegments()Returns the sum of thesizesof all segments in this ImmutableDruidDataSource.inthashCode()ImmutableDruidDataSource should be considered a container, not a data class.StringtoString()
-
-
-
Constructor Detail
-
ImmutableDruidDataSource
public ImmutableDruidDataSource(String name, Map<String,String> properties, Map<org.apache.druid.timeline.SegmentId,org.apache.druid.timeline.DataSegment> idToSegments)
Concurrency: idToSegments argument might be aConcurrentMapthat is being updated concurrently while this constructor is executed.
-
ImmutableDruidDataSource
public ImmutableDruidDataSource(String name, Map<String,String> properties, Collection<org.apache.druid.timeline.DataSegment> segments)
-
-
Method Detail
-
getName
public String getName()
-
getSegments
public Collection<org.apache.druid.timeline.DataSegment> getSegments()
-
getSegment
public org.apache.druid.timeline.DataSegment getSegment(org.apache.druid.timeline.SegmentId segmentId)
-
getTotalSizeOfSegments
public long getTotalSizeOfSegments()
Returns the sum of thesizesof all segments in this ImmutableDruidDataSource.
-
equals
public boolean equals(Object o)
ImmutableDruidDataSource should be considered a container, not a data class. The idea is the same as behind prohibiting/limiting equals() (and therefore usage as HashSet/HashMap keys) of DataSegment: see https://github.com/apache/druid/issues/6358. When somebody wants to deduplicate ImmutableDruidDataSource objects, they would need to put them into a Mapand resolve conflicts by name manually. See https://github.com/apache/druid/issues/7858
-
hashCode
public int hashCode()
ImmutableDruidDataSource should be considered a container, not a data class. The idea is the same as behind prohibiting/limiting hashCode() (and therefore usage as HashSet/HashMap keys) of DataSegment: see https://github.com/apache/druid/issues/6358. When somebody wants to deduplicate ImmutableDruidDataSource objects, they would need to put them into a Mapand resolve conflicts by name manually. See https://github.com/apache/druid/issues/7858
-
equalsForTesting
public boolean equalsForTesting(Object o)
This method should only be used in tests.
-
-