Module org.elasticsearch.server
Record Class ShardAssignment
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.routing.allocation.allocator.ShardAssignment
-
Constructor Summary
ConstructorsConstructorDescriptionShardAssignment
(Set<String> nodeIds, int total, int unassigned, int ignored) Creates an instance of aShardAssignment
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
assigned()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
ignored()
Returns the value of theignored
record component.nodeIds()
Returns the value of thenodeIds
record component.static ShardAssignment
ofAssignedShards
(List<ShardRouting> routings) final String
toString()
Returns a string representation of this record class.int
total()
Returns the value of thetotal
record component.int
Returns the value of theunassigned
record component.
-
Constructor Details
-
ShardAssignment
Creates an instance of aShardAssignment
record class.- Parameters:
nodeIds
- the value for thenodeIds
record componenttotal
- the value for thetotal
record componentunassigned
- the value for theunassigned
record componentignored
- the value for theignored
record component
-
-
Method Details
-
assigned
public int assigned() -
ofAssignedShards
-
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 '=='. -
nodeIds
Returns the value of thenodeIds
record component.- Returns:
- the value of the
nodeIds
record component
-
total
public int total()Returns the value of thetotal
record component.- Returns:
- the value of the
total
record component
-
unassigned
public int unassigned()Returns the value of theunassigned
record component.- Returns:
- the value of the
unassigned
record component
-
ignored
public int ignored()Returns the value of theignored
record component.- Returns:
- the value of the
ignored
record component
-