FlushTableSubprocedurePool(String name, Configuration conf, Abortable abortable) { this.abortable = abortable; // configure the executor service long keepAlive = conf.getLong( RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_KEY, RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_DEFAULT); int threads = conf.getInt(CONCURENT_FLUSH_TASKS_KEY, DEFAULT_CONCURRENT_FLUSH_TASKS); this.name = name; executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs(" + name + ")-flush-proc-pool")); taskPool = new ExecutorCompletionService<Void>(executor); }
SnapshotSubprocedurePool(String name, Configuration conf, Abortable abortable) { this.abortable = abortable; // configure the executor service long keepAlive = conf.getLong( RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_KEY, RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_DEFAULT); int threads = conf.getInt(CONCURENT_SNAPSHOT_TASKS_KEY, DEFAULT_CONCURRENT_SNAPSHOT_TASKS); this.name = name; executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs(" + name + ")-snapshot-pool")); taskPool = new ExecutorCompletionService<Void>(executor); }
@Override public void start() { this.executor = new ThreadPoolExecutor( handlerCount, handlerCount, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(maxQueueLength), new DaemonThreadFactory("FifoRpcScheduler.handler"), new ThreadPoolExecutor.CallerRunsPolicy()); }
public SimpleSubprocedurePool(String name, Configuration conf) { this.name = name; executor = new ThreadPoolExecutor(1, 1, 500, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs(" + name + ")-procedure-pool")); taskPool = new ExecutorCompletionService<Void>(executor); }
public TwoConcurrentActionPolicy(long sleepTime, Action[] actionsOne, Action[] actionsTwo) { super(sleepTime); this.actionsOne = actionsOne; this.actionsTwo = actionsTwo; executor = Executors.newFixedThreadPool(2, new DaemonThreadFactory("TwoConcurrentAction-")); }
SnapshotSubprocedurePool(String name, Configuration conf) { // configure the executor service long keepAlive = conf.getLong( RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_KEY, RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_DEFAULT); int threads = conf.getInt(CONCURENT_SNAPSHOT_TASKS_KEY, DEFAULT_CONCURRENT_SNAPSHOT_TASKS); this.name = name; executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs(" + name + ")-snapshot-pool")); taskPool = new ExecutorCompletionService<Void>(executor); }
FlushTableSubprocedurePool(String name, Configuration conf) { // configure the executor service long keepAlive = conf.getLong( RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_KEY, RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_DEFAULT); int threads = conf.getInt(CONCURENT_FLUSH_TASKS_KEY, DEFAULT_CONCURRENT_FLUSH_TASKS); this.name = name; executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs(" + name + ")-flush-proc-pool")); taskPool = new ExecutorCompletionService<Void>(executor); }
public LogRollBackupSubprocedurePool(String name, Configuration conf) { // configure the executor service long keepAlive = conf.getLong(LogRollRegionServerProcedureManager.BACKUP_TIMEOUT_MILLIS_KEY, LogRollRegionServerProcedureManager.BACKUP_TIMEOUT_MILLIS_DEFAULT); int threads = conf.getInt(CONCURENT_BACKUP_TASKS_KEY, DEFAULT_CONCURRENT_BACKUP_TASKS); this.name = name; executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new DaemonThreadFactory("rs(" + name + ")-backup-pool")); taskPool = new ExecutorCompletionService<>(executor); }
public ZKPermissionWatcher(ZKWatcher watcher, TableAuthManager authManager, Configuration conf) { super(watcher); this.authManager = authManager; String aclZnodeParent = conf.get("zookeeper.znode.acl.parent", ACL_NODE); this.aclZNode = ZNodePaths.joinZNode(watcher.znodePaths.baseZNode, aclZnodeParent); executor = Executors.newSingleThreadExecutor( new DaemonThreadFactory("zk-permission-watcher")); }
FlushTableSubprocedurePool(String name, Configuration conf, Abortable abortable) { this.abortable = abortable; // configure the executor service long keepAlive = conf.getLong( RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_KEY, RegionServerFlushTableProcedureManager.FLUSH_TIMEOUT_MILLIS_DEFAULT); int threads = conf.getInt(CONCURENT_FLUSH_TASKS_KEY, DEFAULT_CONCURRENT_FLUSH_TASKS); this.name = name; executor = new ThreadPoolExecutor(threads, threads, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new DaemonThreadFactory("rs(" + name + ")-flush-proc-pool")); executor.allowCoreThreadTimeOut(true); taskPool = new ExecutorCompletionService<>(executor); }
SnapshotSubprocedurePool(String name, Configuration conf, Abortable abortable) { this.abortable = abortable; // configure the executor service long keepAlive = conf.getLong( RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_KEY, RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_DEFAULT); int threads = conf.getInt(CONCURENT_SNAPSHOT_TASKS_KEY, DEFAULT_CONCURRENT_SNAPSHOT_TASKS); this.name = name; executor = new ThreadPoolExecutor(threads, threads, keepAlive, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new DaemonThreadFactory("rs(" + name + ")-snapshot-pool")); executor.allowCoreThreadTimeOut(true); taskPool = new ExecutorCompletionService<>(executor); }
@Override public void start() { this.executor = new ThreadPoolExecutor( handlerCount, handlerCount, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(maxQueueLength), new DaemonThreadFactory("FifoRpcScheduler.handler"), new ThreadPoolExecutor.CallerRunsPolicy()); }
public SimpleSubprocedurePool(String name, Configuration conf) { this.name = name; executor = new ThreadPoolExecutor(1, 1, 500, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new DaemonThreadFactory("rs(" + name + ")-procedure-pool")); taskPool = new ExecutorCompletionService<>(executor); }
/** * Default thread pool for the procedure */ public static ThreadPoolExecutor defaultPool(String coordName, long keepAliveTime, int opThreads, long wakeFrequency) { return new ThreadPoolExecutor(1, opThreads, keepAliveTime, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new DaemonThreadFactory("(" + coordName + ")-proc-coordinator-pool")); }
public static ThreadPoolExecutor defaultPool(long wakeFrequency, long keepAlive, int procThreads, String memberName) { return new ThreadPoolExecutor(1, procThreads, keepAlive, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new DaemonThreadFactory("member: '" + memberName + "' subprocedure-pool")); }
/** * Default thread pool for the procedure * * @param memberName * @param procThreads the maximum number of threads to allow in the pool * @param keepAliveMillis the maximum time (ms) that excess idle threads will wait for new tasks */ public static ThreadPoolExecutor defaultPool(String memberName, int procThreads, long keepAliveMillis) { return new ThreadPoolExecutor(1, procThreads, keepAliveMillis, TimeUnit.MILLISECONDS, new SynchronousQueue<Runnable>(), new DaemonThreadFactory("member: '" + memberName + "' subprocedure-pool")); }
/** * Default thread pool for the procedure * * @param coordName * @param opThreads the maximum number of threads to allow in the pool * @param keepAliveMillis the maximum time (ms) that excess idle threads will wait for new tasks */ public static ThreadPoolExecutor defaultPool(String coordName, int opThreads, long keepAliveMillis) { return new ThreadPoolExecutor(1, opThreads, keepAliveMillis, TimeUnit.MILLISECONDS, new SynchronousQueue<Runnable>(), new DaemonThreadFactory("(" + coordName + ")-proc-coordinator-pool")); }