Class SourceHandle
- java.lang.Object
-
- org.apache.iotdb.db.mpp.execution.exchange.SourceHandle
-
- All Implemented Interfaces:
ISourceHandle
public class SourceHandle extends java.lang.Object implements ISourceHandle
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_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 voidabort()Abort the handle.voidclose()Close the handle.longgetBufferRetainedSizeInBytes()Get the total amount of memory used by buffered tsblocks.org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceIdgetLocalFragmentInstanceId()Get the local fragment instance ID that this source handle belongs to.java.lang.StringgetLocalPlanNodeId()Get the local plan node ID that this source handle belongs to.org.apache.iotdb.common.rpc.thrift.TEndPointgetRemoteEndpoint()org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceIdgetRemoteFragmentInstanceId()booleanisAborted()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.booleanisFinished()If there are more tsblocks.org.apache.iotdb.tsfile.read.common.block.TsBlockreceive()Get aTsBlock.voidsetRetryIntervalInMs(long retryIntervalInMs)java.lang.StringtoString()
-
-
-
Field Detail
-
MAX_ATTEMPT_TIMES
public static final int MAX_ATTEMPT_TIMES
- See Also:
- Constant Field Values
-
-
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:ISourceHandleGet aTsBlock. If the source handle is blocked, a null will be returned. ARuntimeExceptionwill be thrown if any error happened.- Specified by:
receivein interfaceISourceHandle
-
isBlocked
public com.google.common.util.concurrent.ListenableFuture<?> isBlocked()
Description copied from interface:ISourceHandleGet a future that will be completed when the input buffer is not empty.- Specified by:
isBlockedin interfaceISourceHandle
-
abort
public void abort()
Description copied from interface:ISourceHandleAbort the handle. Discard all tsblocks which may still be in the memory buffer and cancel the future returned byISourceHandle.isBlocked().Should only be called in abnormal case
- Specified by:
abortin interfaceISourceHandle
-
close
public void close()
Description copied from interface:ISourceHandleClose the handle. Discard all tsblocks which may still be in the memory buffer and complete the future returned byISourceHandle.isBlocked().Should only be called in normal case
- Specified by:
closein interfaceISourceHandle
-
isFinished
public boolean isFinished()
Description copied from interface:ISourceHandleIf there are more tsblocks.- Specified by:
isFinishedin interfaceISourceHandle
-
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:ISourceHandleGet the local fragment instance ID that this source handle belongs to.- Specified by:
getLocalFragmentInstanceIdin interfaceISourceHandle
-
getLocalPlanNodeId
public java.lang.String getLocalPlanNodeId()
Description copied from interface:ISourceHandleGet the local plan node ID that this source handle belongs to.- Specified by:
getLocalPlanNodeIdin interfaceISourceHandle
-
getBufferRetainedSizeInBytes
public long getBufferRetainedSizeInBytes()
Description copied from interface:ISourceHandleGet the total amount of memory used by buffered tsblocks.- Specified by:
getBufferRetainedSizeInBytesin interfaceISourceHandle
-
isAborted
public boolean isAborted()
Description copied from interface:ISourceHandleIf this handle is aborted.- Specified by:
isAbortedin interfaceISourceHandle
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setRetryIntervalInMs
public void setRetryIntervalInMs(long retryIntervalInMs)
-
-