Package org.apache.druid.client
Class ImmutableDruidDataSource
java.lang.Object
org.apache.druid.client.ImmutableDruidDataSource
An immutable collection of metadata of segments (
DataSegment objects), belonging to a particular data
source.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImmutableDruidDataSource(String name, Map<String, String> properties, Collection<DataSegment> segments) ImmutableDruidDataSource(String name, Map<String, String> properties, Map<SegmentId, DataSegment> idToSegments) Concurrency: idToSegments argument might be aConcurrentMapthat is being updated concurrently while this constructor is executed. -
Method Summary
Modifier and TypeMethodDescriptionbooleanImmutableDruidDataSource should be considered a container, not a data class.booleanThis method should only be used in tests.getName()getSegment(SegmentId segmentId) longReturns the sum of thesizesof all segments in this ImmutableDruidDataSource.inthashCode()ImmutableDruidDataSource should be considered a container, not a data class.toString()
-
Constructor Details
-
ImmutableDruidDataSource
public ImmutableDruidDataSource(String name, Map<String, String> properties, Map<SegmentId, 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<DataSegment> segments)
-
-
Method Details
-
getName
-
getProperties
-
getSegments
-
getSegment
-
getTotalSizeOfSegments
public long getTotalSizeOfSegments()Returns the sum of thesizesof all segments in this ImmutableDruidDataSource. -
toString
-
equals
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 Map<String, ImmutableDruidDataSource> and 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 Map<String, ImmutableDruidDataSource> and resolve conflicts by name manually. See https://github.com/apache/druid/issues/7858 -
equalsForTesting
This method should only be used in tests.
-