public class DruidServer extends Object implements Comparable<DruidServer>
DataSegment objects), stored on a particular Druid server
(typically historical).
This class should not be subclassed, it isn't declared final only to make it possible to mock the class with EasyMock
in tests.- an immutable counterpart of this class| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_NUM_REPLICANTS |
static int |
DEFAULT_PRIORITY |
static String |
DEFAULT_TIER |
| Constructor and Description |
|---|
DruidServer(DruidNode node,
DruidServerConfig config,
ServerType type) |
DruidServer(String name,
String hostAndPort,
String hostAndTlsPort,
long maxSize,
ServerType type,
String tier,
int priority) |
public static final int DEFAULT_PRIORITY
public static final int DEFAULT_NUM_REPLICANTS
public static final String DEFAULT_TIER
public DruidServer(DruidNode node, DruidServerConfig config, ServerType type)
public DruidServer(String name, String hostAndPort, String hostAndTlsPort, long maxSize, ServerType type, String tier, int priority)
public String getName()
public DruidServerMetadata getMetadata()
public String getHost()
public String getHostAndPort()
public String getHostAndTlsPort()
public long getCurrSize()
public long getMaxSize()
public ServerType getType()
public String getTier()
public boolean isSegmentReplicationTarget()
public boolean isSegmentBroadcastTarget()
public boolean isSegmentReplicationOrBroadcastTarget()
public int getPriority()
public String getScheme()
public Iterable<DataSegment> iterateAllSegments()
public int getTotalSegments()
iterateAllSegments() is iterated about the same time, because segments might be
added or removed in parallel.public DataSegment getSegment(SegmentId segmentId)
public DruidServer addDataSegment(DataSegment segment)
public DruidServer addDataSegments(DruidServer server)
@Nullable public DataSegment removeDataSegment(SegmentId segmentId)
public DruidDataSource getDataSource(String dataSource)
public Collection<DruidDataSource> getDataSources()
public int compareTo(DruidServer o)
compareTo in interface Comparable<DruidServer>public ImmutableDruidServer toImmutableDruidServer()
public DruidServer copyWithoutSegments()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.