/** * Create striped thread pool. * * @param concurrentLvl Concurrency level. * @param igniteInstanceName Node name. * @param threadNamePrefix Thread name prefix. */ public IgniteStripedThreadPoolExecutor(int concurrentLvl, String igniteInstanceName, String threadNamePrefix, UncaughtExceptionHandler eHnd) { execs = new ExecutorService[concurrentLvl]; ThreadFactory factory = new IgniteThreadFactory(igniteInstanceName, threadNamePrefix, eHnd); for (int i = 0; i < concurrentLvl; i++) execs[i] = Executors.newSingleThreadExecutor(factory); }
TimeUnit.MILLISECONDS, workQ, new IgniteThreadFactory(igniteInstanceName, threadNamePrefix, plc, eHnd) );
/** * @param ctx Kernal context. */ public GridServiceProcessor(GridKernalContext ctx) { super(ctx); depExe = Executors.newSingleThreadExecutor(new IgniteThreadFactory(ctx.igniteInstanceName(), "srvc-deploy", oomeHnd)); }
/** * @throws Exception If failed. */ @Test public void testSingleGridThreadExecutor() throws Exception { ExecutorService exec = Executors.newSingleThreadExecutor(new IgniteThreadFactory("gridName", "testThread")); exec.submit(new InterruptingRunnable()).get(); Future<Boolean> fut = exec.submit(new IsInterruptedAssertionCallable()); assert !fut.get() : "Expecting the executorService to reset the interrupted flag when reinvoking the thread"; // Thread is interrupted but Thread.interrupted() is called in AbstractQueuedSynchronizer.acquireInterruptibly // when blockingQueue wants to get the new task (see ThreadPoolExecutor.getTask()). // This will reset the interrupted flag but not the one from GridThread. Any subsequent calls to // Thread.currentThread.isInterrupted() will return true; exec.shutdown(); assert exec.awaitTermination(30, SECONDS); }
/** {@inheritDoc} */ @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Activate service processor [nodeId=" + ctx.localNodeId() + " topVer=" + ctx.discovery().topologyVersionEx() + " ]"); busyLock = new GridSpinBusyLock(); depExe = Executors.newSingleThreadExecutor(new IgniteThreadFactory(ctx.igniteInstanceName(), "srvc-deploy", oomeHnd)); start(); onKernalStart0(); }
pool = Executors.newFixedThreadPool(maxPoolSize, new IgniteThreadFactory(ignite.name(), CACHE_LOADER_THREAD_NAME));
pool = Executors.newFixedThreadPool(maxPoolSize, new IgniteThreadFactory(ignite.name(), CACHE_LOADER_THREAD_NAME));
/** * Create striped thread pool. * * @param concurrentLvl Concurrency level. * @param igniteInstanceName Node name. * @param threadNamePrefix Thread name prefix. */ public IgniteStripedThreadPoolExecutor(int concurrentLvl, String igniteInstanceName, String threadNamePrefix, UncaughtExceptionHandler eHnd) { execs = new ExecutorService[concurrentLvl]; ThreadFactory factory = new IgniteThreadFactory(igniteInstanceName, threadNamePrefix, eHnd); for (int i = 0; i < concurrentLvl; i++) execs[i] = Executors.newSingleThreadExecutor(factory); }
TimeUnit.MILLISECONDS, workQ, new IgniteThreadFactory(igniteInstanceName, threadNamePrefix, plc, eHnd) );
/** * @param ctx Kernal context. */ public GridServiceProcessor(GridKernalContext ctx) { super(ctx); depExe = Executors.newSingleThreadExecutor(new IgniteThreadFactory(ctx.igniteInstanceName(), "srvc-deploy", oomeHnd)); String servicesCompatibilityMode = getString(IGNITE_SERVICES_COMPATIBILITY_MODE); srvcCompatibilitySysProp = servicesCompatibilityMode == null ? null : Boolean.valueOf(servicesCompatibilityMode); }
/** {@inheritDoc} */ @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Activate service processor [nodeId=" + ctx.localNodeId() + " topVer=" + ctx.discovery().topologyVersionEx() + " ]"); busyLock = new GridSpinBusyLock(); depExe = Executors.newSingleThreadExecutor(new IgniteThreadFactory(ctx.igniteInstanceName(), "srvc-deploy", oomeHnd)); start(); onKernalStart0(); }
pool = Executors.newFixedThreadPool(maxPoolSize, new IgniteThreadFactory(ignite.name(), CACHE_LOADER_THREAD_NAME));