@Nullable @Override public Object call() throws Exception { sem.acquire(); g.compute().executeAsync(GridJobExecutionLoadTestTask.class, null).listen(lsnr); iterCntr.increment(); return null; } }, threadCnt, dur > 0 ? dur : Long.MAX_VALUE);
/** {@inheritDoc} */ @Override protected ResultT run(VisorIdleVerifyTaskArg arg) throws IgniteException { if (fut == null) { fut = ignite.compute().executeAsync(taskCls, arg); if (!fut.isDone()) { jobCtx.holdcc(); fut.listen((IgniteInClosure<IgniteFuture<ResultT>>)f -> jobCtx.callcc()); return null; } } return fut.get(); }
/** {@inheritDoc} */ @Nullable @Override public Object call() throws Exception { final IgniteInClosure<IgniteFuture<?>> lsnr = new CI1<IgniteFuture<?>>() { @Override public void apply(IgniteFuture<?> t) { tasksSem.release(); } }; ClusterGroup rmts = g.cluster().forRemotes(); while (!finish) { tasksSem.acquire(); g.compute(rmts).executeAsync(GridJobExecutionLoadTestTask.class, null).listen(lsnr); txCnt.increment(); } return null; }
jobCtx.holdcc(); conflictKeysFut.listen(new IgniteInClosure<IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>>>() { @Override public void apply(IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>> f) { jobCtx.callcc(); jobCtx.holdcc(); conflictKeysFut.listen(new IgniteInClosure<IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>>>() { @Override public void apply(IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>> f) { jobCtx.callcc();
/** {@inheritDoc} */ @Override protected VisorIdleVerifyTaskResult run(VisorIdleVerifyTaskArg arg) throws IgniteException { if (fut == null) { fut = ignite.compute().executeAsync(VerifyBackupPartitionsTask.class, arg.getCaches()); if (!fut.isDone()) { jobCtx.holdcc(); fut.listen(new IgniteInClosure<IgniteFuture<Map<PartitionKey, List<PartitionHashRecord>>>>() { @Override public void apply(IgniteFuture<Map<PartitionKey, List<PartitionHashRecord>>> f) { jobCtx.callcc(); } }); return null; } } return new VisorIdleVerifyTaskResult(fut.get()); }
/** {@inheritDoc} */ @Override public Object execute() throws IgniteException { if (future == null) { IgniteCompute compute = ignite.compute().withAsync(); compute.execute(remoteTask, arg); ComputeTaskFuture<R> future = compute.future(); this.future = future; jobCtx.holdcc(); future.listen(new IgniteInClosure<IgniteFuture<R>>() { @Override public void apply(IgniteFuture<R> future) { jobCtx.callcc(); } }); return null; } else { return future.get(); } } }
fut.listen(lsnr);
final ComputeTaskFuture<?> fut = executeAsync(ignite.compute(), GridStopTestTask.class.getName(), null); fut.listen(new CI1<IgniteFuture>() { @SuppressWarnings({"NakedNotify"}) @Override public void apply(IgniteFuture gridFut) {
fut.listen(new CI1<IgniteFuture<int[]>>() { @Override public void apply(IgniteFuture<int[]> fut) {
fut.listen(new CI1<IgniteFuture<Void>>() { @Override public void apply(IgniteFuture<Void> f) { ComputeTaskFuture<?> taskFut = (ComputeTaskFuture<?>)f;
/** {@inheritDoc} */ @Override protected IdleVerifyResultV2 run(VisorIdleVerifyTaskArg arg) throws IgniteException { if (fut == null) { fut = ignite.compute().executeAsync(VerifyBackupPartitionsTaskV2.class, arg); if (!fut.isDone()) { jobCtx.holdcc(); fut.listen(new IgniteInClosure<IgniteFuture<IdleVerifyResultV2>>() { @Override public void apply(IgniteFuture<IdleVerifyResultV2> f) { jobCtx.callcc(); } }); return null; } } return fut.get(); }
/** {@inheritDoc} */ @Override protected ResultT run(VisorIdleVerifyTaskArg arg) throws IgniteException { if (fut == null) { fut = ignite.compute().executeAsync(taskCls, arg); if (!fut.isDone()) { jobCtx.holdcc(); fut.listen(new IgniteInClosure<IgniteFuture<ResultT>>() { @Override public void apply(IgniteFuture<ResultT> f) { jobCtx.callcc(); } }); return null; } } return fut.get(); }
/** {@inheritDoc} */ @Override public Object execute() throws IgniteException { if (future == null) { IgniteCompute compute = ignite.compute().withAsync(); compute.execute(remoteTask, arg); ComputeTaskFuture<R> future = compute.future(); this.future = future; jobCtx.holdcc(); future.listen(new IgniteInClosure<IgniteFuture<R>>() { @Override public void apply(IgniteFuture<R> future) { jobCtx.callcc(); } }); return null; } else { return future.get(); } } }
jobCtx.holdcc(); conflictKeysFut.listen(new IgniteInClosure<IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>>>() { @Override public void apply(IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>> f) { jobCtx.callcc(); jobCtx.holdcc(); conflictKeysFut.listen(new IgniteInClosure<IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>>>() { @Override public void apply(IgniteFuture<Map<PartitionHashRecord, List<PartitionEntryHashRecord>>> f) { jobCtx.callcc();
/** {@inheritDoc} */ @Override protected VisorIdleVerifyTaskResult run(VisorIdleVerifyTaskArg arg) throws IgniteException { if (fut == null) { fut = ignite.compute().executeAsync(VerifyBackupPartitionsTask.class, arg.getCaches()); if (!fut.isDone()) { jobCtx.holdcc(); fut.listen(new IgniteInClosure<IgniteFuture<Map<PartitionKey, List<PartitionHashRecord>>>>() { @Override public void apply(IgniteFuture<Map<PartitionKey, List<PartitionHashRecord>>> f) { jobCtx.callcc(); } }); return null; } } return new VisorIdleVerifyTaskResult(fut.get()); }
compute.future().listen(IgniteInCamelClosure.create(exchange, callback));