use of com.palantir.common.concurrent.NamedThreadFactory in project atlasdb by palantir.
the class DbKvs method newFixedThreadPool.
private static ThreadPoolExecutor newFixedThreadPool(int maxPoolSize) {
ThreadPoolExecutor pool = PTExecutors.newThreadPoolExecutor(maxPoolSize, maxPoolSize, 15L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory("Atlas DbKvs reader", true));
pool.allowCoreThreadTimeOut(false);
return pool;
}
use of com.palantir.common.concurrent.NamedThreadFactory in project atlasdb by palantir.
the class AbstractKeyValueService method createFixedThreadPool.
/**
* Creates a fixed thread pool.
*
* @param threadNamePrefix thread name prefix
* @param poolSize fixed thread pool size
* @return a new fixed size thread pool with a keep alive time of 1 minute
*/
protected static ExecutorService createFixedThreadPool(String threadNamePrefix, int poolSize) {
ThreadPoolExecutor executor = PTExecutors.newFixedThreadPool(poolSize, new NamedThreadFactory(threadNamePrefix, false));
executor.setKeepAliveTime(1, TimeUnit.MINUTES);
return executor;
}
use of com.palantir.common.concurrent.NamedThreadFactory in project atlasdb by palantir.
the class CassandraSchemaLockCleaner method getCassandraTableDropper.
private static CassandraTableDropper getCassandraTableDropper(CassandraKeyValueServiceConfig config, CassandraClientPool clientPool, TracingQueryRunner tracingQueryRunner) {
WrappingQueryRunner wrappingQueryRunner = new WrappingQueryRunner(tracingQueryRunner);
ExecutorService executorService = PTExecutors.newFixedThreadPool(config.poolSize(), new NamedThreadFactory("Atlas CleanCassLocksState", false));
TaskRunner taskRunner = new TaskRunner(executorService);
CellLoader cellLoader = new CellLoader(config, clientPool, wrappingQueryRunner, taskRunner);
CellValuePutter cellValuePutter = new CellValuePutter(config, clientPool, taskRunner, wrappingQueryRunner, ConsistencyLevel.QUORUM);
return new CassandraTableDropper(config, clientPool, cellLoader, cellValuePutter, wrappingQueryRunner, ConsistencyLevel.ALL);
}
Aggregations