public final class ExecutorEngine extends Object implements AutoCloseable
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
static ExecutorEngine |
createExecutorEngineWithCPU()
Create executor engine with CPU.
|
static ExecutorEngine |
createExecutorEngineWithCPUAndResources(int resourceCount)
Create executor engine with CPU and resources.
|
static ExecutorEngine |
createExecutorEngineWithSize(int executorSize)
Create executor engine with executor size.
|
<I,O> List<O> |
execute(ExecutionGroupContext<I> executionGroupContext,
ExecutorCallback<I,O> callback)
Execute.
|
<I,O> List<O> |
execute(ExecutionGroupContext<I> executionGroupContext,
ExecutorCallback<I,O> firstCallback,
ExecutorCallback<I,O> callback,
boolean serial)
Execute.
|
public static ExecutorEngine createExecutorEngineWithSize(int executorSize)
executorSize - executor sizepublic static ExecutorEngine createExecutorEngineWithCPUAndResources(int resourceCount)
resourceCount - resource countpublic static ExecutorEngine createExecutorEngineWithCPU()
public <I,O> List<O> execute(ExecutionGroupContext<I> executionGroupContext, ExecutorCallback<I,O> callback) throws SQLException
I - type of input valueO - type of return valueexecutionGroupContext - execution group contextcallback - executor callbackSQLException - throw if execute failurepublic <I,O> List<O> execute(ExecutionGroupContext<I> executionGroupContext, ExecutorCallback<I,O> firstCallback, ExecutorCallback<I,O> callback, boolean serial) throws SQLException
I - type of input valueO - type of return valueexecutionGroupContext - execution group contextfirstCallback - first executor callbackcallback - other executor callbackserial - whether using multi thread execute or notSQLException - throw if execute failurepublic void close()
close 在接口中 AutoCloseableCopyright © 2022 The Apache Software Foundation. All rights reserved.