sodonnel commented on code in PR #3573:
URL: https://github.com/apache/ozone/pull/3573#discussion_r911815621
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerReplicaCount.java:
##########
@@ -262,22 +60,24 @@ public boolean isOverReplicated() {
*
* @return true if the container is healthy, false otherwise
*/
- public boolean isHealthy() {
- return (container.getState() == HddsProtos.LifeCycleState.CLOSED
- || container.getState() == HddsProtos.LifeCycleState.QUASI_CLOSED)
- && replica.stream()
+ default boolean isHealthy() {
+ HddsProtos.LifeCycleState containerState = getContainer().getState();
+ return (containerState == HddsProtos.LifeCycleState.CLOSED
+ || containerState == HddsProtos.LifeCycleState.QUASI_CLOSED)
+ && getReplicas().stream()
.filter(r -> r.getDatanodeDetails().getPersistedOpState() ==
IN_SERVICE)
.allMatch(r -> LegacyReplicationManager.compareState(
- container.getState(), r.getState()));
+ containerState, r.getState()));
+
}
/**
- * Returns true is there are no replicas of a container available, ie the
- * set of container replica passed in the constructor has zero entries.
+ * Returns true is there are no replicas of the container available, ie the
+ * set of container replicas has zero entries.
*
* @return true if there are no replicas, false otherwise.
*/
- public boolean isMissing() {
- return replica.size() == 0;
+ default boolean isMissing() {
Review Comment:
Yea we could rename isMissing to unRecoverable. I think I originally has
isMissing in the EC class, but Uma asked me to change it to unRecoverable.
Would make sense to standardize on unRecoverable both classes I think.
--
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]