You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ptupitsyn (via GitHub)" <gi...@apache.org> on 2024/07/22 09:01:39 UTC

Re: [PR] IGNITE-22646 Support marshalers in the Java Client for Compute API [ignite-3]

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


##########
modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java:
##########
@@ -577,6 +577,13 @@ public static class Compute {
 
         /** Specified node is not found in the cluster. */
         public static final int NODE_NOT_FOUND_ERR = COMPUTE_ERR_GROUP.registerErrorCode((short) 14);
+
+        /**
+         * Incompatible types for argument/result in compute job.
+         * For example, the one has defined a marshaler for Type A in the compute job
+         * but on the client side they have passed Type B.
+         */
+        public static final int TYPE_CHECK_MARSHALING_ERR = COMPUTE_ERR_GROUP.registerErrorCode((short) 15);

Review Comment:
   Existing public APIs spell "Marshalling" with 2 `L`s, please fix spelling here and below.



##########
modules/compute/src/main/java/org/apache/ignite/internal/compute/ComputeComponent.java:
##########
@@ -42,10 +42,9 @@ public interface ComputeComponent extends IgniteComponent {
      * @param units Deployment units which will be loaded for execution.
      * @param jobClassName Name of the job class.
      * @param arg Job args.
-     * @param <R> Job result type.
      * @return Job execution object.
      */
-    <T, R> JobExecution<R> executeLocally(
+    <T> JobExecution<Object> executeLocally(

Review Comment:
   Is there any obstacle that requires those changes?



##########
modules/client/src/test/java/org/apache/ignite/client/fakes/FakeCompute.java:
##########
@@ -111,31 +114,40 @@ public <R> JobExecution<R> executeAsyncWithFailover(
         }
 
         if (jobClassName.startsWith("org.apache.ignite")) {
-            Class<ComputeJob<Object, R>> jobClass = ComputeUtils.jobClass(this.getClass().getClassLoader(), jobClassName);
-            ComputeJob<Object, R> job = ComputeUtils.instantiateJob(jobClass);
-            CompletableFuture<R> jobFut = job.executeAsync(
+            Class<ComputeJob<Object, Object>> jobClass = ComputeUtils.jobClass(this.getClass().getClassLoader(), jobClassName);
+            ComputeJob<Object, Object> job = ComputeUtils.instantiateJob(jobClass);
+            CompletableFuture<Object> jobFut = job.executeAsync(

Review Comment:
   Why?



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org