@Override public Object call() throws Exception { while (restarts) { stopGrid(1); startGrid(1); U.sleep(100); } return null; } });
@Override public Object call() throws Exception { U.sleep(500); stopGrid(0); return null; } }, "stop-thread");
@Override public Void call() throws Exception { for (int i = 0; i < 3; i++) { startGrid(NODES + 1); U.sleep(1000); stopGrid(NODES + 1); } return null; } });
@Override public void run() { try { U.sleep(500); } catch (IgniteInterruptedCheckedException ignore) { // No-op. } latch.countDown(); } }).start();
@Override public Object call() throws Exception { Random rnd = new Random(); while (!finished.get()) { stopGrid(3); U.sleep(300); startGrid(3); if (rnd.nextBoolean()) // OPC possible only when there is no migration from one backup to another. awaitPartitionMapExchange(); } return null; } });
@Override public Boolean call() throws Exception { latch.countDown(); Random rnd = new Random(); U.sleep((rnd.nextInt(15) + 15) * 1000); block = false; System.out.println(">>> ALLOW connection to coordinator."); return true; } });
@Override public Void call() throws Exception { assertFalse(done.get()); U.sleep(500); assertFalse(done.get()); syncEvtLatch.countDown(); return null; } });
@Override public Object call() throws Exception { while (!finished.get()) { U.sleep(5000); info("Ops/sec: " + cnt.sumThenReset() / 5); } return null; } }, 1);
@Override public Object call() throws Exception { while (!finished.get()) { U.sleep(5000); info("Ops/sec: " + cnt.sumThenReset() / 5); } return null; } }, 1);
@Override public Object call() throws Exception { while (!finished.get()) { U.sleep(5000); info("Ops/sec: " + cnt.sumThenReset() / 5); } return null; } }, 1);
/** {@inheritDoc} */ @Override public void receive(IgniteCache cache, Collection col) throws IgniteException { try { if (cnt.incrementAndGet() == failOn) U.sleep(2 * TIMEOUT); } catch (IgniteInterruptedCheckedException e) { throw new IgniteException(e); } } }
/** {@inheritDoc} */ @Override protected <T> T readMessage(Socket sock, @Nullable InputStream in, long timeout) throws IOException, IgniteCheckedException { if (netDisabled) { U.sleep(timeout); throw new SocketTimeoutException("CustomDiscoverySpi: network is disabled."); } else return super.readMessage(sock, in, timeout); }
/** * Starts up two nodes with specified cache configuration on pre-defined endpoints. * * @param args Command line arguments, none required. * @throws IgniteCheckedException In case of any exception. */ public static void main(String[] args) throws IgniteCheckedException { try (Ignite g = G.start("modules/clients/src/test/resources/spring-server-node.xml")) { U.sleep(Long.MAX_VALUE); } } }
/** * @param millis Time to sleep. */ public static void doSleep(long millis) { try { U.sleep(millis); } catch (Exception e) { throw new IgniteException(e); } }
@Override public Void call() throws Exception { latch.await(); U.sleep(5000); for (int i = 0; i < NODES; i++) stopGrid(getTestIgniteInstanceName(i), false, false); return null; } }, "stop-thread");
/** * Replays all saved messages from map, actual sent is performed. * * @throws IgniteInterruptedCheckedException If interrupted. */ private void replayMessages() throws IgniteInterruptedCheckedException { record = false; for (Runnable r : rs.values()) r.run(); // Causes real messages sending. assertTrue(replay.compareAndSet(false, true)); U.sleep(10000); // Enough time to process delayed GridDhtPartitionsFullMessages. }
@Override public Object call() throws Exception { for (;;) { U.sleep(1000); info("Ops/sec: " + cnt.sumThenReset()); } } }, 1);
@Override public Void call() throws Exception { U.sleep(2000); info("Restart zookeeper server"); zkCluster.getServers().get(0).restart(); info("Zookeeper server restarted"); return null; } }, "start-zk");
/** * @param expNode Expected nodes number. * @param topVer Topology version. * @throws Exception If failed. */ private void checkNoExchange(int expNode, AffinityTopologyVersion topVer) throws Exception { List<IgniteInternalFuture<?>> futs = affFutures(expNode, topVer); U.sleep(1000); for (IgniteInternalFuture<?> fut : futs) assertFalse(fut.isDone()); }