Package com.google.common.util.concurrent

Examples of com.google.common.util.concurrent.ThreadFactoryBuilder


                Executors.newCachedThreadPool(threadFactory(metricRegistry)), metricRegistry);
    }

    private ThreadFactory threadFactory(final MetricRegistry metricRegistry) {
        return new InstrumentedThreadFactory(
                new ThreadFactoryBuilder().setNameFormat("inputs-%d").build(),
                metricRegistry);
    }
View Full Code Here


                Executors.newFixedThreadPool(THREAD_POOL_SIZE, threadFactory(metricRegistry)), metricRegistry);
    }

    private ThreadFactory threadFactory(final MetricRegistry metricRegistry) {
        return new InstrumentedThreadFactory(
                new ThreadFactoryBuilder().setNameFormat("systemjob-executor-%d").build(),
                metricRegistry);
    }
View Full Code Here

                threadFactory(metricRegistry)), metricRegistry);
    }

    private ThreadFactory threadFactory(MetricRegistry metricRegistry) {
        return new InstrumentedThreadFactory(
                new ThreadFactoryBuilder().setNameFormat("outputbufferprocessor-%d").build(),
                metricRegistry);
    }
View Full Code Here

  private static final String USER_AGENT = loadVersion();

  public ClientBuilder() {
    enableGZip = true;
    name = "hosebird-client-" + clientNum.getAndIncrement();
    ThreadFactory threadFactory = new ThreadFactoryBuilder()
            .setDaemon(true)
            .setNameFormat("hosebird-client-io-thread-%d")
            .build();
    executorService = Executors.newSingleThreadExecutor(threadFactory);

    ThreadFactory rateTrackerThreadFactory = new ThreadFactoryBuilder()
            .setDaemon(true)
            .setNameFormat("hosebird-client-rateTracker-thread-%d")
            .build();

    ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(1, rateTrackerThreadFactory);
View Full Code Here

  private ClientConnectionManager mockConnectionManager;

  private final ExecutorService executorService;

  public BasicClientTest() {
    ThreadFactory threadFactory = new ThreadFactoryBuilder()
            .setDaemon(true)
            .setNameFormat("hosebird-client-unit-test-%d")
            .build();
    executorService = Executors.newSingleThreadExecutor(threadFactory);
  }
View Full Code Here

                    List<Dependency<?>> deps = injectionPoint.getDependencies();
                    if (deps.size() > 0) {
                        Constructor<?> constructor = (Constructor<?>)injectionPoint.getMember();
                        // One thread for each dependency
                        ExecutorService executor = Executors.newCachedThreadPool(
                                new ThreadFactoryBuilder()
                                    .setDaemon(true)
                                    .setNameFormat("ConcurrentProviders-" + type.getSimpleName() + "-%d")
                                    .build());
                        try {
                            List<Supplier<?>> suppliers = Lists.newArrayListWithCapacity(deps.size());
View Full Code Here

  public void start(){
    Preconditions.checkArgument(client == null, "Please call stop "
            + "before calling start on an old instance.");
    sinkCounter.start();
    sinkCounter.incrementConnectionCreatedCount();
      sinkCallbackPool = Executors.newCachedThreadPool(new ThreadFactoryBuilder()
        .setNameFormat(this.getName() + " HBase Call Pool").build());
    logger.info("Callback pool created");
    if(!isTimeoutTest) {
      client = new HBaseClient(zkQuorum, zkBaseDir, sinkCallbackPool);
    } else {
View Full Code Here

    private static double inMS(double nanos) {
        return nanos / (1000 * 1000);
    }

    private static ThreadFactory threadFactory(String nameFormat) {
        return new ThreadFactoryBuilder().setNameFormat(nameFormat).build();
    }
View Full Code Here

  private final CountDownLatch deleteLatch = new CountDownLatch( 2 );

  @Before
  public void setupThreadFactory() {
    threadFactory = new ThreadFactoryBuilder().setNameFormat( "ogm-test-thread-%d" ).build();
  }
View Full Code Here

    registerFilters(conf);
  }

  ExecutorService createExecutor(BlockingQueue<Runnable> callQueue,
                                 int workerThreads) {
    ThreadFactoryBuilder tfb = new ThreadFactoryBuilder();
    tfb.setDaemon(true);
    tfb.setNameFormat("thrift-worker-%d");
    return new ThreadPoolExecutor(workerThreads, workerThreads,
            Long.MAX_VALUE, TimeUnit.SECONDS, callQueue, tfb.build());
  }
View Full Code Here

TOP

Related Classes of com.google.common.util.concurrent.ThreadFactoryBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.