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



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java
##########
@@ -317,7 +299,44 @@ private Object callServiceLocally(
             return ((PlatformService)svc).invokeMethod(methodName(mtd), false, 
true, args, callAttrs);
         }
         else
-            return mtd.invoke(svc, BinaryUtils.rawArrayInArgs(args, false));
+            return callServiceMethod(svc, mtd, args, callCtx);
+    }
+
+    /**
+     * @param svc Service to be called.
+     * @param mtd Method to call.
+     * @param args Method args.
+     * @param callCtx Service call context.
+     * @return Invocation result.
+     */
+    private static Object callServiceMethod(
+        Service svc,
+        Method mtd,
+        Object[] args,
+        @Nullable ServiceCallContext callCtx
+    ) throws InvocationTargetException, IllegalAccessException {
+        if (callCtx != null)
+            ServiceCallContextHolder.current(callCtx);
+
+        try {
+            return mtd.invoke(svc, args);
+        }
+        finally {
+            if (callCtx != null)
+                ServiceCallContextHolder.current(null);
+        }
+    }
+
+    /** */
+    private Object unmarshalResult(byte[] res) throws IgniteCheckedException {
+        Marshaller marsh = ctx.config().getMarshaller();
+
+        if (KEEP_BINARY.get() && BinaryArray.useBinaryArrays() && marsh 
instanceof BinaryMarshaller) {

Review comment:
       Why we check `BinaryArray.useBinaryArrays()` here? Why not return 
marshalled (binary) data always if KEEP_BINARY=true?

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
##########
@@ -710,7 +709,10 @@ private static boolean areMethodArgsCompatible(Class[] 
argTypes, Object[] args)
                 Object arg = args[i];
                 Class argType = wrap(argTypes[i]);
 
-                if (arg != null && !argType.isAssignableFrom(arg.getClass()))
+                if (arg == null)
+                    continue;
+
+                if (!argType.isAssignableFrom(arg.getClass()))

Review comment:
       Looks like redundant change

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
##########
@@ -924,8 +923,10 @@ else if (BinaryUtils.knownMap(o))
             return unwrapBinariesIfNeeded((Map<Object, Object>)o);
         else if (o instanceof Object[])
             return unwrapBinariesInArray((Object[])o);
+/*

Review comment:
       Comment should be removed

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
##########
@@ -179,6 +180,14 @@ public void writeValue(BinaryWriterExImpl writer, Object 
val, boolean forceCol,
             return;
         }
 
+        if (val instanceof BinaryArray) {
+            BinaryArray val0 = (BinaryArray)val;
+
+            writeArray(writer, GridBinaryMarshaller.OBJ_ARR, val0.array(), 
val0.componentTypeId());

Review comment:
       ```
               if (val0.componentTypeId() == 
GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
                   writeArray(writer, GridBinaryMarshaller.OBJ_ARR, 
val0.array(), val0.componentClassName());
               else
                   writeArray(writer, GridBinaryMarshaller.OBJ_ARR, 
val0.array(), val0.componentTypeId());
   ```
   ?




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