Source:
<code>public void testComputeTask() throws Exception { CyclicBarrier barrier = new CyclicBarrier(2); try (IgniteEx g1 = startGrid(0)) { SystemView<ComputeTaskView> tasks = g1.context().systemView().view(TASKS_VIEW); IgniteCache<Integer, Integer> cache = g1.createCache("test-cache"); cache.put(1, 1); g1.compute().executeAsync(new ComputeTask<Object, Object>() { @Override public @NotNull Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) throws IgniteException { return Collections.singletonMap(new ComputeJob() { @Override public void cancel() { <START> System.out.println("SystemViewSelfTest.cancel"); <END> } @Override public Object execute() throws IgniteException { System.out.println("SystemViewSelfTest.execute"); return 1; } }, subgrid.get(0)); } @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) throws IgniteException { try { barrier.await(); barrier.await(); } catch (InterruptedException | BrokenBarrierException e) { throw new RuntimeException(e); } return null; } @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteException { return 1; } }, 1); barrier.await(); assertEquals(1, tasks.size()); ComputeTaskView t = tasks.iterator().next(); assertFalse(t.internal()); assertNull(t.affinityCacheName()); assertEquals(-1, t.affinityPartitionId()); assertTrue(t.taskClassName().startsWith(getClass().getName())); assertTrue(t.taskName().startsWith(getClass().getName())); assertEquals(g1.localNode().id(), t.taskNodeId()); assertEquals("0", t.userVersion()); barrier.await(); } }</code><technical_language>Some debug output, removed</technical_language>

Target:
public void testComputeTask() throws Exception { CyclicBarrier barrier = new CyclicBarrier(2); try (IgniteEx g1 = startGrid(0)) { SystemView<ComputeTaskView> tasks = g1.context().systemView().view(TASKS_VIEW); IgniteCache<Integer, Integer> cache = g1.createCache("test-cache"); cache.put(1, 1); g1.compute().executeAsync(new ComputeTask<Object, Object>() { @Override public @NotNull Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) throws IgniteException { return Collections.singletonMap(new ComputeJob() { @Override public void cancel() { } @Override public Object execute() throws IgniteException { return 1; } }, subgrid.get(0)); } @Override public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) throws IgniteException { try { barrier.await(); barrier.await(); } catch (InterruptedException | BrokenBarrierException e) { throw new RuntimeException(e); } return null; } @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteException { return 1; } }, 1); barrier.await(); assertEquals(1, tasks.size()); ComputeTaskView t = tasks.iterator().next(); assertFalse(t.internal()); assertNull(t.affinityCacheName()); assertEquals(-1, t.affinityPartitionId()); assertTrue(t.taskClassName().startsWith(getClass().getName())); assertTrue(t.taskName().startsWith(getClass().getName())); assertEquals(g1.localNode().id(), t.taskNodeId()); assertEquals("0", t.userVersion()); barrier.await(); } }