Module org.elasticsearch.server
Record Class DesiredBalanceInput
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceInput
- Record Components:
index
- EachDesiredBalanceInput
comes from a call toreroute()
by a cluster state update, so they arrive in sequence and newer inputs should supersede older ones. Theindex
of the input is its position in this sequence.routingAllocation
- a copy of (the immutable parts of) the context for the allocation decision processignoredShards
- a list of the shards for which earlier allocators have claimed responsibility
public record DesiredBalanceInput(long index, RoutingAllocation routingAllocation, List<ShardRouting> ignoredShards)
extends Record
The input to the desired balance computation.
-
Constructor Summary
ConstructorDescriptionDesiredBalanceInput
(long index, RoutingAllocation routingAllocation, List<ShardRouting> ignoredShards) Creates an instance of aDesiredBalanceInput
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DesiredBalanceInput
create
(long index, RoutingAllocation routingAllocation) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theignoredShards
record component.long
index()
Returns the value of theindex
record component.Returns the value of theroutingAllocation
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
DesiredBalanceInput
public DesiredBalanceInput(long index, RoutingAllocation routingAllocation, List<ShardRouting> ignoredShards) Creates an instance of aDesiredBalanceInput
record class.- Parameters:
index
- the value for theindex
record componentroutingAllocation
- the value for theroutingAllocation
record componentignoredShards
- the value for theignoredShards
record component
-
-
Method Details
-
create
-
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 '=='. -
index
public long index()Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
routingAllocation
Returns the value of theroutingAllocation
record component.- Returns:
- the value of the
routingAllocation
record component
-
ignoredShards
Returns the value of theignoredShards
record component.- Returns:
- the value of the
ignoredShards
record component
-