nandakumar131 commented on code in PR #8940:
URL: https://github.com/apache/ozone/pull/8940#discussion_r2275825312
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/RatisContainerSafeModeRule.java:
##########
@@ -137,53 +78,41 @@ protected void process(NodeRegistrationContainerReport
report) {
}
}
- /**
- * Record the reported Container.
- *
- * @param containerID containerID
- */
- private void recordReportedContainer(long containerID) {
- ratisContainerWithMinReplicas.getAndAdd(1);
- getSafeModeMetrics()
- .incCurrentContainersWithOneReplicaReportedCount();
+ /** Record the reported Container. */
+ private void recordReportedContainer() {
+ ratisContainerWithMinReplicas.incrementAndGet();
+ getSafeModeMetrics().incCurrentContainersWithOneReplicaReportedCount();
}
private void initializeRule() {
ratisContainers.clear();
containerManager.getContainers(ReplicationType.RATIS).stream()
- .filter(this::isClosed).filter(c -> c.getNumberOfKeys() > 0)
- .map(ContainerInfo::getContainerID).forEach(ratisContainers::add);
+ .filter(this::isClosed)
+ .filter(c -> c.getNumberOfKeys() > 0)
+ .map(ContainerInfo::containerID)
+ .forEach(ratisContainers::add);
ratisMaxContainer = ratisContainers.size();
- long ratisCutOff = (long) Math.ceil(ratisMaxContainer * safeModeCutoff);
+ long ratisCutOff = (long) Math.ceil(ratisMaxContainer *
getSafeModeCutoff());
getSafeModeMetrics().setNumContainerWithOneReplicaReportedThreshold(ratisCutOff);
LOG.info("Refreshed Containers with one replica threshold count {}.",
ratisCutOff);
}
Review Comment:
`initializeRule()` will be removed in future when we remove the report
processing logic from `SafeModeRules`.
To keep it clean in the mean time I will move this logic as well to the
abstract class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]