Class ExecutorEngine
java.lang.Object
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine
- All Implemented Interfaces:
AutoCloseable
Executor engine.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static ExecutorEngineCreate executor engine with CPU.static ExecutorEnginecreateExecutorEngineWithCPUAndResources(int resourceCount) Create executor engine with CPU and resources.static ExecutorEnginecreateExecutorEngineWithSize(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.
-
Method Details
-
createExecutorEngineWithSize
Create executor engine with executor size.- Parameters:
executorSize- executor size- Returns:
- created executor engine
-
createExecutorEngineWithCPUAndResources
Create executor engine with CPU and resources.- Parameters:
resourceCount- resource count- Returns:
- created executor engine
-
createExecutorEngineWithCPU
Create executor engine with CPU.- Returns:
- created executor engine
-
execute
public <I,O> List<O> execute(ExecutionGroupContext<I> executionGroupContext, ExecutorCallback<I, O> callback) throws SQLExceptionExecute.- Type Parameters:
I- type of input valueO- type of return value- Parameters:
executionGroupContext- execution group contextcallback- executor callback- Returns:
- execute result
- Throws:
SQLException- throw if execute failure
-
execute
public <I,O> List<O> execute(ExecutionGroupContext<I> executionGroupContext, ExecutorCallback<I, O> firstCallback, ExecutorCallback<I, throws SQLExceptionO> callback, boolean serial) Execute.- Type Parameters:
I- type of input valueO- type of return value- Parameters:
executionGroupContext- execution group contextfirstCallback- first executor callbackcallback- other executor callbackserial- whether using multi thread execute or not- Returns:
- execute result
- Throws:
SQLException- throw if execute failure
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-