X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Futil%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Futil%2Fconcurrent%2FFastThreadPoolExecutor.java;h=24fb7b82745035f2ee3d427705a7bb83db43f742;hb=1eb87c819cc6881ca7be74917a5d0bb7a9cad41f;hp=b7549eb24e7fc602293bce054ba5ed069ecc6c1f;hpb=8289f8e18a621ab0e85c8660b4d5926a62ef92c5;p=yangtools.git diff --git a/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/FastThreadPoolExecutor.java b/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/FastThreadPoolExecutor.java index b7549eb24e..24fb7b8274 100644 --- a/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/FastThreadPoolExecutor.java +++ b/common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/FastThreadPoolExecutor.java @@ -8,19 +8,17 @@ package org.opendaylight.yangtools.util.concurrent; -import java.util.concurrent.LinkedBlockingQueue; +import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects.ToStringHelper; +import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; -import com.google.common.util.concurrent.ThreadFactoryBuilder; - /** * A ThreadPoolExecutor with a specified bounded queue capacity that favors creating new threads * over queuing, as the former is faster. - *
- * See {@link SpecialExecutors#newFastBlockingThreadPool} for more details. + * + *
See {@link SpecialExecutors#newBoundedFastThreadPool} for more details.
*
* @author Thomas Pantelis
*/
@@ -42,7 +40,7 @@ public class FastThreadPoolExecutor extends ThreadPoolExecutor {
* @param threadPrefix
* the name prefix for threads created by this executor.
*/
- public FastThreadPoolExecutor( int maximumPoolSize, int maximumQueueSize, String threadPrefix ) {
+ public FastThreadPoolExecutor( final int maximumPoolSize, final int maximumQueueSize, final String threadPrefix ) {
this( maximumPoolSize, maximumQueueSize, DEFAULT_IDLE_TIMEOUT_IN_SEC, TimeUnit.SECONDS,
threadPrefix );
}
@@ -61,8 +59,8 @@ public class FastThreadPoolExecutor extends ThreadPoolExecutor {
* @param threadPrefix
* the name prefix for threads created by this executor.
*/
- public FastThreadPoolExecutor( int maximumPoolSize, int maximumQueueSize, long keepAliveTime,
- TimeUnit unit, String threadPrefix ) {
+ public FastThreadPoolExecutor( final int maximumPoolSize, final int maximumQueueSize, final long keepAliveTime,
+ final TimeUnit unit, final String threadPrefix ) {
// We use all core threads (the first 2 parameters below equal) so, when a task is submitted,
// if the thread limit hasn't been reached, a new thread will be spawned to execute
// the task even if there is an existing idle thread in the pool. This is faster than
@@ -70,7 +68,7 @@ public class FastThreadPoolExecutor extends ThreadPoolExecutor {
// reached, subsequent tasks will be queued. If the queue is full, tasks will be rejected.
super( maximumPoolSize, maximumPoolSize, keepAliveTime, unit,
- new LinkedBlockingQueue