Class OperationManager

    • Nested Class Summary

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

      All Methods Instance Methods Concrete Methods 
      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 close()
      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)  
      OperationManager.Operation getOperation​(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle)  
      int getOperationCount()  
      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.
    • Constructor Detail

    • Method Detail

      • 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)
      • getOperationCount

        @VisibleForTesting
        public int getOperationCount()
      • getOperation

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