Examples of allowCoreThreadTimeOut()


Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

        }
    };

    private ThreadPoolExecutor createExecutor() {
        ThreadPoolExecutor exec = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 10, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), factory);
        exec.allowCoreThreadTimeOut(true);
        return exec;
    }
}
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

        }
    };

    private ThreadPoolExecutor createExecutor() {
        ThreadPoolExecutor exec = new ThreadPoolExecutor(0, 2, 30, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), factory);
        exec.allowCoreThreadTimeOut(true);
        return exec;
    }
}
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

        }
    };

    private ThreadPoolExecutor createExecutor() {
        ThreadPoolExecutor exec = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 10, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), factory);
        exec.allowCoreThreadTimeOut(true);
        return exec;
    }
}
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

 
  synchronized void initializeThreadPool(Master master) {
    if (threadPool == null) {
      int threadPoolSize = master.getSystemConfiguration().getCount(Property.MASTER_BULK_THREADPOOL_SIZE);
      ThreadPoolExecutor pool = new SimpleThreadPool(threadPoolSize, "bulk import");
      pool.allowCoreThreadTimeOut(true);
      threadPool = new TraceExecutorService(pool);
    }
  }

  @Override
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

      int maxThreads = 1;
      long keepAliveTime = 60;
      ThreadPoolExecutor pool =
          new ThreadPoolExecutor(1, maxThreads, keepAliveTime, TimeUnit.SECONDS,
              new SynchronousQueue<Runnable>(), Threads.newDaemonThreadFactory("hbase-table"));
      pool.allowCoreThreadTimeOut(true);
      return pool;
    }

    @Override
    public void prePut(final ObserverContext<RegionCoprocessorEnvironment> e, final Put put,
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

            private String createName() {
                return "oak-executor-" + counter.getAndIncrement();
            }
        });
        executor.setKeepAliveTime(1, TimeUnit.MINUTES);
        executor.allowCoreThreadTimeOut(true);
        return executor;
    }

    private MBeanServer mbeanServer;
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

  private static synchronized ExecutorService getThreadPool(Master master) {
    if (threadPool == null) {
      int threadPoolSize = master.getSystemConfiguration().getCount(Property.MASTER_BULK_THREADPOOL_SIZE);
      ThreadPoolExecutor pool = new SimpleThreadPool(threadPoolSize, "bulk import");
      pool.allowCoreThreadTimeOut(true);
      threadPool = new TraceExecutorService(pool);
    }
    return threadPool;
  }
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

                return new JobFutureTask<T>((JobRunnable)runnable, value);
            }
           
        };
       
        exec.allowCoreThreadTimeOut(true); // ... and allow core threads to time out.  This just keeps things clean when idle, and is nice for ftests modes, etc., where we'd especially like these not to linger.
        return exec;
    }

    /**
     * Subclasses FutureTask for the sole purpose of providing {@link #getCallable()}, which is used to extract the producer in the {@link JobBasedRoundRobinQueue}
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

            private String createName() {
                return "oak-executor-" + counter.getAndIncrement();
            }
        });
        executor.setKeepAliveTime(1, TimeUnit.MINUTES);
        executor.allowCoreThreadTimeOut(true);
        return executor;
    }

    private MBeanServer mbeanServer;
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.allowCoreThreadTimeOut()

  }

  private void initializeThreadPool() {
    ThreadPoolExecutor threadPool = new ThreadPoolExecutor(numThreads, numThreads, 0, TimeUnit.SECONDS,
                                                           new ArrayBlockingQueue<Runnable>(numThreads * 10));
    threadPool.allowCoreThreadTimeOut(false);
    updaters = new Updater[numThreads];
    for(int i = 0; i < numThreads; i++) {
      updaters[i] = new Updater();
      threadPool.submit(updaters[i]);
    }
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.