Package org.apache.druid.client
Class ImmutableDruidServer
- java.lang.Object
-
- org.apache.druid.client.ImmutableDruidServer
-
public class ImmutableDruidServer extends Object
This class should not be subclassed, it isn't declared final only to make it possible to mock the class with EasyMock in tests.- See Also:
- a mutable counterpart of this class
-
-
Constructor Summary
Constructors Constructor Description ImmutableDruidServer(DruidServerMetadata metadata, long currSize, com.google.common.collect.ImmutableMap<String,ImmutableDruidDataSource> dataSources, int numSegments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)longgetCurrSize()ImmutableDruidDataSourcegetDataSource(String name)Iterable<ImmutableDruidDataSource>getDataSources()StringgetHost()StringgetHostAndPort()StringgetHostAndTlsPort()longgetMaxSize()DruidServerMetadatagetMetadata()StringgetName()intgetNumSegments()intgetPriority()org.apache.druid.timeline.DataSegmentgetSegment(org.apache.druid.timeline.SegmentId segmentId)StringgetTier()ServerTypegetType()StringgetURL()inthashCode()Collection<org.apache.druid.timeline.DataSegment>iterateAllSegments()Returns a lazy collection with all segments in all data sources stored on this ImmutableDruidServer to be used for iteration orCollection.stream()transformation.StringtoString()
-
-
-
Constructor Detail
-
ImmutableDruidServer
public ImmutableDruidServer(DruidServerMetadata metadata, long currSize, com.google.common.collect.ImmutableMap<String,ImmutableDruidDataSource> dataSources, int numSegments)
-
-
Method Detail
-
getName
public String getName()
-
getMetadata
public DruidServerMetadata getMetadata()
-
getHost
public String getHost()
-
getHostAndPort
public String getHostAndPort()
-
getHostAndTlsPort
public String getHostAndTlsPort()
-
getCurrSize
public long getCurrSize()
-
getMaxSize
public long getMaxSize()
-
getType
public ServerType getType()
-
getTier
public String getTier()
-
getPriority
public int getPriority()
-
getSegment
@Nullable public org.apache.druid.timeline.DataSegment getSegment(org.apache.druid.timeline.SegmentId segmentId)
-
getDataSources
public Iterable<ImmutableDruidDataSource> getDataSources()
-
getDataSource
public ImmutableDruidDataSource getDataSource(String name)
-
iterateAllSegments
public Collection<org.apache.druid.timeline.DataSegment> iterateAllSegments()
Returns a lazy collection with all segments in all data sources stored on this ImmutableDruidServer to be used for iteration orCollection.stream()transformation. The order of segments in this collection is unspecified. Note: iteration over the returned collection may not be as trivially cheap as, for example, iteration over an ArrayList. Try (to some reasonable extent) to organize the code so that it iterates the returned collection only once rather than several times.
-
getNumSegments
public int getNumSegments()
-
getURL
public String getURL()
-
-