GlenGeng commented on a change in pull request #1981:
URL: https://github.com/apache/ozone/pull/1981#discussion_r588061172



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAInvocationHandler.java
##########
@@ -50,16 +50,20 @@ public SCMHAInvocationHandler(final RequestType requestType,
     this.requestType = requestType;
     this.localHandler = localHandler;
     this.ratisHandler = ratisHandler;
-    ratisHandler.registerStateMachineHandler(requestType, localHandler);
+    if (ratisHandler != null) {
+      ratisHandler.registerStateMachineHandler(requestType, localHandler);
+    }
   }
 
   @Override
   public Object invoke(final Object proxy, final Method method,
                        final Object[] args) throws Throwable {
     try {
       long startTime = Time.monotonicNow();
-      final Object result = method.isAnnotationPresent(Replicate.class) ?
-          invokeRatis(method, args) : invokeLocal(method, args);
+      final Object result =

Review comment:
       Please add a Preconditions.checkNotNull for ratisHandler inside 
invokeRatis too. Thanks!




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



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

Reply via email to