bharatviswa504 commented on a change in pull request #1225: HDDS-1909. Use new 
HA code for Non-HA in OM.
URL: https://github.com/apache/hadoop/pull/1225#discussion_r319620266
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java
 ##########
 @@ -115,7 +119,36 @@ public OMResponse submitRequest(RpcController controller,
           }
         }
       } else {
-        return submitRequestDirectlyToOM(request);
+        OMClientResponse omClientResponse = null;
+        long index = 0L;
+        try {
+          OMClientRequest omClientRequest =
+              OzoneManagerRatisUtils.createClientRequest(request);
+          if (omClientRequest != null) {
+            request = omClientRequest.preExecute(ozoneManager);
+            index = transactionIndex.incrementAndGet();
+            omClientRequest =
+                OzoneManagerRatisUtils.createClientRequest(request);
+            omClientResponse =
+                omClientRequest.validateAndUpdateCache(ozoneManager, index,
+                    ozoneManagerDoubleBuffer::add);
+          } else {
+            return submitRequestDirectlyToOM(request);
+          }
+        } catch(IOException ex) {
+          // As some of the preExecute returns error. So handle here.
+          return createErrorResponse(request, ex);
+        }
+
+        try {
+          omClientResponse.getFlushFuture().get();
+          LOG.trace("Future for {} is completed", request);
+        } catch (ExecutionException | InterruptedException ex) {
+          // Do we need to terminate OM here?
 
 Review comment:
   So, terminate OM here?

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