sodonnel commented on code in PR #7402:
URL: https://github.com/apache/ozone/pull/7402#discussion_r1845651827


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java:
##########
@@ -85,22 +98,46 @@ public void setRecoveringTimeout(long recoveringTimeout) {
     this.recoveringTimeout = recoveringTimeout;
   }
 
+  public boolean addContainer(Container<?> container) throws 
StorageContainerException {
+    return addContainer(container, false);
+  }
+
+  public void validateContainerIsMissing(long containerId, State state) throws 
StorageContainerException {
+    if (missingContainerSet.contains(containerId)) {
+      throw new StorageContainerException(String.format("Container with 
container Id %d with state : %s is missing in" +
+          " the DN.", containerId, state),
+          ContainerProtos.Result.CONTAINER_MISSING);
+    }
+  }
+
   /**
    * Add Container to container map.
    * @param container container to be added
    * @return If container is added to containerMap returns true, otherwise
    * false
    */
-  public boolean addContainer(Container<?> container) throws
+  public boolean addContainer(Container<?> container, boolean 
overwriteMissingContainers) throws

Review Comment:
   I would suggest adding a new method here - addContainerIgnoringMissing (or 
something similar), rather than changing the existing interface. That way, it 
avoids changes in existing calling code, and only code that explicitly needs to 
pass the boolean can be changed to call the new method. I suspect this change 
would reduce the number of files impacted by this PR.



-- 
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]

Reply via email to