use of com.navercorp.pinpoint.common.profiler.concurrent.PinpointThreadFactory in project pinpoint by naver.
the class HbaseTemplate2 method afterPropertiesSet.
@Override
public void afterPropertiesSet() {
Configuration configuration = getConfiguration();
Objects.requireNonNull(configuration, "configuration is required");
Objects.requireNonNull(getTableFactory(), "tableFactory is required");
PinpointThreadFactory parallelScannerThreadFactory = new PinpointThreadFactory("Pinpoint-parallel-scanner", true);
if (this.maxThreadsPerParallelScan <= 1) {
this.enableParallelScan = false;
this.executor = Executors.newSingleThreadExecutor(parallelScannerThreadFactory);
} else {
this.executor = ExecutorFactory.newFixedThreadPool(this.maxThreads, 1024, parallelScannerThreadFactory);
}
}
use of com.navercorp.pinpoint.common.profiler.concurrent.PinpointThreadFactory in project pinpoint by naver.
the class AsyncQueueingExecutor method createExecuteThread.
private Thread createExecuteThread(String executorName) {
final ThreadFactory threadFactory = new PinpointThreadFactory(executorName, true);
Thread thread = threadFactory.newThread(this);
thread.start();
return thread;
}
use of com.navercorp.pinpoint.common.profiler.concurrent.PinpointThreadFactory in project pinpoint by naver.
the class ZookeeperJobWorker method start.
public void start() {
final ThreadFactory threadFactory = new PinpointThreadFactory(this.getClass().getSimpleName(), true);
this.workerThread = threadFactory.newThread(this);
switch(this.workerState.getCurrentState()) {
case NEW:
if (this.workerState.changeStateInitializing()) {
logger.info("start() started.");
workerState.changeStateStarted();
this.workerThread.start();
logger.info("start() completed.");
break;
}
case INITIALIZING:
logger.info("start() failed. cause: already initializing.");
break;
case STARTED:
logger.info("start() failed. cause: already initializing.");
break;
case DESTROYING:
throw new IllegalStateException("Already destroying.");
case STOPPED:
throw new IllegalStateException(ClassUtils.simpleClassName(this) + " start() failed. caused:Already stopped.");
case ILLEGAL_STATE:
throw new IllegalStateException(ClassUtils.simpleClassName(this) + " start() failed. caused:Invalid State.");
}
}
use of com.navercorp.pinpoint.common.profiler.concurrent.PinpointThreadFactory in project pinpoint by naver.
the class ReconnectSchedulerProvider method get.
@Override
public ScheduledExecutorService get() {
final PinpointThreadFactory threadFactory = new PinpointThreadFactory("Pinpoint-reconnect-thread");
final ScheduledThreadPoolExecutor scheduler = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(1, threadFactory);
// not recommended
// LoggingRejectedExecutionHandler reconnectScheduler = new LoggingRejectedExecutionHandler("ReconnectScheduler");
// scheduler.setRejectedExecutionHandler(reconnectScheduler);
ScheduledExecutorService scheduledExecutorService = Executors.unconfigurableScheduledExecutorService(scheduler);
return scheduledExecutorService;
}
use of com.navercorp.pinpoint.common.profiler.concurrent.PinpointThreadFactory in project pinpoint by naver.
the class PinpointServerAcceptor method createBootStrap.
private ServerBootstrap createBootStrap(int bossCount, int workerCount) {
// profiler, collector
ExecutorService boss = Executors.newCachedThreadPool(new PinpointThreadFactory("Pinpoint-Server-Boss", true));
NioServerBossPool nioServerBossPool = new NioServerBossPool(boss, bossCount, ThreadNameDeterminer.CURRENT);
ExecutorService worker = Executors.newCachedThreadPool(new PinpointThreadFactory("Pinpoint-Server-Worker", true));
NioWorkerPool nioWorkerPool = new NioWorkerPool(worker, workerCount, ThreadNameDeterminer.CURRENT);
NioServerSocketChannelFactory nioClientSocketChannelFactory = new NioServerSocketChannelFactory(nioServerBossPool, nioWorkerPool);
return new ServerBootstrap(nioClientSocketChannelFactory);
}
Aggregations