Class SourceHandle

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MAX_ATTEMPT_TIMES  
    • Constructor Summary

      Constructors 
      Constructor Description
      SourceHandle​(org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, java.lang.String localPlanNodeId, LocalMemoryManager localMemoryManager, java.util.concurrent.ExecutorService executorService, org.apache.iotdb.tsfile.read.common.block.column.TsBlockSerde serde, MPPDataExchangeManager.SourceHandleListener sourceHandleListener, org.apache.iotdb.commons.client.IClientManager<org.apache.iotdb.common.rpc.thrift.TEndPoint,​org.apache.iotdb.commons.client.sync.SyncDataNodeMPPDataExchangeServiceClient> mppDataExchangeServiceClientManager)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abort()
      Abort the handle.
      void close()
      Close the handle.
      long getBufferRetainedSizeInBytes()
      Get the total amount of memory used by buffered tsblocks.
      org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId getLocalFragmentInstanceId()
      Get the local fragment instance ID that this source handle belongs to.
      java.lang.String getLocalPlanNodeId()
      Get the local plan node ID that this source handle belongs to.
      org.apache.iotdb.common.rpc.thrift.TEndPoint getRemoteEndpoint()  
      org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId getRemoteFragmentInstanceId()  
      boolean isAborted()
      If this handle is aborted.
      com.google.common.util.concurrent.ListenableFuture<?> isBlocked()
      Get a future that will be completed when the input buffer is not empty.
      boolean isFinished()
      If there are more tsblocks.
      org.apache.iotdb.tsfile.read.common.block.TsBlock receive()
      Get a TsBlock.
      void setRetryIntervalInMs​(long retryIntervalInMs)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SourceHandle

        public SourceHandle​(org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint,
                            org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId,
                            org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId,
                            java.lang.String localPlanNodeId,
                            LocalMemoryManager localMemoryManager,
                            java.util.concurrent.ExecutorService executorService,
                            org.apache.iotdb.tsfile.read.common.block.column.TsBlockSerde serde,
                            MPPDataExchangeManager.SourceHandleListener sourceHandleListener,
                            org.apache.iotdb.commons.client.IClientManager<org.apache.iotdb.common.rpc.thrift.TEndPoint,​org.apache.iotdb.commons.client.sync.SyncDataNodeMPPDataExchangeServiceClient> mppDataExchangeServiceClientManager)
    • Method Detail

      • receive

        public org.apache.iotdb.tsfile.read.common.block.TsBlock receive()
        Description copied from interface: ISourceHandle
        Get a TsBlock. If the source handle is blocked, a null will be returned. A RuntimeException will be thrown if any error happened.
        Specified by:
        receive in interface ISourceHandle
      • isBlocked

        public com.google.common.util.concurrent.ListenableFuture<?> isBlocked()
        Description copied from interface: ISourceHandle
        Get a future that will be completed when the input buffer is not empty.
        Specified by:
        isBlocked in interface ISourceHandle
      • abort

        public void abort()
        Description copied from interface: ISourceHandle
        Abort the handle. Discard all tsblocks which may still be in the memory buffer and cancel the future returned by ISourceHandle.isBlocked().

        Should only be called in abnormal case

        Specified by:
        abort in interface ISourceHandle
      • close

        public void close()
        Description copied from interface: ISourceHandle
        Close the handle. Discard all tsblocks which may still be in the memory buffer and complete the future returned by ISourceHandle.isBlocked().

        Should only be called in normal case

        Specified by:
        close in interface ISourceHandle
      • getRemoteEndpoint

        public org.apache.iotdb.common.rpc.thrift.TEndPoint getRemoteEndpoint()
      • getRemoteFragmentInstanceId

        public org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId getRemoteFragmentInstanceId()
      • getLocalFragmentInstanceId

        public org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId getLocalFragmentInstanceId()
        Description copied from interface: ISourceHandle
        Get the local fragment instance ID that this source handle belongs to.
        Specified by:
        getLocalFragmentInstanceId in interface ISourceHandle
      • getLocalPlanNodeId

        public java.lang.String getLocalPlanNodeId()
        Description copied from interface: ISourceHandle
        Get the local plan node ID that this source handle belongs to.
        Specified by:
        getLocalPlanNodeId in interface ISourceHandle
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setRetryIntervalInMs

        public void setRetryIntervalInMs​(long retryIntervalInMs)