Module org.elasticsearch.server
Record Class ClusterBalanceStats
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.routing.allocation.allocator.ClusterBalanceStats
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public record ClusterBalanceStats(int shards, int undesiredShardAllocations, Map<String,ClusterBalanceStats.TierBalanceStats> tiers, Map<String,ClusterBalanceStats.NodeBalanceStats> nodes)
extends Record
implements Writeable, ToXContentObject
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final recordNested classes/interfaces inherited from interface org.elasticsearch.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
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionClusterBalanceStats(int shards, int undesiredShardAllocations, Map<String, ClusterBalanceStats.TierBalanceStats> tiers, Map<String, ClusterBalanceStats.NodeBalanceStats> nodes) Creates an instance of aClusterBalanceStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterBalanceStatscreateFrom(ClusterState clusterState, DesiredBalance desiredBalance, ClusterInfo clusterInfo, WriteLoadForecaster writeLoadForecaster) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.nodes()Returns the value of thenodesrecord component.static ClusterBalanceStatsreadFrom(StreamInput in) intshards()Returns the value of theshardsrecord component.tiers()Returns the value of thetiersrecord component.final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) intReturns the value of theundesiredShardAllocationsrecord component.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ClusterBalanceStats
public ClusterBalanceStats(int shards, int undesiredShardAllocations, Map<String, ClusterBalanceStats.TierBalanceStats> tiers, Map<String, ClusterBalanceStats.NodeBalanceStats> nodes) Creates an instance of aClusterBalanceStatsrecord class.- Parameters:
shards- the value for theshardsrecord componentundesiredShardAllocations- the value for theundesiredShardAllocationsrecord componenttiers- the value for thetiersrecord componentnodes- the value for thenodesrecord component
-
-
Method Details
-
createFrom
public static ClusterBalanceStats createFrom(ClusterState clusterState, DesiredBalance desiredBalance, ClusterInfo clusterInfo, WriteLoadForecaster writeLoadForecaster) -
readFrom
- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
shards
public int shards()Returns the value of theshardsrecord component.- Returns:
- the value of the
shardsrecord component
-
undesiredShardAllocations
public int undesiredShardAllocations()Returns the value of theundesiredShardAllocationsrecord component.- Returns:
- the value of the
undesiredShardAllocationsrecord component
-
tiers
Returns the value of thetiersrecord component.- Returns:
- the value of the
tiersrecord component
-
nodes
Returns the value of thenodesrecord component.- Returns:
- the value of the
nodesrecord component
-