Class OperationManager

java.lang.Object
org.apache.flink.table.gateway.service.operation.OperationManager

@Internal public class OperationManager extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Operation to manage the execution, results and so on.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    awaitOperationTermination(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
     
    void
    cancelOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
    Cancel the execution of the operation.
    void
    Closes the OperationManager and all operations.
    void
    closeOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
    Close the operation and release all resources used by the OperationManager.Operation.
    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.
    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)
     
    getOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
     
    int
     
    org.apache.flink.table.gateway.api.results.OperationInfo
    getOperationInfo(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
    Get the OperationInfo of the operation.
    org.apache.flink.table.catalog.ResolvedSchema
    getOperationResultSchema(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
    Get the ResolvedSchema of the operation.
    org.apache.flink.table.gateway.api.operation.OperationHandle
    submitOperation(Callable<org.apache.flink.table.gateway.api.results.ResultSet> executor)
    Submit the operation to the OperationManager.
    org.apache.flink.table.gateway.api.operation.OperationHandle
    submitOperation(Function<org.apache.flink.table.gateway.api.operation.OperationHandle,ResultFetcher> fetcherSupplier)
    Submit the operation to the OperationManager.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 the OperationManager. The OperationManager manages the lifecycle of the OperationManager.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 the OperationManager. The OperationManager manges the lifecycle of the OperationManager.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 the OperationManager.Operation.
    • closeOperation

      public void closeOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)
      Close the operation and release all resources used by the OperationManager.Operation.
      Parameters:
      operationHandle - identifies the OperationManager.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 the OperationInfo of the operation.
      Parameters:
      operationHandle - identifies the OperationManager.Operation.
    • getOperationResultSchema

      public org.apache.flink.table.catalog.ResolvedSchema getOperationResultSchema(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle) throws Exception
      Get the ResolvedSchema of the operation.
      Parameters:
      operationHandle - identifies the OperationManager.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 the OperationManager.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 the OperationManager and all operations.
    • getOperationCount

      @VisibleForTesting public int getOperationCount()
    • getOperation

      @VisibleForTesting public OperationManager.Operation getOperation(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)