/** * Callback that is invoked when kernal is ready. */ public void onKernalStart() { // Accept connections only when grid is ready. if (srvEndpoint != null) new IgniteThread(acceptWorker).start(); }
/** * Start this worker. */ void start() { new IgniteThread(this).start(); }
/** * Start this worker. */ void start() { new IgniteThread(this).start(); }
/** * Perform initialization routine. * * @return This instance. */ public SchemaOperationWorker start() { if (startGuard.compareAndSet(false, true)) { if (!fut.isDone()) new IgniteThread(this).start(); } return this; }
/** * */ private void startCleanupWorker() { cleanupWorker = new CleanupWorker(); new IgniteThread(cleanupWorker).start(); }
/** * Restart worker in IgniteThread. */ public void restart() { assert runner() == null : "WALWriter is still running."; isCancelled = false; new IgniteThread(this).start(); } }
/** * Restart worker in IgniteThread. */ public void restart() { assert runner() == null : "FileArchiver is still running"; isCancelled = false; new IgniteThread(archiver).start(); } }
/** * Restart worker in IgniteThread. */ public void restart() { assert runner() == null : "WalSegmentSyncer is running."; isCancelled = false; new IgniteThread(walSegmentSyncWorker).start(); } }
/** */ void restart() { assert runner() == null : "FileCompressorWorker is still running."; isCancelled = false; new IgniteThread(this).start(); }
/** Restart worker. */ void restart() { assert runner() == null : "FileDecompressor is still running."; isCancelled = false; new IgniteThread(this).start(); } }
/** * Starts processing of services deployments tasks. */ void startProcessing() { assert depWorker.runner() == null : "Method shouldn't be called twice during lifecycle;"; new IgniteThread(ctx.igniteInstanceName(), "services-deployment-worker", depWorker).start(); }
/** {@inheritDoc} */ @Override public void start() { new IgniteThread(timeoutWorker).start(); if (log.isDebugEnabled()) log.debug("Timeout processor started."); }
/** * Process partitions asynchronously. * * @param parts Partitions. * @param clo Closure. * @param remainder Remainder. * @return Future. */ private GridFutureAdapter<Void> processPartitionsAsync(List<GridDhtLocalPartition> parts, SchemaIndexCacheVisitorClosure clo, int remainder) { GridFutureAdapter<Void> fut = new GridFutureAdapter<>(); AsyncWorker worker = new AsyncWorker(parts, clo, remainder, fut); new IgniteThread(worker).start(); return fut; }
/** {@inheritDoc} */ @Override protected void body() throws InterruptedException { try { while (!Thread.interrupted()) { ShmemWorker e = new ShmemWorker(srv.accept(), true); shmemWorkers.add(e); new IgniteThread(e).start(); } } catch (IgniteCheckedException e) { if (!isCancelled()) U.error(log, "Shmem server failed.", e); } finally { srv.close(); } }
/** {@inheritDoc} */ @Override protected void body() throws InterruptedException { try { while (!Thread.interrupted()) { ShmemWorker e = new ShmemWorker(srv.accept()); shmemWorkers.add(e); new IgniteThread(e).start(); } } catch (IgniteCheckedException e) { if (!isCancelled()) U.error(log, "Shmem server failed.", e); } finally { srv.close(); } }
/** * Called when all partitions have been fully restored and pre-created on node start. * * Starts checkpointing process and initiates first checkpoint. * * @throws IgniteCheckedException If first checkpoint has failed. */ @Override public void onStateRestored(AffinityTopologyVersion topVer) throws IgniteCheckedException { IgniteThread cpThread = new IgniteThread(cctx.igniteInstanceName(), "db-checkpoint-thread", checkpointer); cpThread.start(); checkpointerThread = cpThread; CheckpointProgressSnapshot chp = checkpointer.wakeupForCheckpoint(0, "node started"); if (chp != null) chp.cpBeginFut.get(); }
/** * @throws Exception If failed. */ @Test public void testAssertion() throws Exception { Collection<IgniteThread> ts = new ArrayList<>(); for (int i = 0; i < THREAD_CNT; i++) { ts.add(new IgniteThread("test-grid-" + i, "test-thread", new Runnable() { @Override public void run() { assert false : "Expected assertion."; } })); } for (IgniteThread t : ts) t.start(); for (IgniteThread t : ts) t.join(); } }
/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { FileSystemConfiguration igfsCfg = igfsCtx.configuration(); if (igfsCfg.isIpcEndpointEnabled()) { IgfsIpcEndpointConfiguration ipcCfg = igfsCfg.getIpcEndpointConfiguration(); if (ipcCfg == null) ipcCfg = new IgfsIpcEndpointConfiguration(); bind(ipcCfg, /*management*/false); } if (igfsCfg.getManagementPort() >= 0) { IgfsIpcEndpointConfiguration mgmtIpcCfg = new IgfsIpcEndpointConfiguration(); mgmtIpcCfg.setType(TCP); mgmtIpcCfg.setPort(igfsCfg.getManagementPort()); bind(mgmtIpcCfg, /*management*/true); } if (bindWorker != null) new IgniteThread(bindWorker).start(); }
/** * @throws Exception If failed. */ @Test public void testSyntheticWorkerTermination() throws Exception { IgniteEx ignite = grid(0); WorkersRegistry registry = ignite.context().workersRegistry(); long fdTimeout = ignite.configuration().getFailureDetectionTimeout(); GridWorker worker = new GridWorker(ignite.name(), "test-worker", log, registry) { @Override protected void body() throws InterruptedException { Thread.sleep(fdTimeout / 2); } }; IgniteThread thread = new IgniteThread(worker); failureHndThreadName = null; thread.start(); thread.join(); assertTrue(GridTestUtils.waitForCondition(() -> thread.getName().equals(failureHndThreadName), fdTimeout * 2)); }