public final class ClusterStateHealth extends Object implements Iterable<ClusterIndexHealth>, Streamable
Constructor and Description |
---|
ClusterStateHealth(ClusterState clusterState)
Creates a new
ClusterStateHealth instance considering the current cluster state and all indices in the cluster. |
ClusterStateHealth(ClusterState clusterState,
String[] concreteIndices)
Creates a new
ClusterStateHealth instance considering the current cluster state and the provided index names. |
ClusterStateHealth(int numberOfNodes,
int numberOfDataNodes,
int activeShards,
int relocatingShards,
int activePrimaryShards,
int initializingShards,
int unassignedShards,
double activeShardsPercent,
ClusterHealthStatus status,
List<String> validationFailures,
Map<String,ClusterIndexHealth> indices)
Full constructor which is only intended to provide wire-compatibility for 2.x.
|
ClusterStateHealth(MetaData clusterMetaData,
RoutingTable routingTables)
Creates a new
ClusterStateHealth instance based on cluster meta data and its routing table as a convenience. |
Modifier and Type | Method and Description |
---|---|
int |
getActivePrimaryShards() |
int |
getActiveShards() |
double |
getActiveShardsPercent() |
Map<String,ClusterIndexHealth> |
getIndices() |
int |
getInitializingShards() |
int |
getNumberOfDataNodes() |
int |
getNumberOfNodes() |
int |
getRelocatingShards() |
ClusterHealthStatus |
getStatus() |
int |
getUnassignedShards() |
List<String> |
getValidationFailures() |
Iterator<ClusterIndexHealth> |
iterator() |
static ClusterStateHealth |
readClusterHealth(StreamInput in) |
void |
readFrom(StreamInput in) |
void |
setStatus(ClusterHealthStatus status)
Allows to explicitly override the derived cluster health status.
|
void |
writeTo(StreamOutput out) |
public ClusterStateHealth(int numberOfNodes, int numberOfDataNodes, int activeShards, int relocatingShards, int activePrimaryShards, int initializingShards, int unassignedShards, double activeShardsPercent, ClusterHealthStatus status, List<String> validationFailures, Map<String,ClusterIndexHealth> indices)
public ClusterStateHealth(MetaData clusterMetaData, RoutingTable routingTables)
ClusterStateHealth
instance based on cluster meta data and its routing table as a convenience.clusterMetaData
- Current cluster meta data. Must not be null.routingTables
- Current routing table. Must not be null.public ClusterStateHealth(ClusterState clusterState)
ClusterStateHealth
instance considering the current cluster state and all indices in the cluster.clusterState
- The current cluster state. Must not be null.public ClusterStateHealth(ClusterState clusterState, String[] concreteIndices)
ClusterStateHealth
instance considering the current cluster state and the provided index names.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.public static ClusterStateHealth readClusterHealth(StreamInput in) throws IOException
IOException
public int getActiveShards()
public int getRelocatingShards()
public int getActivePrimaryShards()
public int getInitializingShards()
public int getUnassignedShards()
public int getNumberOfNodes()
public int getNumberOfDataNodes()
public void setStatus(ClusterHealthStatus status)
Implementation note: This setter is only here to ensure wire compatibility in 2.x. Starting from 3.0, ClusterStateHealth is (effectively) immutable and overrides are handled external to this class.
status
- The override status. Must not be null.public ClusterHealthStatus getStatus()
public Map<String,ClusterIndexHealth> getIndices()
public double getActiveShardsPercent()
public Iterator<ClusterIndexHealth> iterator()
iterator
in interface Iterable<ClusterIndexHealth>
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
Copyright © 2009–2016. All rights reserved.