Examples of ThreadFactoryBuilder


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

    private ExecutorService executorService() {
        return new InstrumentedExecutorService(Executors.newCachedThreadPool(threadFactory()), metricRegistry);
    }

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

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

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

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

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

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

                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

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

                threadFactory(metricRegistry)), metricRegistry);
    }

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

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

  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

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

  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

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

                    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

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

  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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.