anuengineer commented on a change in pull request #1469: HDDS-2034. Async RATIS 
pipeline creation and destroy through heartbea…
URL: https://github.com/apache/hadoop/pull/1469#discussion_r327794178
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/command/CommandStatusReportHandler.java
 ##########
 @@ -55,13 +53,21 @@ public void onMessage(CommandStatusReportFromDatanode 
report,
     cmdStatusList.forEach(cmdStatus -> {
       LOGGER.trace("Emitting command status for id:{} type: {}", cmdStatus
           .getCmdId(), cmdStatus.getType());
-      if (cmdStatus.getType() == SCMCommandProto.Type.deleteBlocksCommand) {
+      switch (cmdStatus.getType()) {
+      case deleteBlocksCommand:
         if (cmdStatus.getStatus() == CommandStatus.Status.EXECUTED) {
           publisher.fireEvent(SCMEvents.DELETE_BLOCK_STATUS,
               new DeleteBlockStatus(cmdStatus));
         }
-      } else {
-        LOGGER.debug("CommandStatus of type:{} not handled in " +
+        break;
+      case createPipelineCommand:
+        if (cmdStatus.getStatus() != CommandStatus.Status.PENDING) {
+          publisher.fireEvent(SCMEvents.CREATE_PIPELINE_STATUS,
+              new CreatePipelineStatus(cmdStatus));
+        }
 
 Review comment:
   Do we need a handler for destoryPipeline?

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