Package io.deephaven.engine.table.impl
Class ForkJoinPoolOperationInitializer
java.lang.Object
io.deephaven.engine.table.impl.ForkJoinPoolOperationInitializer
- All Implemented Interfaces:
OperationInitializer
Implementation of
OperationInitializer that delegates to a ForkJoinPool.-
Field Summary
Fields inherited from interface io.deephaven.engine.updategraph.OperationInitializer
NON_PARALLELIZABLE -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the current thread can parallelize operations using this OperationInitialization.static RunnableensureParallelizable(@NotNull Runnable task) Ensure thattaskis parallelizable within the currentExecutionContext, by wrapping it with a newExecutionContextthat usesfromCommonPool()if the currentExecutionContextdoes notallow parallelization.static <T> Supplier<T>ensureParallelizable(@NotNull Supplier<T> task) Ensure thattaskis parallelizable within the currentExecutionContext, by wrapping it with a newExecutionContextthat usesfromCommonPool()if the currentExecutionContextdoes notallow parallelization.static @NotNull OperationInitializerintNumber of threads that are potentially available.@NotNull Future<?>Submits a task to run in this thread pool.
-
Method Details
-
fromCommonPool
-
canParallelize
public boolean canParallelize()Description copied from interface:OperationInitializerWhether the current thread can parallelize operations using this OperationInitialization.- Specified by:
canParallelizein interfaceOperationInitializer
-
submit
Description copied from interface:OperationInitializerSubmits a task to run in this thread pool.- Specified by:
submitin interfaceOperationInitializer
-
parallelismFactor
public int parallelismFactor()Description copied from interface:OperationInitializerNumber of threads that are potentially available.- Specified by:
parallelismFactorin interfaceOperationInitializer
-
ensureParallelizable
Ensure thattaskis parallelizable within the currentExecutionContext, by wrapping it with a newExecutionContextthat usesfromCommonPool()if the currentExecutionContextdoes notallow parallelization.- Parameters:
task- The task to possible wrap- Returns:
- The possibly-wrapped task
-
ensureParallelizable
Ensure thattaskis parallelizable within the currentExecutionContext, by wrapping it with a newExecutionContextthat usesfromCommonPool()if the currentExecutionContextdoes notallow parallelization.- Parameters:
task- The task to possible wrap- Returns:
- The possibly-wrapped task
-