private static synchronized ExecutorService getLoadThreadPool(int maxLoadThreads) { if (loadThreadPool != null) { return loadThreadPool; } if (maxLoadThreads > 0) { BlockingQueue<Runnable> q = new LinkedBlockingQueue<>(); loadThreadPool = new ThreadPoolExecutor(0, maxLoadThreads, 60, TimeUnit.SECONDS, q, new NamingThreadFactory("bloom-loader")); } return loadThreadPool; }
private ExecutorService createEs(int min, int max, int timeout, String name) { return addEs(name, new ThreadPoolExecutor(min, max, timeout, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new NamingThreadFactory(name))); }
public SimpleThreadPool(int max, final String name) { super(max, max, 4L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new NamingThreadFactory(name)); allowCoreThreadTimeOut(true); }
private ExecutorService createEs(IntSupplier maxThreadsSupplier, String name, BlockingQueue<Runnable> queue, OptionalInt priority) { int maxThreads = maxThreadsSupplier.getAsInt(); ThreadPoolExecutor tp = new ThreadPoolExecutor(maxThreads, maxThreads, 0L, TimeUnit.MILLISECONDS, queue, new NamingThreadFactory(name, priority)); return addEs(maxThreadsSupplier, name, tp); }
private ExecutorService createEs(int max, String name) { return addEs(name, Executors.newFixedThreadPool(max, new NamingThreadFactory(name))); }
public SimpleThreadPool(int max, final String name, BlockingQueue<Runnable> queue) { super(max, max, 4L, TimeUnit.SECONDS, queue, new NamingThreadFactory(name)); allowCoreThreadTimeOut(true); }
private ExecutorService createIdlingEs(Property max, String name, long timeout, TimeUnit timeUnit) { LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>(); int maxThreads = conf.getSystemConfiguration().getCount(max); ThreadPoolExecutor tp = new ThreadPoolExecutor(maxThreads, maxThreads, timeout, timeUnit, queue, new NamingThreadFactory(name)); tp.allowCoreThreadTimeOut(true); return addEs(() -> conf.getSystemConfiguration().getCount(max), name, tp); }
new NamingThreadFactory("submit"));
public RecoveryManager(Master master) { this.master = master; executor = Executors.newScheduledThreadPool(4, new NamingThreadFactory("Walog sort starter ")); zooCache = new ZooCache(master.getContext().getZooReaderWriter(), null); try { List<String> workIDs = new DistributedWorkQueue( master.getZooKeeperRoot() + Constants.ZRECOVERY, master.getConfiguration()) .getWorkQueued(); sortsQueued.addAll(workIDs); } catch (Exception e) { log.warn("{}", e.getMessage(), e); } }
new NamingThreadFactory("estimateSizes"));
ConditionalWriterImpl(ClientContext context, Table.ID tableId, ConditionalWriterConfig config) { this.context = context; this.auths = config.getAuthorizations(); this.ve = new VisibilityEvaluator(config.getAuthorizations()); this.threadPool = new ScheduledThreadPoolExecutor(config.getMaxWriteThreads(), new NamingThreadFactory(this.getClass().getSimpleName())); this.locator = new SyncingTabletLocator(context, tableId); this.serverQueues = new HashMap<>(); this.tableId = tableId; this.timeout = config.getTimeout(TimeUnit.MILLISECONDS); this.durability = config.getDurability(); this.classLoaderContext = config.getClassLoaderContext(); Runnable failureHandler = () -> { List<QCMutation> mutations = new ArrayList<>(); failedMutations.drainTo(mutations); if (mutations.size() > 0) queue(mutations); }; failureHandler = new LoggingRunnable(log, failureHandler); threadPool.scheduleAtFixedRate(failureHandler, 250, 250, TimeUnit.MILLISECONDS); }
new NamingThreadFactory("deleting"));
new NamingThreadFactory("addSplits")); try { executor.execute(
new NamingThreadFactory("findOverlapping"));
private static synchronized ExecutorService getLoadThreadPool(int maxLoadThreads) { if (loadThreadPool != null) { return loadThreadPool; } if (maxLoadThreads > 0) { BlockingQueue<Runnable> q = new LinkedBlockingQueue<>(); loadThreadPool = new ThreadPoolExecutor(0, maxLoadThreads, 60, TimeUnit.SECONDS, q, new NamingThreadFactory("bloom-loader")); } return loadThreadPool; }
private ThreadPoolExecutor createExecutorService(int maxThreads, String name) { ThreadPoolExecutor pool = new ThreadPoolExecutor(maxThreads, maxThreads, 5 * 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new NamingThreadFactory(name)); pool.allowCoreThreadTimeOut(true); return pool; }
private ExecutorService createEs(int min, int max, int timeout, String name) { return addEs(name, new ThreadPoolExecutor(min, max, timeout, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamingThreadFactory(name))); }
private ExecutorService createEs(int min, int max, int timeout, String name) { return addEs(name, new ThreadPoolExecutor(min, max, timeout, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamingThreadFactory(name))); }
private ExecutorService createEs(int max, String name) { return addEs(name, Executors.newFixedThreadPool(max, new NamingThreadFactory(name))); }
public SimpleThreadPool(int max, final String name, BlockingQueue<Runnable> queue) { super(max, max, 4l, TimeUnit.SECONDS, queue, new NamingThreadFactory(name)); allowCoreThreadTimeOut(true); }