tkalkirill commented on code in PR #2814:
URL: https://github.com/apache/ignite-3/pull/2814#discussion_r1386205076


##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/impl/ActionRequestProcessor.java:
##########
@@ -82,25 +84,30 @@ public void handleRequest(RpcContext rpcCtx, ActionRequest 
request) {
 
         JraftServerImpl.DelegatingStateMachine fsm = 
(JraftServerImpl.DelegatingStateMachine) node.getOptions().getFsm();
 
-        if (request.command() instanceof WriteCommand) {
+        if (request instanceof WriteActionRequest) {
             if (fsm.getListener() instanceof BeforeApplyHandler) {
                 synchronized (groupIdSyncMonitor(request.groupId())) {
                     callOnBeforeApply(request, fsm);
-                    applyWrite(node, request, rpcCtx);
+                    applyWrite(node, (WriteActionRequest) request, rpcCtx);
                 }
             } else {
-                applyWrite(node, request, rpcCtx);
+                applyWrite(node, (WriteActionRequest) request, rpcCtx);
             }
         } else {
             if (fsm.getListener() instanceof BeforeApplyHandler) {
                 callOnBeforeApply(request, fsm);
             }
 
-            applyRead(node, request, rpcCtx);
+            applyRead(node, (ReadActionRequest) request, rpcCtx);
         }
     }
+
     private static void callOnBeforeApply(ActionRequest request, 
DelegatingStateMachine fsm) {
-        ((BeforeApplyHandler) 
fsm.getListener()).onBeforeApply(request.command());
+        Command command = request instanceof WriteActionRequest
+                ? ((WriteActionRequest) request).command()
+                : ((ReadActionRequest) request).command();

Review Comment:
   ok



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

Reply via email to