Skip to content

Commit 59aaa5c

Browse files
authored
HDDS-12418. Remove healthyReplicaCountAdapter from RatisContainerReplicaCount (#7972)
1 parent 232e780 commit 59aaa5c

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/RatisContainerReplicaCount.java

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,11 @@ private void countReplicas() {
191191
* Total healthy replicas = 3 = 1 matching + 2 mismatched replicas
192192
*/
193193
public int getHealthyReplicaCount() {
194-
return healthyReplicaCount + healthyReplicaCountAdapter()
195-
+ decommissionCount + maintenanceCount;
194+
return healthyReplicaCount + decommissionCount + maintenanceCount;
196195
}
197196

198197
public int getUnhealthyReplicaCount() {
199-
return unhealthyReplicaCount + getUnhealthyReplicaCountAdapter()
200-
+ unhealthyDecommissionCount + unhealthyMaintenanceCount;
201-
}
202-
203-
protected int getUnhealthyReplicaCountAdapter() {
204-
return 0;
198+
return unhealthyReplicaCount + unhealthyDecommissionCount + unhealthyMaintenanceCount;
205199
}
206200

207201
public int getMisMatchedReplicaCount() {
@@ -213,21 +207,13 @@ public int getMatchingReplicaCount() {
213207
}
214208

215209
private int getAvailableReplicas() {
216-
int available = healthyReplicaCount + healthyReplicaCountAdapter();
210+
int available = healthyReplicaCount;
217211
if (considerUnhealthy) {
218-
available += unhealthyReplicaCount + getUnhealthyReplicaCountAdapter();
212+
available += unhealthyReplicaCount;
219213
}
220214
return available;
221215
}
222216

223-
/**
224-
* The new replication manager now does not consider replicas with
225-
* UNHEALTHY state when counting sufficient replication.
226-
*/
227-
protected int healthyReplicaCountAdapter() {
228-
return 0;
229-
}
230-
231217
@Override
232218
public int getDecommissionCount() {
233219
return considerUnhealthy

0 commit comments

Comments
 (0)