alex-plekhanov commented on a change in pull request #9629:
URL: https://github.com/apache/ignite/pull/9629#discussion_r769663127



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -174,6 +206,8 @@ private void writeServiceInvokeRequest(
                         writer.writeObject(args[i]);
                     }
                 }
+
+                writer.writeMap(withCallCtx ? 
((ServiceCallContextImpl)callCtx).values() : null);

Review comment:
       Also, should not write anything (including `null`) if 
`ProtocolBitmaskFeature.SERVICE_INVOKE_CALLCTX` is not supported.

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -174,6 +206,8 @@ private void writeServiceInvokeRequest(
                         writer.writeObject(args[i]);
                     }
                 }
+
+                writer.writeMap(withCallCtx ? 
((ServiceCallContextImpl)callCtx).values() : null);

Review comment:
       What if the user implements and passes to method their own 
`ServiceCallContext` implementation? We should check it and throw an error with 
reasonable message, or introduce some kind of `attributeNames()` method in 
public interface, to get all possible attributes for this context.

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java
##########
@@ -119,8 +143,10 @@ private ServiceInvocationHandler(String name, long 
timeout, ClientClusterGroupIm
                 if (nodeIds != null && nodeIds.isEmpty())
                     throw new ClientException("Cluster group is empty.");
 
-                return ch.service(ClientOperation.SERVICE_INVOKE,
-                    req -> writeServiceInvokeRequest(req, nodeIds, method, 
args),
+                boolean withCallCtx = callCtx != null;
+
+                return ch.service(withCallCtx ? 
ClientOperation.SERVICE_INVOKE_CALLCTX : ClientOperation.SERVICE_INVOKE,

Review comment:
       Lets' extend `ClientOperation.SERVICE_INVOKE`, it's redundant to 
introduce a new client operation type.




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