Examples of NamingThreadFactory


Examples of com.cloudhopper.commons.util.NamingThreadFactory

        // Set the maximum time in millisecond an AsyncHttpClient can stay idle:
  //   AsyncHttpClientConfig.Builder setIdleConnectionTimeoutInMs(int defaultIdleConnectionTimeoutInMs)

  // Override the Ning Async Client's reaper behavior
        ScheduledExecutorService reaper = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(),
                     new NamingThreadFactory("CHMQ-HttpClient-Reaper", true));
  httpConfigBuilder.setScheduledExecutorService(reaper);
 
  // Override the Ning Async Client's worker thread pool behavior
        ExecutorService applicationThreadPool = Executors.newFixedThreadPool((Runtime.getRuntime().availableProcessors() * 2)+1,
                       new NamingThreadFactory("CHMQ-HttpClient-Callback", true));
  httpConfigBuilder.setExecutorService(applicationThreadPool);
  httpConfigBuilder.setIOThreadMultiplier(2); //This is the default

  http = new AsyncHttpClient(httpConfigBuilder.build());
View Full Code Here

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

    // More means faster but bigger mem consumption.
    int logWriterThreads =
      conf.getInt("hbase.regionserver.hlog.splitlog.writer.threads", 3);
    boolean skipErrors = conf.getBoolean("hbase.skip.errors", false);
    HashMap<byte[], Future> writeFutureResult = new HashMap<byte[], Future>();
    NamingThreadFactory f  = new NamingThreadFactory(
            "SplitWriter-%1$d", Executors.defaultThreadFactory());
    ThreadPoolExecutor threadPool = (ThreadPoolExecutor)Executors.newFixedThreadPool(logWriterThreads, f);
    for (final byte[] region : splitLogsMap.keySet()) {
      Callable splitter = createNewSplitter(rootDir, logWriters, splitLogsMap, region, fs, conf);
      writeFutureResult.put(region, threadPool.submit(splitter));
View Full Code Here

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

    // More means faster but bigger mem consumption.
    int logWriterThreads =
      conf.getInt("hbase.regionserver.hlog.splitlog.writer.threads", 3);
    boolean skipErrors = conf.getBoolean("hbase.skip.errors", false);
    HashMap<byte[], Future> writeFutureResult = new HashMap<byte[], Future>();
    NamingThreadFactory f  = new NamingThreadFactory(
            "SplitWriter-%1$d", Executors.defaultThreadFactory());
    ThreadPoolExecutor threadPool = (ThreadPoolExecutor)Executors.newFixedThreadPool(logWriterThreads, f);
    for (final byte [] region : splitLogsMap.keySet()) {
      Callable splitter = createNewSplitter(rootDir, logWriters, splitLogsMap, region, fs, conf);
      writeFutureResult.put(region, threadPool.submit(splitter));
View Full Code Here

Examples of com.salas.bb.utils.concurrency.NamingThreadFactory

        if (LOG.isLoggable(Level.CONFIG)) LOG.config("Number of worker threads: " + threads);

        // Create a pool of executors with minimum thread priority
        executor = ExecutorFactory.createPooledExecutor(
            new NamingThreadFactory("Poller", Thread.MIN_PRIORITY),
            threads, THREAD_KEEP_ALIVE_TIME,
            new BoundedPriorityQueue(QUEUE_SIZE, new PollerTaskPrioritizer()),
            ExecutorFactory.BlockedPolicy.DISCARD);

        // Note: The policy is "Discard" a requst if the queue is full
View Full Code Here

Examples of com.salas.bb.utils.concurrency.NamingThreadFactory

    {
        if (listener == null) throw new IllegalArgumentException("Listener can't be NULL");
       
        this.listener = listener;

        executor = ExecutorFactory.createPooledExecutor(new NamingThreadFactory("Link Resolver", Thread.MIN_PRIORITY),
                5, 1000);
    }
View Full Code Here

Examples of com.starlight.thread.NamingThreadFactory

      }

      Executor executor = new ThreadPoolExecutor(
        core_pool_size, Integer.MAX_VALUE, keep_alive_time, TimeUnit.MILLISECONDS,
        new SynchronousQueue<>(),
        new NamingThreadFactory( "ListenerSupport Notifier", true ) );
      return executor( executor );
    }
View Full Code Here

Examples of org.apache.accumulo.core.util.NamingThreadFactory

    }
   
    final BatchWriter finalWriter = writer;
    final BatchWriter finalRootWriter = rootWriter;
   
    ExecutorService deleteThreadPool = Executors.newFixedThreadPool(numDeleteThreads, new NamingThreadFactory("deleting"));
   
    for (final String delete : confirmedDeletes) {
     
      Runnable deleteTask = new Runnable() {
        @Override
View Full Code Here

Examples of org.apache.accumulo.core.util.NamingThreadFactory

      return loadThreadPool;
    }
   
    if (maxLoadThreads > 0) {
      BlockingQueue<Runnable> q = new LinkedBlockingQueue<Runnable>();
      loadThreadPool = new ThreadPoolExecutor(0, maxLoadThreads, 60, TimeUnit.SECONDS, q, new NamingThreadFactory("bloom-loader"));
    }
   
    return loadThreadPool;
  }
View Full Code Here

Examples of org.apache.accumulo.core.util.NamingThreadFactory

    Collections.sort(splits);

    CountDownLatch latch = new CountDownLatch(splits.size());
    AtomicReference<Exception> exception = new AtomicReference<Exception>(null);

    ExecutorService executor = Executors.newFixedThreadPool(16, new NamingThreadFactory("addSplits"));
    try {
      executor.submit(new SplitTask(new SplitEnv(tableName, tableId, executor, latch, exception), splits));

      while (!latch.await(100, TimeUnit.MILLISECONDS)) {
        if (exception.get() != null) {
View Full Code Here

Examples of org.apache.accumulo.core.util.NamingThreadFactory

    }, 1000, 10 * 1000);
    return result;
  }

  private ExecutorService createEs(int max, String name) {
    return addEs(name, Executors.newFixedThreadPool(max, new NamingThreadFactory(name)));
  }
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.