Package org.elasticsearch.cluster
Class ClusterInfo
java.lang.Object
org.elasticsearch.cluster.ClusterInfo
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
public class ClusterInfo extends java.lang.Object implements ToXContentFragment, Writeable
ClusterInfo is an object representing a map of nodes to
DiskUsage
and a map of shard ids to shard sizes, see
InternalClusterInfoService.shardIdentifierFromRouting(String)
for the key used in the shardSizes map-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description static ClusterInfoEMPTY -
Constructor Summary
Constructors Modifier Constructor Description protectedClusterInfo()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) -
Method Summary
Modifier and Type Method Description java.lang.StringgetDataPath(ShardRouting shardRouting)Returns the nodes absolute data-path the given shard is allocated on ornullif 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.LonggetShardSize(ShardRouting shardRouting)Returns the shard size for the given shard routing ornullit that metric is not available.longgetShardSize(ShardRouting shardRouting, long defaultValue)Returns the shard size for the given shard routing ordefaultValueit that metric is not available.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.
-
Field Details
-
Constructor Details
-
ClusterInfo
protected ClusterInfo() -
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)Creates a new ClusterInfo instance.- Parameters:
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 mapping- See Also:
shardIdentifierFromRouting(org.elasticsearch.cluster.routing.ShardRouting)
-
ClusterInfo
- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
getNodeLeastAvailableDiskUsages
Returns a node id to disk usage mapping for the path that has the least available space on the node. -
getNodeMostAvailableDiskUsages
Returns a node id to disk usage mapping for the path that has the most available space on the node. -
getShardSize
Returns the shard size for the given shard routing ornullit that metric is not available. -
getDataPath
Returns the nodes absolute data-path the given shard is allocated on ornullif the information is not available. -
getShardSize
Returns the shard size for the given shard routing ordefaultValueit that metric is not available.
-