[ https://issues.apache.org/jira/browse/IGNITE-24174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vadim Pakhnushev updated IGNITE-24174: -------------------------------------- Description: While investigating IGNITE-23601, it was found that the existing compute API could be unified as follows: {code:java} CompletableFuture<JobExecution<R>> submitAsync(JobTarget target, CancellationToken cancellationToken, ...); CompletableFuture<BroadcastExecution<R>> submitAsync(BroadcastJobTarget target, CancellationToken cancellationToken, ...); CompletableFuture<R> executeAsync(JobTarget target, CancellationToken cancellationToken, ...); // shorthand for submitAsync().thenCompose(JobExecution::resultAsync); CompletableFuture<Collection<R>> executeAsync(BroadcastJobTarget target, CancellationToken cancellationToken, ...); // shorthand for submitAsync().thenCompose(BroadcastExecution::resultAsync); R execute(JobTarget target, CancellationToken cancellationToken, ...); Collection<R> execute(BroadcastJobTarget target, CancellationToken cancellationToken, ...); interface BroadcastExecution { Collection<JobExecution<R>> executions(); CompletableFuture<Collection<R>> resultsAsync(); } {code} Remove submit methods. Remove {{cancelAsync}} from the {{JobExecution}} and {{TaskExecution}}, cancelling should be done only via {{CancellationToken}}. was: While investigating IGNITE-23601, it was found that the existing compute API could be unified as follows: {code:java} CompletableFuture<JobExecution<R>> submitAsync(JobTarget target, CancelHandle handle, ...); CompletableFuture<BroadcastExecution<R>> submitAsync(BroadcastJobTarget target, CancelHandle handle, ...); R execute(JobTarget target, CancelHandle handle, ...); Collection<R> execute(BroadcastJobTarget target, CancelHandle handle, ...); interface BroadcastExecution { CompletableFuture<Collection<R>> resultsAsync(); } {code} Remove submit and executeAsync methods. Remove cancelAsync from the JobExecution, cancelling should be done only via CancelHandle. > Unify compute API > ----------------- > > Key: IGNITE-24174 > URL: https://issues.apache.org/jira/browse/IGNITE-24174 > Project: Ignite > Issue Type: Improvement > Components: compute > Reporter: Vadim Pakhnushev > Assignee: Vadim Pakhnushev > Priority: Major > Labels: ignite-3 > Time Spent: 20m > Remaining Estimate: 0h > > While investigating IGNITE-23601, it was found that the existing compute API > could be unified as follows: > {code:java} > CompletableFuture<JobExecution<R>> submitAsync(JobTarget target, > CancellationToken cancellationToken, ...); > CompletableFuture<BroadcastExecution<R>> submitAsync(BroadcastJobTarget > target, CancellationToken cancellationToken, ...); > CompletableFuture<R> executeAsync(JobTarget target, CancellationToken > cancellationToken, ...); // shorthand for > submitAsync().thenCompose(JobExecution::resultAsync); > CompletableFuture<Collection<R>> executeAsync(BroadcastJobTarget target, > CancellationToken cancellationToken, ...); // shorthand for > submitAsync().thenCompose(BroadcastExecution::resultAsync); > R execute(JobTarget target, CancellationToken cancellationToken, ...); > Collection<R> execute(BroadcastJobTarget target, CancellationToken > cancellationToken, ...); > interface BroadcastExecution { > Collection<JobExecution<R>> executions(); > CompletableFuture<Collection<R>> resultsAsync(); > } > {code} > Remove submit methods. > Remove {{cancelAsync}} from the {{JobExecution}} and {{TaskExecution}}, > cancelling should be done only via {{CancellationToken}}. -- This message was sent by Atlassian Jira (v8.20.10#820010)