File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,16 @@ public long undesiredAllocationsExcludingShuttingDownNodes() {
6464 public record RoleAllocationStats (long totalAllocations , long undesiredAllocationsExcludingShuttingDownNodes ) {
6565 public static final RoleAllocationStats EMPTY = new RoleAllocationStats (0L , 0L );
6666
67- public float undesiredAllocationsRatio () {
67+ /**
68+ * Return the ratio of undesired allocations to the total number of allocations.
69+ *
70+ * @return a value in [0.0, 1.0]
71+ */
72+ public double undesiredAllocationsRatio () {
6873 if (totalAllocations == 0 ) {
69- return 0f ;
74+ return 0.0 ;
7075 }
71- return undesiredAllocationsExcludingShuttingDownNodes / (float ) totalAllocations ;
76+ return undesiredAllocationsExcludingShuttingDownNodes / (double ) totalAllocations ;
7277 }
7378 }
7479
You can’t perform that action at this time.
0 commit comments