List of usage examples for org.apache.cassandra.concurrent NamedThreadFactory NamedThreadFactory
public NamedThreadFactory(String id)
From source file:com.netflix.priam.backup.AbstractRestore.java
License:Apache License
public AbstractRestore(IConfiguration config, IBackupFileSystem fs, String name, Sleeper sleeper) { super(config); this.config = config; this.fs = fs; this.sleeper = sleeper; executor = new JMXConfigurableThreadPoolExecutor(config.getMaxBackupDownloadThreads(), 1000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(name), name); executor.allowCoreThreadTimeOut(true); }
From source file:io.cassandrareaper.service.RepairManager.java
License:Apache License
@VisibleForTesting public void initializeThreadPool(int threadAmount, long repairTimeout, TimeUnit repairTimeoutTimeUnit, long retryDelay, TimeUnit retryDelayTimeUnit) { executor = MoreExecutors.listeningDecorator( Executors.newScheduledThreadPool(threadAmount, new NamedThreadFactory("RepairRunner"))); repairTimeoutMillis = repairTimeoutTimeUnit.toMillis(repairTimeout); retryDelayMillis = retryDelayTimeUnit.toMillis(retryDelay); }