/** {@inheritDoc} */ @Override public void listen(IgniteInClosure<? super IgniteInternalFuture<T>> lsnr) { assert lsnr != null; lsnr.apply(this); }
@Override public void apply(IgniteInternalFuture fut0) { lsnr.apply(ComputeConvertingFuture.this); } });
@Override public void run() { lsnr.apply(fut); } });
@Override public Void call() throws Exception { call.apply(idx); return null; } });
/** {@inheritDoc} */ @Override public boolean activate() { activated = true; if (onActivate != null) onActivate.apply(this); return true; }
/** {@inheritDoc} */ @Override public void onLocalNodeInitialized(ClusterNode locNode) { for (IgniteInClosure<ClusterNode> lsnr : locNodeInitLsnrs) lsnr.apply(locNode); if (locNode instanceof IgniteClusterNode) { final IgniteClusterNode node = (IgniteClusterNode)locNode; if (consistentId != null) node.setConsistentId(consistentId); } }
/** * @param evts Events. */ private void onEvents(Iterable<CacheEntryEvent<?, ?>> evts) { clsr.apply(evts); }
/** * Executes given closure for every item in circular buffer. * * @param c Closure to execute. */ public void forEach(IgniteInClosure<T> c) { for (Item<T> t : arr) { T item = t.item(); if (item == null) break; c.apply(item); } }
/** * @param c Cache context closure. */ void forAllCaches(final IgniteInClosure<GridCacheContext> c) { for (Integer cacheId : ctxMap.keySet()) { ctxMap.computeIfPresent(cacheId, (cacheId1, ctx) -> { c.apply(ctx); return ctx; } ); } }
/** {@inheritDoc} */ @Override public void visit(long pageAddr, IgniteInClosure<CacheSearchRow> c) { int cnt = getCount(pageAddr); for (int i = 0; i < cnt; i++) c.apply(new CacheDataRowAdapter(getLink(pageAddr, i))); }
/** {@inheritDoc} */ @Override public void visit(long pageAddr, IgniteInClosure<CacheSearchRow> c) { int cnt = getCount(pageAddr); for (int i = 0; i < cnt; i++) c.apply(new CacheDataRowAdapter(getLink(pageAddr, i))); }
/** * Iterates over cache. * * @param cache Projection. * @param c Visitor closure. */ private void iterate(IgniteCache<Integer, Integer> cache, IgniteInClosure<Cache.Entry<Integer, Integer>> c) { for (Cache.Entry<Integer, Integer> entry : cache.localEntries()) c.apply(entry); }
/** {@inheritDoc} */ @Override public void visit(long pageAddr, IgniteInClosure<CacheSearchRow> c) { int cnt = getCount(pageAddr); for (int i = 0; i < cnt; i++) c.apply(new MvccDataRow(getLink(pageAddr, i))); }
/** {@inheritDoc} */ @Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC) { if (filter != null) filter.apply(msg); super.sendMessage(node, msg, ackC); } }
/** {@inheritDoc} */ @Override public void visit(long pageAddr, IgniteInClosure<CacheSearchRow> c) { int cnt = getCount(pageAddr); for (int i = 0; i < cnt; i++) c.apply(new MvccDataRow(getLink(pageAddr, i))); }
/** * Select all data from the table and check that all records correspond to rules set by given closure. * @param clo Closure to apply to each record. */ private void assertAllPersons(IgniteInClosure<List<?>> clo) { List<List<?>> res = executeSql("SELECT * from Person"); for (List<?> p : res) clo.apply(p); }
@Override public void run() { for (IgniteEx ig : grids()) { try { cls.apply(ig); } catch (AssertionError e) { System.out.println("Assertion on " + ig.name()); throw e; } } } };
@Override public void apply() { IgniteCache<String, Integer> cache = jcache(); while (!fut1.isDone()) if (guard.get()) c.apply(cache); } }, READ_THREAD_CNT, READ_THREAD_NAME);
@Override public void run() { c1.apply(msg); c2.apply(msg); c3.apply(); c4.reduce(); System.out.println("Test message: " + msg); } });
/** * @param h Handler. * @param validateClo Validate clo. * @param args Args. */ private void validate(CommandHandler h, IgniteInClosure<Map<ClusterNode, VisorTxTaskResult>> validateClo, String... args) { assertEquals(EXIT_CODE_OK, execute(h, args)); validateClo.apply(h.getLastOperationResult()); }