@Override public void test(Factory factory, Ignite ignite) throws Exception { ignite.getOrCreateCache("test0"); ignite.getOrCreateCache("test1"); final IgniteCompute comp = ignite.compute(); for (int i = 0; i < MAX_JOB_COUNT; ++i) { IgniteRunnable job = (IgniteRunnable)factory.create(); IgniteFuture<Void> fut = comp.affinityRunAsync(Arrays.asList("test0", "test1"), 0, job); fut.get(); } } });
@Override public void test(Factory factory, Ignite ignite) throws Exception { ignite.getOrCreateCache("test0"); ignite.getOrCreateCache("test1"); final IgniteCompute comp = ignite.compute(); for (int i = 0; i < MAX_JOB_COUNT; ++i) { IgniteRunnable job = (IgniteRunnable)factory.create(); IgniteFuture<Void> fut = comp.affinityRunAsync(Arrays.asList("test0", "test1"), key(0), job); fut.get(); } } });
@Override public void test(Factory factory, Ignite ignite) throws Exception { ignite.getOrCreateCache(CACHE_NAME); final IgniteCompute comp = ignite.compute(); for (int i = 0; i < MAX_JOB_COUNT; ++i) { IgniteRunnable job = (IgniteRunnable)factory.create(); IgniteFuture<Void> fut = comp.affinityRunAsync("test", key(0), job); fut.get(); } } });
@Override public IgniteFuture<?> applyx(ClusterGroup prj) { Affinity<Object> aff = prj.ignite().affinity(DEFAULT_CACHE_NAME); ClusterNode node = F.first(prj.nodes()); return compute(prj).affinityRunAsync(DEFAULT_CACHE_NAME, keyForNode(aff, node), new TestRunnable()); } });
final long key = i; final IgniteFuture<?> f = g.compute().affinityRunAsync("partitioned", GridTestKey.affinityKey(key), new IgniteRunnable() {
grid(1).compute().affinityRunAsync( Arrays.asList(Organization.class.getSimpleName(), Person.class.getSimpleName()), new Integer(orgId),
grid(1).compute().affinityRunAsync( Arrays.asList(Organization.class.getSimpleName(), Person.class.getSimpleName()), new Integer(orgId),
/** * @throws Exception If failed. */ @Test public void testAsync() throws Exception { ClusterGroup empty = ignite(0).cluster().forNodeId(UUID.randomUUID()); assertEquals(0, empty.nodes().size()); IgniteCompute comp = ignite(0).compute(empty); checkFutureFails(comp.affinityRunAsync(DEFAULT_CACHE_NAME, 1, new FailRunnable())); checkFutureFails(comp.applyAsync(new FailClosure(), new Object())); checkFutureFails(comp.affinityCallAsync(DEFAULT_CACHE_NAME, 1, new FailCallable())); checkFutureFails(comp.broadcastAsync(new FailCallable())); }