Class OperationManager
- java.lang.Object
-
- org.apache.flink.table.gateway.service.operation.OperationManager
-
@Internal public class OperationManager extends Object
Manager for theOperationManager.Operation
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
OperationManager.Operation
Operation to manage the execution, results and so on.
-
Constructor Summary
Constructors Constructor Description OperationManager(ExecutorService service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
awaitOperationTermination(OperationHandle operationHandle)
void
cancelOperation(OperationHandle operationHandle)
Cancel the execution of the operation.void
close()
Closes theOperationManager
and all operations.void
closeOperation(OperationHandle operationHandle)
Close the operation and release all resources used by theOperationManager.Operation
.ResultSet
fetchResults(OperationHandle operationHandle, long token, int maxRows)
Get the results of the operation.ResultSet
fetchResults(OperationHandle operationHandle, FetchOrientation orientation, int maxRows)
OperationManager.Operation
getOperation(OperationHandle operationHandle)
int
getOperationCount()
OperationInfo
getOperationInfo(OperationHandle operationHandle)
Get theOperationInfo
of the operation.ResolvedSchema
getOperationResultSchema(OperationHandle operationHandle)
Get theResolvedSchema
of the operation.OperationHandle
submitOperation(Callable<ResultSet> executor)
Submit the operation to theOperationManager
.OperationHandle
submitOperation(Function<OperationHandle,ResultFetcher> fetcherSupplier)
Submit the operation to theOperationManager
.
-
-
-
Constructor Detail
-
OperationManager
public OperationManager(ExecutorService service)
-
-
Method Detail
-
submitOperation
public OperationHandle submitOperation(Callable<ResultSet> executor)
Submit the operation to theOperationManager
. TheOperationManager
manages the lifecycle of theOperationManager.Operation
, including register resources, fire the execution and so on.- Parameters:
executor
- Worker to execute.- Returns:
- OperationHandle to fetch the results or check the status.
-
submitOperation
public OperationHandle submitOperation(Function<OperationHandle,ResultFetcher> fetcherSupplier)
Submit the operation to theOperationManager
. TheOperationManager
manges the lifecycle of theOperationManager.Operation
, including register resources, fire the execution and so on.- Parameters:
fetcherSupplier
- offer the fetcher to get the results.- Returns:
- OperationHandle to fetch the results or check the status.
-
cancelOperation
public void cancelOperation(OperationHandle operationHandle)
Cancel the execution of the operation.- Parameters:
operationHandle
- identifies theOperationManager.Operation
.
-
closeOperation
public void closeOperation(OperationHandle operationHandle)
Close the operation and release all resources used by theOperationManager.Operation
.- Parameters:
operationHandle
- identifies theOperationManager.Operation
.
-
awaitOperationTermination
public void awaitOperationTermination(OperationHandle operationHandle) throws Exception
- Throws:
Exception
-
getOperationInfo
public OperationInfo getOperationInfo(OperationHandle operationHandle)
Get theOperationInfo
of the operation.- Parameters:
operationHandle
- identifies theOperationManager.Operation
.
-
getOperationResultSchema
public ResolvedSchema getOperationResultSchema(OperationHandle operationHandle) throws Exception
Get theResolvedSchema
of the operation.- Parameters:
operationHandle
- identifies theOperationManager.Operation
.- Throws:
Exception
-
fetchResults
public ResultSet fetchResults(OperationHandle operationHandle, long token, int maxRows)
Get the results of the operation.- Parameters:
operationHandle
- identifies theOperationManager.Operation
.token
- identifies which batch of data to fetch.maxRows
- the maximum number of rows to fetch.- Returns:
- ResultSet contains the results.
-
fetchResults
public ResultSet fetchResults(OperationHandle operationHandle, FetchOrientation orientation, int maxRows)
-
close
public void close()
Closes theOperationManager
and all operations.
-
getOperationCount
@VisibleForTesting public int getOperationCount()
-
getOperation
@VisibleForTesting public OperationManager.Operation getOperation(OperationHandle operationHandle)
-
-