Modifier and Type | Field and Description |
---|---|
static ClusterInfo |
EMPTY |
Modifier | Constructor and Description |
---|---|
protected |
ClusterInfo() |
|
ClusterInfo(Map<String,DiskUsage> leastAvailableSpaceUsage,
Map<String,DiskUsage> mostAvailableSpaceUsage,
Map<String,Long> shardSizes,
Map<ShardRouting,String> routingToDataPath)
Creates a new ClusterInfo instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getDataPath(ShardRouting shardRouting)
Returns the nodes absolute data-path the given shard is allocated on or
null if the information is not available. |
Map<String,DiskUsage> |
getNodeLeastAvailableDiskUsages()
Returns a node id to disk usage mapping for the path that has the least available space on the node.
|
Map<String,DiskUsage> |
getNodeMostAvailableDiskUsages()
Returns a node id to disk usage mapping for the path that has the most available space on the node.
|
Long |
getShardSize(ShardRouting shardRouting)
Returns the shard size for the given shard routing or
null it that metric is not available. |
long |
getShardSize(ShardRouting shardRouting,
long defaultValue)
Returns the shard size for the given shard routing or
defaultValue it that metric is not available. |
public static final ClusterInfo EMPTY
protected ClusterInfo()
public ClusterInfo(Map<String,DiskUsage> leastAvailableSpaceUsage, Map<String,DiskUsage> mostAvailableSpaceUsage, Map<String,Long> shardSizes, Map<ShardRouting,String> routingToDataPath)
leastAvailableSpaceUsage
- a node id to disk usage mapping for the path that has the least available space on the node.mostAvailableSpaceUsage
- a node id to disk usage mapping for the path that has the most available space on the node.shardSizes
- a shardkey to size in bytes mapping per shard.routingToDataPath
- the shard routing to datapath mappingshardIdentifierFromRouting(org.elasticsearch.cluster.routing.ShardRouting)
public Map<String,DiskUsage> getNodeLeastAvailableDiskUsages()
public Map<String,DiskUsage> getNodeMostAvailableDiskUsages()
public Long getShardSize(ShardRouting shardRouting)
null
it that metric is not available.public String getDataPath(ShardRouting shardRouting)
null
if the information is not available.public long getShardSize(ShardRouting shardRouting, long defaultValue)
defaultValue
it that metric is not available.Copyright © 2009–2016. All rights reserved.