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 record
static final record
static final record
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested 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 aClusterBalanceStats
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterBalanceStats
createFrom
(ClusterState clusterState, DesiredBalance desiredBalance, ClusterInfo clusterInfo, WriteLoadForecaster writeLoadForecaster) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.nodes()
Returns the value of thenodes
record component.static ClusterBalanceStats
readFrom
(StreamInput in) int
shards()
Returns the value of theshards
record component.tiers()
Returns the value of thetiers
record component.final String
toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, ToXContent.Params params) int
Returns the value of theundesiredShardAllocations
record component.void
writeTo
(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 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 aClusterBalanceStats
record class.- Parameters:
shards
- the value for theshards
record componentundesiredShardAllocations
- the value for theundesiredShardAllocations
record componenttiers
- the value for thetiers
record componentnodes
- the value for thenodes
record component
-
-
Method Details
-
createFrom
public static ClusterBalanceStats createFrom(ClusterState clusterState, DesiredBalance desiredBalance, ClusterInfo clusterInfo, WriteLoadForecaster writeLoadForecaster) -
readFrom
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in 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 theshards
record component.- Returns:
- the value of the
shards
record component
-
undesiredShardAllocations
public int undesiredShardAllocations()Returns the value of theundesiredShardAllocations
record component.- Returns:
- the value of the
undesiredShardAllocations
record component
-
tiers
Returns the value of thetiers
record component.- Returns:
- the value of the
tiers
record component
-
nodes
Returns the value of thenodes
record component.- Returns:
- the value of the
nodes
record component
-