@Override public Void call() throws Exception { grid(0).compute().affinityRun( Arrays.asList(Organization.class.getSimpleName(), OTHER_CACHE_NAME), new Integer(orgId), new IgniteRunnable() { @Override public void run() { // No-op. } }); return null; } }, IgniteException.class, "Failed partition reservation. Partition is not primary on the node.");
/** * Get compute object for the given node IDs. * * @param nodeIds Node IDs. * @return Compute object. */ protected IgniteCompute computeForTask(Collection<UUID> nodeIds) { return nodeIds == null ? compute : platformCtx.kernalContext().grid().compute(compute.clusterGroup().forNodeIds(nodeIds)); }
@Override public Void call() throws Exception { barrier.await(); grid(3).compute().withNoFailover().broadcast(new IgniteRunnable() { @Override public void run() { // No-op. } }); return null; } });
@Override public Void call() throws Exception { barrier.await(); grid(1).compute().withNoFailover().broadcast(new IgniteRunnable() { @Override public void run() { // No-op. } }); return null; } });
@Override public Object call() throws Exception { grid().compute().execute(new FailedTask(), null); return null; } },
/** {@inheritDoc} */ @Override public void stopNodes(Collection<UUID> ids) throws IgniteException { guard(); try { ctx.grid().compute(forNodeIds(ids)).execute(IgniteKillTask.class, false); } finally { unguard(); } }
@Override public Object call() throws Exception { grid(0).compute().affinityCall(NON_DFLT_CACHE_NAME, "key", new FailedCallable("key", MAX_FAILOVER_ATTEMPTS + 1)); return null; } }, ClusterTopologyException.class, "Failed to failover a job to another node");
@Override public Object call() throws Exception { grid(0).compute().affinityRun(NON_DFLT_CACHE_NAME, "key", new FailedRunnable("key", MAX_FAILOVER_ATTEMPTS + 1)); return null; } }, ClusterTopologyException.class, "Failed to failover a job to another node");
/** {@inheritDoc} */ @Override public void restartNodes(Collection<UUID> ids) throws IgniteException { guard(); try { ctx.grid().compute(forNodeIds(ids)).execute(IgniteKillTask.class, true); } finally { unguard(); } }
@Override public Void call() throws Exception { b.await(); while (!fut.isDone()) client.compute().affinityCall(CACHE_NAME, key, new CheckCallable(key, null)); return null; } }, THREADS, "test-thread");
/** * @throws Exception If failed. */ @Test public void testClass() throws Exception { assert grid().compute().execute(TestTask.class, null).equals(TASK_NAME); }
/** {@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(); }
/** * @throws Exception If failed. */ @Test public void testInstance() throws Exception { assert grid().compute().execute(new TestTask(), null).equals(TASK_NAME); }
/** * @throws Exception If failed. */ @Test public void testFailover() throws Exception { grid(1).compute().execute(FailoverTestTask.class, null); }
/** * @throws Exception If failed. */ @Test public void testCacheSizeOnPublicThreadpoolStarvation() throws Exception { grid(0).compute().run(new IgniteRunnable() { @Override public void run() { grid(0).cache(CACHE_NAME).size(); } }); } }
@Override public Object call() throws Exception { grid().compute().withTimeout(100).execute(new TimedOutTask(), null); return null; } },
@Override public IgfsStatus call() throws Exception { IgniteBiTuple<Long, Long> space = igfsCtx.kernalContext().grid().compute().execute( new IgfsGlobalSpaceTask(name()), null); return new IgfsStatus(space.get1(), space.get2()); } });
@Override public Object call() throws Exception { ignite1.compute(ignite1.cluster().forNode(ignite0.localNode())).call(new IgniteCallable<Object>() { @Override public Object call() throws Exception { jobCtx.setAttribute("test-attr", new BrokenAttribute()); return null; } }); return null; } }, IgniteException.class, null);
@Override public Object call() throws Exception { ignite1.compute(ignite1.cluster().forNode(ignite0.localNode())).call(new IgniteCallable<Object>() { @Override public Object call() throws Exception { return new CaseClass.CaseClass2(); } }); return null; } }, BinaryObjectException.class, null);
/** * @throws Exception If failed. */ @Test public void testAffinityCallRestart() throws Exception { assertEquals(MAX_FAILOVER_ATTEMPTS, grid(0).compute().affinityCall(NON_DFLT_CACHE_NAME, "key", new FailedCallable("key", MAX_FAILOVER_ATTEMPTS))); }