sodonnel commented on code in PR #4655:
URL: https://github.com/apache/ozone/pull/4655#discussion_r1231167551
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java:
##########
@@ -370,6 +384,26 @@ private void updateContainerReplica(final DatanodeDetails
datanodeDetails,
}
}
+ /**
+ * Determines whether container replica is empty or not.
+ *
+ * @param replicaProto container replica details.
+ * @return true if container replica is empty else false
+ */
+ private boolean fillEmpty(final ContainerReplicaProto replicaProto) {
+ if (replicaProto.hasIsEmpty()) {
+ return replicaProto.getIsEmpty();
+ } else {
+ // Handled when DN version is old then there will not be isEmpty field.
+ // In this case judge container empty based on keyCount
+ // and bytesUsed field.
+ if (replicaProto.getKeyCount() == 0 && replicaProto.getUsed() == 0) {
+ return true;
+ }
Review Comment:
OK - it is fine to remove the compatibility part. I am sure I have seen (and
had review comments against my own code) code in the past that does this
compatibility thing, which I why I raised it, but if we really don't need to
worry about it for now, then that is good to know for the future.
--
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]