nandakumar131 commented on a change in pull request #1211: HDDS-1888. Add 
containers to node2container map in SCM as soon as a container is created.
URL: https://github.com/apache/hadoop/pull/1211#discussion_r311579697
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java
 ##########
 @@ -267,6 +267,19 @@ public void removePipeline(Pipeline pipeline) {
     node2PipelineMap.removePipeline(pipeline);
   }
 
+  @Override
+  public void addContainer(DatanodeDetails dd,
+                           ContainerID containerId)
+      throws NodeNotFoundException {
+    try {
+      Set<ContainerID> set = node2ContainerMap.getContainers(dd.getUuid());
+      set.add(containerId);
+      node2ContainerMap.setContainersForDatanode(dd.getUuid(), set);
+    } catch (SCMException e) {
+      e.printStackTrace();
 
 Review comment:
   We can only throw `NodeNotFoundException` or any runtime exception.
   > log the error.
   `printStackTrace` was added to log the error :) We don't have any logger 
defined in MockNodeManager.
   
   The test-case using `MockNodeManager` will anyways depend on the existence 
of container after calling addContainer, and the test should eventually fail if 
this call fails.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to