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 aShardAssignmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintassigned()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intignored()Returns the value of theignoredrecord component.nodeIds()Returns the value of thenodeIdsrecord component.static ShardAssignmentofAssignedShards(List<ShardRouting> routings) final StringtoString()Returns a string representation of this record class.inttotal()Returns the value of thetotalrecord component.intReturns the value of theunassignedrecord component.
-
Constructor Details
-
ShardAssignment
Creates an instance of aShardAssignmentrecord class.- Parameters:
nodeIds- the value for thenodeIdsrecord componenttotal- the value for thetotalrecord componentunassigned- the value for theunassignedrecord componentignored- the value for theignoredrecord 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 thenodeIdsrecord component.- Returns:
- the value of the
nodeIdsrecord component
-
total
public int total()Returns the value of thetotalrecord component.- Returns:
- the value of the
totalrecord component
-
unassigned
public int unassigned()Returns the value of theunassignedrecord component.- Returns:
- the value of the
unassignedrecord component
-
ignored
public int ignored()Returns the value of theignoredrecord component.- Returns:
- the value of the
ignoredrecord component
-