Package org.elasticsearch.cluster.health
Class ClusterStateHealth
- java.lang.Object
-
- org.elasticsearch.cluster.health.ClusterStateHealth
-
- All Implemented Interfaces:
Iterable<ClusterIndexHealth>,Writeable
public final class ClusterStateHealth extends Object implements Iterable<ClusterIndexHealth>, Writeable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Constructor Summary
Constructors Constructor Description ClusterStateHealth(int activePrimaryShards, int activeShards, int relocatingShards, int initializingShards, int unassignedShards, int numberOfNodes, int numberOfDataNodes, double activeShardsPercent, ClusterHealthStatus status, Map<String,ClusterIndexHealth> indices)For ClusterHealthResponse's XContent ParserClusterStateHealth(ClusterState clusterState)Creates a newClusterStateHealthinstance considering the current cluster state and all indices in the cluster.ClusterStateHealth(ClusterState clusterState, String[] concreteIndices)Creates a newClusterStateHealthinstance considering the current cluster state and the provided index names.ClusterStateHealth(StreamInput in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetActivePrimaryShards()intgetActiveShards()doublegetActiveShardsPercent()Map<String,ClusterIndexHealth>getIndices()intgetInitializingShards()intgetNumberOfDataNodes()intgetNumberOfNodes()intgetRelocatingShards()ClusterHealthStatusgetStatus()intgetUnassignedShards()inthashCode()Iterator<ClusterIndexHealth>iterator()StringtoString()voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ClusterStateHealth
public ClusterStateHealth(ClusterState clusterState)
Creates a newClusterStateHealthinstance considering the current cluster state and all indices in the cluster.- Parameters:
clusterState- The current cluster state. Must not be null.
-
ClusterStateHealth
public ClusterStateHealth(ClusterState clusterState, String[] concreteIndices)
Creates a newClusterStateHealthinstance considering the current cluster state and the provided index names.- Parameters:
clusterState- The current cluster state. Must not be null.concreteIndices- An array of index names to consider. Must not be null but may be empty.
-
ClusterStateHealth
public ClusterStateHealth(StreamInput in) throws IOException
- Throws:
IOException
-
ClusterStateHealth
public ClusterStateHealth(int activePrimaryShards, int activeShards, int relocatingShards, int initializingShards, int unassignedShards, int numberOfNodes, int numberOfDataNodes, double activeShardsPercent, ClusterHealthStatus status, Map<String,ClusterIndexHealth> indices)For ClusterHealthResponse's XContent Parser
-
-
Method Detail
-
getActiveShards
public int getActiveShards()
-
getRelocatingShards
public int getRelocatingShards()
-
getActivePrimaryShards
public int getActivePrimaryShards()
-
getInitializingShards
public int getInitializingShards()
-
getUnassignedShards
public int getUnassignedShards()
-
getNumberOfNodes
public int getNumberOfNodes()
-
getNumberOfDataNodes
public int getNumberOfDataNodes()
-
getStatus
public ClusterHealthStatus getStatus()
-
getIndices
public Map<String,ClusterIndexHealth> getIndices()
-
getActiveShardsPercent
public double getActiveShardsPercent()
-
iterator
public Iterator<ClusterIndexHealth> iterator()
- Specified by:
iteratorin interfaceIterable<ClusterIndexHealth>
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
-