Class OperationManager
java.lang.Object
org.apache.flink.table.gateway.service.operation.OperationManager
Manager for the
OperationManager.Operation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassOperation to manage the execution, results and so on. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidawaitOperationTermination(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) voidcancelOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) Cancel the execution of the operation.voidclose()Closes theOperationManagerand all operations.voidcloseOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) Close the operation and release all resources used by theOperationManager.Operation.org.apache.flink.table.gateway.api.results.ResultSetfetchResults(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, long token, int maxRows) Get the results of the operation.org.apache.flink.table.gateway.api.results.ResultSetfetchResults(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.gateway.api.results.FetchOrientation orientation, int maxRows) getOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) intorg.apache.flink.table.gateway.api.results.OperationInfogetOperationInfo(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) Get theOperationInfoof the operation.org.apache.flink.table.catalog.ResolvedSchemagetOperationResultSchema(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) Get theResolvedSchemaof the operation.org.apache.flink.table.gateway.api.operation.OperationHandlesubmitOperation(Callable<org.apache.flink.table.gateway.api.results.ResultSet> executor) Submit the operation to theOperationManager.org.apache.flink.table.gateway.api.operation.OperationHandlesubmitOperation(Function<org.apache.flink.table.gateway.api.operation.OperationHandle, ResultFetcher> fetcherSupplier) Submit the operation to theOperationManager.
-
Constructor Details
-
OperationManager
-
-
Method Details
-
submitOperation
public org.apache.flink.table.gateway.api.operation.OperationHandle submitOperation(Callable<org.apache.flink.table.gateway.api.results.ResultSet> executor) Submit the operation to theOperationManager. TheOperationManagermanages 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 org.apache.flink.table.gateway.api.operation.OperationHandle submitOperation(Function<org.apache.flink.table.gateway.api.operation.OperationHandle, ResultFetcher> fetcherSupplier) Submit the operation to theOperationManager. TheOperationManagermanges 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(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) Cancel the execution of the operation.- Parameters:
operationHandle- identifies theOperationManager.Operation.
-
closeOperation
public void closeOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) Close the operation and release all resources used by theOperationManager.Operation.- Parameters:
operationHandle- identifies theOperationManager.Operation.
-
awaitOperationTermination
public void awaitOperationTermination(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) throws Exception - Throws:
Exception
-
getOperationInfo
public org.apache.flink.table.gateway.api.results.OperationInfo getOperationInfo(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) Get theOperationInfoof the operation.- Parameters:
operationHandle- identifies theOperationManager.Operation.
-
getOperationResultSchema
public org.apache.flink.table.catalog.ResolvedSchema getOperationResultSchema(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) throws Exception Get theResolvedSchemaof the operation.- Parameters:
operationHandle- identifies theOperationManager.Operation.- Throws:
Exception
-
fetchResults
public org.apache.flink.table.gateway.api.results.ResultSet fetchResults(org.apache.flink.table.gateway.api.operation.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 org.apache.flink.table.gateway.api.results.ResultSet fetchResults(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.gateway.api.results.FetchOrientation orientation, int maxRows) -
close
public void close()Closes theOperationManagerand all operations. -
getOperationCount
@VisibleForTesting public int getOperationCount() -
getOperation
@VisibleForTesting public OperationManager.Operation getOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
-