ptupitsyn commented on code in PR #4260:
URL: https://github.com/apache/ignite-3/pull/4260#discussion_r1735590325


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/compute/ClientComputeExecuteMapReduceRequest.java:
##########
@@ -82,11 +85,17 @@ static void packJobIds(ClientMessagePacker out, List<UUID> 
ids) {
     }
 
     static CompletableFuture<Object> sendTaskResult(TaskExecution<Object> 
execution, NotificationSender notificationSender) {
+        TaskExecution<Object> t = execution;
         return execution.resultAsync().whenComplete((val, err) ->
-                execution.stateAsync().whenComplete((state, errState) ->
+                t.stateAsync().whenComplete((state, errState) ->
                         execution.statesAsync().whenComplete((states, 
errStates) ->
                                 notificationSender.sendNotification(w -> {
-                                    w.packObjectAsBinaryTuple(val);
+                                    if (t instanceof MarshallerProvider) {
+                                        Marshaller<Object, byte[]> 
resultMarshaller = ((MarshallerProvider<Object>) t).resultMarshaller();
+                                        
ClientComputeJobPacker.packJobResult(val, resultMarshaller, w);
+                                    } else {
+                                        throw new 
IllegalArgumentException(t.getClass() + " does not implement 
MarshallerProvider");
+                                    }

Review Comment:
   ```suggestion
                                           Marshaller<Object, byte[]> 
resultMarshaller = ((MarshallerProvider<Object>) t).resultMarshaller();
                                           
ClientComputeJobPacker.packJobResult(val, resultMarshaller, w);
   ```
   
   No need to replace `ClassCastException` with our own logic.



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