swamirishi commented on code in PR #7402:
URL: https://github.com/apache/ozone/pull/7402#discussion_r1845664489
##########
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:
There is already a method for that.
https://github.com/apache/ozone/blob/af0f757622a82843864bf5aaa93b2470a398f442/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java#L106-L108
--
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]