public class ClusterInfo extends java.lang.Object implements ToXContent, Writeable
DiskUsage
and a map of shard ids to shard sizes, see
InternalClusterInfoService.shardIdentifierFromRouting(String)
for the key used in the shardSizes mapToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field and Description |
---|---|
static ClusterInfo |
EMPTY |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
ClusterInfo() |
|
ClusterInfo(ImmutableOpenMap<java.lang.String,DiskUsage> leastAvailableSpaceUsage,
ImmutableOpenMap<java.lang.String,DiskUsage> mostAvailableSpaceUsage,
ImmutableOpenMap<java.lang.String,java.lang.Long> shardSizes,
ImmutableOpenMap<ShardRouting,java.lang.String> routingToDataPath)
Creates a new ClusterInfo instance.
|
|
ClusterInfo(StreamInput in) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDataPath(ShardRouting shardRouting)
Returns the nodes absolute data-path the given shard is allocated on or
null if the information is not available. |
ImmutableOpenMap<java.lang.String,DiskUsage> |
getNodeLeastAvailableDiskUsages()
Returns a node id to disk usage mapping for the path that has the least available space on the node.
|
ImmutableOpenMap<java.lang.String,DiskUsage> |
getNodeMostAvailableDiskUsages()
Returns a node id to disk usage mapping for the path that has the most available space on the node.
|
java.lang.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. |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isFragment
public static final ClusterInfo EMPTY
protected ClusterInfo()
public ClusterInfo(ImmutableOpenMap<java.lang.String,DiskUsage> leastAvailableSpaceUsage, ImmutableOpenMap<java.lang.String,DiskUsage> mostAvailableSpaceUsage, ImmutableOpenMap<java.lang.String,java.lang.Long> shardSizes, ImmutableOpenMap<ShardRouting,java.lang.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 ClusterInfo(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public ImmutableOpenMap<java.lang.String,DiskUsage> getNodeLeastAvailableDiskUsages()
public ImmutableOpenMap<java.lang.String,DiskUsage> getNodeMostAvailableDiskUsages()
public java.lang.Long getShardSize(ShardRouting shardRouting)
null
it that metric is not available.public java.lang.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.