Class Execs
java.lang.Object
org.apache.druid.java.util.common.concurrent.Execs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.util.concurrent.ListeningExecutorServicestatic ExecutorServicedummy()Returns an ExecutorService which is terminated and shutdown from the beginning and not able to accept any tasks.static ThreadmakeThread(String name, Runnable runnable, boolean isDaemon) static ThreadFactorymakeThreadFactory(@NotNull String nameFormat) static ThreadFactorymakeThreadFactory(@NotNull String nameFormat, Integer priority) static ExecutorServicemultiThreaded(int threads, @NotNull String nameFormat) static ExecutorServicemultiThreaded(int threads, @NotNull String nameFormat, Integer priority) static ExecutorServicenewBlockingSingleThreaded(String nameFormat, int capacity) static ExecutorServicenewBlockingSingleThreaded(String nameFormat, int capacity, Integer priority) static ExecutorServicenewBlockingThreaded(String nameFormat, int nThreads, int capacity) static ExecutorServicenewBlockingThreaded(String nameFormat, int nThreads, int capacity, Integer priority) static ScheduledExecutorServicescheduledSingleThreaded(@NotNull String nameFormat) static ScheduledExecutorServicescheduledSingleThreaded(@NotNull String nameFormat, Integer priority) static ExecutorServicesingleThreaded(@NotNull String nameFormat) static ExecutorServicesingleThreaded(@NotNull String nameFormat, Integer priority)
-
Constructor Details
-
Execs
public Execs()
-
-
Method Details
-
dummy
Returns an ExecutorService which is terminated and shutdown from the beginning and not able to accept any tasks. -
singleThreaded
-
singleThreaded
public static ExecutorService singleThreaded(@NotNull @NotNull String nameFormat, @Nullable Integer priority) -
multiThreaded
-
multiThreaded
public static ExecutorService multiThreaded(int threads, @NotNull @NotNull String nameFormat, @Nullable Integer priority) -
scheduledSingleThreaded
-
scheduledSingleThreaded
public static ScheduledExecutorService scheduledSingleThreaded(@NotNull @NotNull String nameFormat, @Nullable Integer priority) -
makeThreadFactory
-
makeThreadFactory
public static ThreadFactory makeThreadFactory(@NotNull @NotNull String nameFormat, @Nullable Integer priority) -
makeThread
-
newBlockingSingleThreaded
- 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) -
newBlockingThreaded
-
newBlockingThreaded
public static ExecutorService newBlockingThreaded(String nameFormat, int nThreads, int capacity, Integer priority) -
directExecutor
public static com.google.common.util.concurrent.ListeningExecutorService directExecutor()
-