Example usage for org.apache.cassandra.concurrent NamedThreadFactory NamedThreadFactory

List of usage examples for org.apache.cassandra.concurrent NamedThreadFactory NamedThreadFactory

Introduction

In this page you can find the example usage for org.apache.cassandra.concurrent NamedThreadFactory NamedThreadFactory.

Prototype

public NamedThreadFactory(String id) 

Source Link

Usage

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);
}