public class DbExecutors extends Object
This is a factory class used to create executors (thread-pools) for Parallel Universe DB stores. The executors can, and should be shared by multiple stores.
Modifier and Type | Method and Description |
---|---|
static ThreadPoolExecutor |
concurrent(int parallelism)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
|
static ThreadPoolExecutor |
concurrent(int parallelism,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
|
static ThreadPoolExecutor |
concurrent(String name,
int parallelism)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
|
static ThreadPoolExecutor |
concurrent(String name,
int parallelism,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
|
static jsr166e.ForkJoinPool |
parallel(int parallelism)
Creates a
fork-join thread pool to be used for running all tasks for DB stores in parallel mode. |
static jsr166e.ForkJoinPool |
parallel(int parallelism,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a
fork-join thread pool to be used for running all tasks for DB stores in parallel mode. |
static jsr166e.ForkJoinPool |
parallel(String name,
int parallelism)
Creates a
fork-join thread pool to be used for running all tasks for DB stores in parallel mode. |
static jsr166e.ForkJoinPool |
parallel(String name,
int parallelism,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a
fork-join thread pool to be used for running all tasks for DB stores in parallel mode. |
public static ThreadPoolExecutor concurrent(String name, int parallelism, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
name
- The thread pool’s nameparallelism
- parallelism The number of threads to use for background cleanup tasks.uncaughtExceptionHandler
- The Thread.UncaughtExceptionHandler
to use (pass null
for the default handler).public static ThreadPoolExecutor concurrent(int parallelism, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
This method uses an auto-generated name for the thread pool.parallelism
- parallelism The number of threads to use for background cleanup tasks.uncaughtExceptionHandler
- The Thread.UncaughtExceptionHandler
to use (pass null
for the default handler).public static ThreadPoolExecutor concurrent(String name, int parallelism)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
This method uses a defaultThread.UncaughtExceptionHandler
.name
- The thread pool’s nameparallelism
- parallelism The number of threads to use for background cleanup tasks.public static ThreadPoolExecutor concurrent(int parallelism)
Creates a thread pool to be used for running background cleanup tasks for DB stores in concurrent mode.
This method uses a defaultThread.UncaughtExceptionHandler
and an auto-generated name for the thread poolparallelism
- parallelism The number of threads to use for background cleanup tasks.public static jsr166e.ForkJoinPool parallel(String name, int parallelism, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a fork-join
thread pool to be used for running all tasks for DB stores in parallel mode.
name
- The thread pool’s nameparallelism
- The number of threads in the ForkJoin thread-pool.uncaughtExceptionHandler
- The Thread.UncaughtExceptionHandler
to use (pass null
for the default handler).public static jsr166e.ForkJoinPool parallel(int parallelism, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Creates a fork-join
thread pool to be used for running all tasks for DB stores in parallel mode.
parallelism
- The number of threads in the ForkJoin thread-pool.uncaughtExceptionHandler
- The Thread.UncaughtExceptionHandler
to use (pass null
for the default handler).public static jsr166e.ForkJoinPool parallel(String name, int parallelism)
Creates a fork-join
thread pool to be used for running all tasks for DB stores in parallel mode.
Thread.UncaughtExceptionHandler
.name
- The thread pool’s nameparallelism
- The number of threads in the ForkJoin thread-pool.public static jsr166e.ForkJoinPool parallel(int parallelism)
Creates a fork-join
thread pool to be used for running all tasks for DB stores in parallel mode.
Thread.UncaughtExceptionHandler
and an auto-generated name for the thread poolparallelism
- The number of threads in the ForkJoin thread-pool.