Module org.elasticsearch.server
Record Class DesiredBalanceMetrics.AllocationStats
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceMetrics.AllocationStats
- Record Components:
unassignedShards- Shards that are not assigned to any node.allocationStatsByRole- A breakdown of the allocations stats byShardRouting.Role
- Enclosing class:
DesiredBalanceMetrics
public static record DesiredBalanceMetrics.AllocationStats(long unassignedShards, Map<ShardRouting.Role,DesiredBalanceMetrics.RoleAllocationStats> allocationStatsByRole)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionAllocationStats(long unassignedShards, long totalAllocations, long undesiredAllocationsExcludingShuttingDownNodes) AllocationStats(long unassignedShards, Map<ShardRouting.Role, DesiredBalanceMetrics.RoleAllocationStats> allocationStatsByRole) Creates an instance of aAllocationStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallocationStatsByRolerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.longlongReturns the value of theunassignedShardsrecord component.longdoubleReturn the ratio of undesired allocations to the total number of allocations.
-
Constructor Details
-
AllocationStats
public AllocationStats(long unassignedShards, long totalAllocations, long undesiredAllocationsExcludingShuttingDownNodes) -
AllocationStats
public AllocationStats(long unassignedShards, Map<ShardRouting.Role, DesiredBalanceMetrics.RoleAllocationStats> allocationStatsByRole) Creates an instance of aAllocationStatsrecord class.- Parameters:
unassignedShards- the value for theunassignedShardsrecord componentallocationStatsByRole- the value for theallocationStatsByRolerecord component
-
-
Method Details
-
totalAllocations
public long totalAllocations() -
undesiredAllocationsExcludingShuttingDownNodes
public long undesiredAllocationsExcludingShuttingDownNodes() -
undesiredAllocationsRatio
public double undesiredAllocationsRatio()Return the ratio of undesired allocations to the total number of allocations.- Returns:
- a value in [0.0, 1.0]
-
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 '=='. -
unassignedShards
public long unassignedShards()Returns the value of theunassignedShardsrecord component.- Returns:
- the value of the
unassignedShardsrecord component
-
allocationStatsByRole
Returns the value of theallocationStatsByRolerecord component.- Returns:
- the value of the
allocationStatsByRolerecord component
-