/** * Awaits a signal on flush condition. * * @throws IgniteInterruptedCheckedException If thread was interrupted. */ private void waitForFlush() throws IgniteInterruptedCheckedException { U.await(flushCond); }
/** * @throws IgniteCheckedException If failed to wait. */ public void awaitStarted() throws IgniteCheckedException { U.await(cacheStartedLatch); }
/** {@inheritDoc} */ @Override public void awaitStart() throws IgniteCheckedException { U.await(startLatch); }
/** * Awaits for a given count of items to be taken. * * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If interrupted. */ private void awaitDone() throws IgniteInterruptedCheckedException { U.await(doneLatch); }
/** * Await for job execution response to come. * * @throws IgniteInterruptedCheckedException If interrupted. */ private void awaitResponse() throws IgniteInterruptedCheckedException { U.await(respLatch); } }
/** * Awaits for a given count of items to be taken. * * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If interrupted. */ private void awaitItems() throws IgniteInterruptedCheckedException { U.await(takeLatch); }
/** * @throws IgniteCheckedException If thread is interrupted or manager * was not successfully initialized. */ private void waitInitialization() throws IgniteCheckedException { if (initLatch.getCount() > 0) U.await(initLatch); if (!initFlag) throw new IgniteCheckedException("DataStructures manager was not properly initialized."); }
/** {@inheritDoc} */ @Override public boolean await(long timeout, TimeUnit unit) { try { initializeLatch(); return U.await(internalLatch, timeout, unit); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** * Await worker stop. */ public void awaitStop() { try { U.await(stopLatch); } catch (IgniteInterruptedCheckedException e) { throw new IgniteException("Failed to wait for lazy worker stop (interrupted): " + name(), e); } }
/** {@inheritDoc} */ @Override public void await() { try { initializeLatch(); U.await(internalLatch); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override protected void loadAllPages() throws IgniteInterruptedCheckedException { assert !Thread.holdsLock(this); U.await(firstPageLatch); Collection<ClusterNode> nodes = null; synchronized (this) { if (!isDone() && !subgrid.isEmpty()) nodes = nodes(); } if (nodes != null) cctx.queries().loadPage(reqId, qry.query(), nodes, true); }
/** * @throws IgniteCheckedException If failed to wait. */ public void awaitStarted() throws IgniteCheckedException { U.await(startLatch); GridCachePreloader prldr = preloader(); if (prldr != null) prldr.startFuture().get(); }
/** {@inheritDoc} */ @Override protected void rebuildIndexesFromHash0(GridCacheContext cctx, SchemaIndexCacheVisitorClosure clo) throws IgniteCheckedException { if (!firstRbld) U.await(INSTANCE.rebuildLatch); else firstRbld = false; super.rebuildIndexesFromHash0(cctx, clo); } }
@Override public Integer applyx(CountDownLatch startLatch, CountDownLatch endLatch2) throws IgniteCheckedException { if (startLatch != null) startLatch.countDown(); int res = cache().size(); if (endLatch2 != null) U.await(endLatch2); return res; } };
@Override public Void call() throws Exception { U.await(getLatch); while (!putFut1.isDone() || !putFut2.isDone()) { Map<Object, Object> vals1 = checkAndGetAll(false, cache, F.asSet(key1, key2), SCAN); Map<Object, Object> vals2 = checkAndGetAll(false, cache, F.asSet(key1, key2), GET); assertEquals(2, vals1.size()); assertEquals(2, vals2.size()); } return null; } }, 4, "get-thread");
/** {@inheritDoc} */ @Override public void beforeJoin(ClusterNode locNode, IgniteLogger log) { try { CountDownLatch writeLatch0 = joinLatch; if (writeLatch0 != null) { log.info("Block join"); U.await(writeLatch0); } } catch (Exception e) { throw new IgniteException(e); } }
/** {@inheritDoc} */ @Override public void beforeReconnect(ClusterNode locNode, IgniteLogger log) { try { CountDownLatch writeLatch0 = reconLatch; if (writeLatch0 != null) { log.info("Block reconnect"); U.await(writeLatch0); } } catch (Exception e) { throw new IgniteException(e); } }
/** * @param fut Future to cancel. * @throws Exception If failed. */ private void testMessageSet(IgniteFuture<?> fut, int initSize, Map map) throws Exception { cancelLatch.await(); assertTrue(fut.cancel()); resLatch.countDown(); assertTrue(U.await(finishLatch, 5000, MILLISECONDS)); info("Map: " + map); assertEquals(map.size(), initSize); }
@SuppressWarnings("unchecked") @Override public void applyx() throws IgniteCheckedException { c.query(new SqlQuery(Integer.class, "_val >= 0")).getAll(); U.await(latch); } }, THREAD_COUNT);
/** * @param fut Future to cancel. * @throws Exception If failed. */ private void testMessageSet(IgniteInternalFuture<?> fut) throws Exception { cancelLatch.await(); assertTrue(fut.cancel()); resLatch.countDown(); assertTrue(U.await(finishLatch, 5000, MILLISECONDS)); Map map = U.field(((IgniteKernal)grid(0)).context().io(), "msgSetMap"); info("Map: " + map); assertTrue(map.isEmpty()); }