@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 Void call() throws Exception { barrier.await(); grid(3).compute().withNoFailover().broadcast(new IgniteRunnable() { @Override public void run() { // No-op. } }); return null; } });
@Override public Object call() throws Exception { g.compute().withNoFailover().run(r); return null; } },
@Override public Object call() throws Exception { g.compute().withNoFailover().execute(new TestTask(true), null); return null; } },
/** * @throws Exception If failed. */ @Test public void testCorrectException() throws Exception { Ignite ignite = ignite(0); IgniteCompute comp = ignite.compute(ignite.cluster().forRemotes()).withNoFailover(); stopGrid(1); try { comp.call(new IgniteCallable<Object>() { @Override public Object call() throws Exception { fail("Should not be called."); return null; } }); fail(); } catch (ClusterTopologyException e) { log.info("Expected exception: " + e); } }
/** * @throws Exception If failed. */ @Test public void testCallAsyncErrorNoFailover() throws Exception { IgniteCompute comp = compute(grid(0).cluster().forPredicate(F.notEqualTo(grid(0).localNode()))); IgniteFuture<Integer> fut = comp.withNoFailover().callAsync(new ClosureTestCallableError()); try { fut.get(); assert false : "Exception should have been thrown."; } catch (IgniteException e) { info("Caught expected exception: " + e); } }
/** * Test that query result could be returned from remote node. * * @throws Exception In case of error. */ @Test public void testSerialization() throws Exception { IgniteEx g0 = grid(0); IgniteCache<Integer, GridCacheQueryTestValue> c0 = g0.cache(CACHE_NAME); c0.put(1, value("A", 1, 1)); c0.put(2, value("B", 2, 2)); IgniteEx g1 = grid(1); IgniteCache<Integer, GridCacheQueryTestValue> c1 = g1.cache(CACHE_NAME); c1.put(3, value("C", 3, 3)); c1.put(4, value("D", 4, 4)); List<Cache.Entry<Integer, GridCacheQueryTestValue>> qryRes = g0.compute(g0.cluster().forNode(g1.localNode())).withNoFailover().call(new QueryCallable()); assert !qryRes.isEmpty(); info(">>>> Query result:"); for (Cache.Entry<Integer, GridCacheQueryTestValue> entry : qryRes) info(">>>>>>>" + entry.getKey() + " " + entry.getValue().getField1()); }
grid(0).compute(grid(0).cluster().forClients()).withNoFailover().broadcast(new IgniteRunnable() { @Override public void run() {