Class Execs
- java.lang.Object
-
- org.apache.druid.java.util.common.concurrent.Execs
-
public class Execs extends Object
-
-
Constructor Summary
Constructors Constructor Description Execs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.common.util.concurrent.ListeningExecutorService
directExecutor()
static ExecutorService
dummy()
Returns an ExecutorService which is terminated and shutdown from the beginning and not able to accept any tasks.static Thread
makeThread(String name, Runnable runnable, boolean isDaemon)
static ThreadFactory
makeThreadFactory(@NotNull String nameFormat)
static ThreadFactory
makeThreadFactory(@NotNull String nameFormat, Integer priority)
static ExecutorService
multiThreaded(int threads, @NotNull String nameFormat)
static ExecutorService
multiThreaded(int threads, @NotNull String nameFormat, Integer priority)
static ExecutorService
newBlockingSingleThreaded(String nameFormat, int capacity)
static ExecutorService
newBlockingSingleThreaded(String nameFormat, int capacity, Integer priority)
static ScheduledExecutorService
scheduledSingleThreaded(@NotNull String nameFormat)
static ScheduledExecutorService
scheduledSingleThreaded(@NotNull String nameFormat, Integer priority)
static ExecutorService
singleThreaded(@NotNull String nameFormat)
static ExecutorService
singleThreaded(@NotNull String nameFormat, Integer priority)
-
-
-
Method Detail
-
dummy
public static ExecutorService dummy()
Returns an ExecutorService which is terminated and shutdown from the beginning and not able to accept any tasks.
-
singleThreaded
public static ExecutorService singleThreaded(@NotNull @NotNull String nameFormat)
-
singleThreaded
public static ExecutorService singleThreaded(@NotNull @NotNull String nameFormat, @Nullable Integer priority)
-
multiThreaded
public static ExecutorService multiThreaded(int threads, @NotNull @NotNull String nameFormat)
-
multiThreaded
public static ExecutorService multiThreaded(int threads, @NotNull @NotNull String nameFormat, @Nullable Integer priority)
-
scheduledSingleThreaded
public static ScheduledExecutorService scheduledSingleThreaded(@NotNull @NotNull String nameFormat)
-
scheduledSingleThreaded
public static ScheduledExecutorService scheduledSingleThreaded(@NotNull @NotNull String nameFormat, @Nullable Integer priority)
-
makeThreadFactory
public static ThreadFactory makeThreadFactory(@NotNull @NotNull String nameFormat)
-
makeThreadFactory
public static ThreadFactory makeThreadFactory(@NotNull @NotNull String nameFormat, @Nullable Integer priority)
-
newBlockingSingleThreaded
public static ExecutorService newBlockingSingleThreaded(String nameFormat, int capacity)
- Parameters:
nameFormat
- nameformat for threadFactorycapacity
- maximum capacity after which the executorService will block on accepting new tasks- Returns:
- ExecutorService which blocks accepting new tasks when the capacity reached
-
newBlockingSingleThreaded
public static ExecutorService newBlockingSingleThreaded(String nameFormat, int capacity, Integer priority)
-
directExecutor
public static com.google.common.util.concurrent.ListeningExecutorService directExecutor()
-
-