PakhomovAlexander commented on code in PR #3190:
URL: https://github.com/apache/ignite-3/pull/3190#discussion_r1504163059
##########
modules/api/src/main/java/org/apache/ignite/compute/IgniteCompute.java:
##########
@@ -191,18 +237,116 @@ <K, R> JobExecution<R> executeColocatedAsync(
* @param jobClassName Name of the job class to execute.
* @param args Arguments of the job.
* @param <R> Job result type.
- * @return CompletableFuture Job result.
+ * @return Job execution object.
* @throws ComputeException If there is any problem executing the job.
*/
- default <K, R> JobExecution<R> executeColocatedAsync(
+ default <K, R> JobExecution<R> submitColocated(
String tableName,
K key,
Mapper<K> keyMapper,
List<DeploymentUnit> units,
String jobClassName,
Object... args
) {
- return executeColocatedAsync(tableName, key, keyMapper, units,
jobClassName, DEFAULT, args);
+ return submitColocated(tableName, key, keyMapper, units, jobClassName,
DEFAULT, args);
+ }
+
+ /**
+ * Submits a job of the given class for the execution on the node where
the given key is located. The node is a leader of the
+ * corresponding RAFT group.
+ *
+ * @param tableName Name of the table whose key is used to determine the
node to execute the job on.
+ * @param key Key that identifies the node to execute the job on.
+ * @param units Deployment units. Can be empty.
+ * @param jobClassName Name of the job class to execute.
+ * @param options job execution options (priority, max retries).
+ * @param args Arguments of the job.
+ * @param <R> Job result type.
+ * @return Job result future.
+ */
+ default <R> CompletableFuture<R> executeColocatedAsync(
+ String tableName,
+ Tuple key,
+ List<DeploymentUnit> units,
+ String jobClassName,
+ JobExecutionOptions options,
+ Object... args
+ ) {
+ return this.<R>submitColocated(tableName, key, units, jobClassName,
options, args).resultAsync();
+ }
+
+ /**
+ * Submits a job of the given class for the execution on the node where
the given key is located with default execution options
+ * {@link JobExecutionOptions#DEFAULT}. The node is a leader of the
corresponding RAFT group.
+ *
+ * @param tableName Name of the table whose key is used to determine the
node to execute the job on.
+ * @param key Key that identifies the node to execute the job on.
+ * @param units Deployment units. Can be empty.
+ * @param jobClassName Name of the job class to execute.
+ * @param args Arguments of the job.
+ * @param <R> Job result type.
+ * @return Job result future.
+ */
+ default <R> CompletableFuture<R> executeColocatedAsync(
Review Comment:
oooohh, it calles `.resultAsync()`. Can you mention that in the method
javadoc??
##########
modules/api/src/main/java/org/apache/ignite/compute/IgniteCompute.java:
##########
@@ -191,18 +237,116 @@ <K, R> JobExecution<R> executeColocatedAsync(
* @param jobClassName Name of the job class to execute.
* @param args Arguments of the job.
* @param <R> Job result type.
- * @return CompletableFuture Job result.
+ * @return Job execution object.
* @throws ComputeException If there is any problem executing the job.
*/
- default <K, R> JobExecution<R> executeColocatedAsync(
+ default <K, R> JobExecution<R> submitColocated(
String tableName,
K key,
Mapper<K> keyMapper,
List<DeploymentUnit> units,
String jobClassName,
Object... args
) {
- return executeColocatedAsync(tableName, key, keyMapper, units,
jobClassName, DEFAULT, args);
+ return submitColocated(tableName, key, keyMapper, units, jobClassName,
DEFAULT, args);
+ }
+
+ /**
+ * Submits a job of the given class for the execution on the node where
the given key is located. The node is a leader of the
+ * corresponding RAFT group.
+ *
+ * @param tableName Name of the table whose key is used to determine the
node to execute the job on.
+ * @param key Key that identifies the node to execute the job on.
+ * @param units Deployment units. Can be empty.
+ * @param jobClassName Name of the job class to execute.
+ * @param options job execution options (priority, max retries).
+ * @param args Arguments of the job.
+ * @param <R> Job result type.
+ * @return Job result future.
+ */
+ default <R> CompletableFuture<R> executeColocatedAsync(
+ String tableName,
+ Tuple key,
+ List<DeploymentUnit> units,
+ String jobClassName,
+ JobExecutionOptions options,
+ Object... args
+ ) {
+ return this.<R>submitColocated(tableName, key, units, jobClassName,
options, args).resultAsync();
+ }
+
+ /**
+ * Submits a job of the given class for the execution on the node where
the given key is located with default execution options
+ * {@link JobExecutionOptions#DEFAULT}. The node is a leader of the
corresponding RAFT group.
+ *
+ * @param tableName Name of the table whose key is used to determine the
node to execute the job on.
+ * @param key Key that identifies the node to execute the job on.
+ * @param units Deployment units. Can be empty.
+ * @param jobClassName Name of the job class to execute.
+ * @param args Arguments of the job.
+ * @param <R> Job result type.
+ * @return Job result future.
+ */
+ default <R> CompletableFuture<R> executeColocatedAsync(
Review Comment:
same
##########
modules/api/src/main/java/org/apache/ignite/compute/IgniteCompute.java:
##########
@@ -191,18 +237,116 @@ <K, R> JobExecution<R> executeColocatedAsync(
* @param jobClassName Name of the job class to execute.
* @param args Arguments of the job.
* @param <R> Job result type.
- * @return CompletableFuture Job result.
+ * @return Job execution object.
* @throws ComputeException If there is any problem executing the job.
*/
- default <K, R> JobExecution<R> executeColocatedAsync(
+ default <K, R> JobExecution<R> submitColocated(
String tableName,
K key,
Mapper<K> keyMapper,
List<DeploymentUnit> units,
String jobClassName,
Object... args
) {
- return executeColocatedAsync(tableName, key, keyMapper, units,
jobClassName, DEFAULT, args);
+ return submitColocated(tableName, key, keyMapper, units, jobClassName,
DEFAULT, args);
+ }
+
+ /**
+ * Submits a job of the given class for the execution on the node where
the given key is located. The node is a leader of the
+ * corresponding RAFT group.
+ *
+ * @param tableName Name of the table whose key is used to determine the
node to execute the job on.
+ * @param key Key that identifies the node to execute the job on.
+ * @param units Deployment units. Can be empty.
+ * @param jobClassName Name of the job class to execute.
+ * @param options job execution options (priority, max retries).
+ * @param args Arguments of the job.
+ * @param <R> Job result type.
+ * @return Job result future.
+ */
+ default <R> CompletableFuture<R> executeColocatedAsync(
Review Comment:
submitColocatedAsync?
--
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]