Record Class DesiredBalanceInput

java.lang.Object
java.lang.Record
org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceInput
Record Components:
index - Each DesiredBalanceInput comes from a call to reroute() by a cluster state update, so they arrive in sequence and newer inputs should supersede older ones. The index of the input is its position in this sequence.
routingAllocation - a copy of (the immutable parts of) the context for the allocation decision process
ignoredShards - 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 Details

    • DesiredBalanceInput

      public DesiredBalanceInput(long index, RoutingAllocation routingAllocation, List<ShardRouting> ignoredShards)
      Creates an instance of a DesiredBalanceInput record class.
      Parameters:
      index - the value for the index record component
      routingAllocation - the value for the routingAllocation record component
      ignoredShards - the value for the ignoredShards record component
  • Method Details

    • create

      public static DesiredBalanceInput create(long index, RoutingAllocation routingAllocation)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • index

      public long index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • routingAllocation

      public RoutingAllocation routingAllocation()
      Returns the value of the routingAllocation record component.
      Returns:
      the value of the routingAllocation record component
    • ignoredShards

      public List<ShardRouting> ignoredShards()
      Returns the value of the ignoredShards record component.
      Returns:
      the value of the ignoredShards record component