This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch ignite-16771
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-16771 by this push:
     new abbffe920 wip ClientCompute
abbffe920 is described below

commit abbffe9205b40b3c959d93a8b13d5205d1e22ae3
Author: Pavel Tupitsyn <ptupit...@apache.org>
AuthorDate: Thu Apr 14 12:29:01 2022 +0300

    wip ClientCompute
---
 .../apache/ignite/internal/client/compute/ClientCompute.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/modules/client/src/main/java/org/apache/ignite/internal/client/compute/ClientCompute.java
 
b/modules/client/src/main/java/org/apache/ignite/internal/client/compute/ClientCompute.java
index b5fb1df8d..094936ea2 100644
--- 
a/modules/client/src/main/java/org/apache/ignite/internal/client/compute/ClientCompute.java
+++ 
b/modules/client/src/main/java/org/apache/ignite/internal/client/compute/ClientCompute.java
@@ -129,9 +129,15 @@ public class ClientCompute implements IgniteCompute {
     }
 
     private <R> CompletableFuture<R> executeOnOneNode(ClusterNode node, String 
jobClassName, Object[] args) {
+        // TODO: Cluster awareness (IGNITE-16771): send to known node when 
possible.
         return ch.serviceAsync(ClientOp.COMPUTE_EXECUTE, w -> {
-            // TODO: Cluster awareness (IGNITE-16771): if the specified node 
matches existing connection, send nil.
-            w.out().packString(node.name());
+            if 
(w.clientChannel().protocolContext().clusterNode().name().equals(node.name())) {
+                w.out().packNil();
+            }
+            else {
+                w.out().packString(node.name());
+            }
+
             w.out().packString(jobClassName);
             w.out().packObjectArray(args);
         }, r -> (R) r.in().unpackObjectWithType());

Reply via email to