You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vadim Pakhnushev (Jira)" <ji...@apache.org> on 2026/05/20 08:55:00 UTC

[jira] [Updated] (IGNITE-27855) Add JobExecutionContext#cancellationToken

     [ https://issues.apache.org/jira/browse/IGNITE-27855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vadim Pakhnushev updated IGNITE-27855:
--------------------------------------
    Release Note: Cancellation token is passed to the job execution context to allow streamlined usage of other APIs that take it as an argument

> Add JobExecutionContext#cancellationToken
> -----------------------------------------
>
>                 Key: IGNITE-27855
>                 URL: https://issues.apache.org/jira/browse/IGNITE-27855
>             Project: Ignite
>          Issue Type: Improvement
>          Components: compute ai3
>            Reporter: Pavel Tupitsyn
>            Assignee: Vadim Pakhnushev
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.2
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> As a user, I want to cancel queries in my compute job when the job is cancelled, by passing *JobExecutionContext#cancellationToken* to those queries.
> Currently, I have to poll *JobExecutionContext#isCancelled* and manually orchestrate cancellation with *CancelHandle* and *CancellationToken*.
> Usage example:
> {code:java}
> private static class CreateTableJob implements ComputeJob<String, Void> {
>     @Override
>     public CompletableFuture<Void> executeAsync(JobExecutionContext context, String tableName) {
>         return context.ignite().sql()
>                 .executeAsync((Transaction) null, context.cancellationToken(), "CREATE TABLE " + tableName + "(key BIGINT PRIMARY KEY, val INT)")
>                 .thenApply(x -> null);
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)