Package org.elasticsearch.cluster.health
Class ClusterStateHealth
- java.lang.Object
-
- org.elasticsearch.cluster.health.ClusterStateHealth
-
- All Implemented Interfaces:
java.lang.Iterable<ClusterIndexHealth>
,Writeable
public final class ClusterStateHealth extends java.lang.Object implements java.lang.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, java.util.Map<java.lang.String,ClusterIndexHealth> indices)
For ClusterHealthResponse's XContent ParserClusterStateHealth(ClusterState clusterState)
Creates a newClusterStateHealth
instance considering the current cluster state and all indices in the cluster.ClusterStateHealth(ClusterState clusterState, java.lang.String[] concreteIndices)
Creates a newClusterStateHealth
instance considering the current cluster state and the provided index names.ClusterStateHealth(StreamInput in)
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getActivePrimaryShards()
int
getActiveShards()
double
getActiveShardsPercent()
java.util.Map<java.lang.String,ClusterIndexHealth>
getIndices()
int
getInitializingShards()
int
getNumberOfDataNodes()
int
getNumberOfNodes()
int
getRelocatingShards()
ClusterHealthStatus
getStatus()
int
getUnassignedShards()
int
hashCode()
java.util.Iterator<ClusterIndexHealth>
iterator()
java.lang.String
toString()
void
writeTo(StreamOutput out)
Write this into the StreamOutput.
-
-
-
Constructor Detail
-
ClusterStateHealth
public ClusterStateHealth(ClusterState clusterState)
Creates a newClusterStateHealth
instance 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, java.lang.String[] concreteIndices)
Creates a newClusterStateHealth
instance 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 java.io.IOException
- Throws:
java.io.IOException
-
ClusterStateHealth
public ClusterStateHealth(int activePrimaryShards, int activeShards, int relocatingShards, int initializingShards, int unassignedShards, int numberOfNodes, int numberOfDataNodes, double activeShardsPercent, ClusterHealthStatus status, java.util.Map<java.lang.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 java.util.Map<java.lang.String,ClusterIndexHealth> getIndices()
-
getActiveShardsPercent
public double getActiveShardsPercent()
-
iterator
public java.util.Iterator<ClusterIndexHealth> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<ClusterIndexHealth>
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-