Class SinkHandle
- java.lang.Object
-
- org.apache.iotdb.db.mpp.execution.exchange.SinkHandle
-
- All Implemented Interfaces:
ISinkHandle
public class SinkHandle extends java.lang.Object implements ISinkHandle
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_ATTEMPT_TIMES
-
Constructor Summary
Constructors Constructor Description SinkHandle(org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, java.lang.String remotePlanNodeId, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, LocalMemoryManager localMemoryManager, java.util.concurrent.ExecutorService executorService, org.apache.iotdb.tsfile.read.common.block.column.TsBlockSerde serde, MPPDataExchangeManager.SinkHandleListener sinkHandleListener, 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 sink handle.voidclose()Close the sink 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 sink handle belongs to.intgetNumOfBufferedTsBlocks()org.apache.iotdb.common.rpc.thrift.TEndPointgetRemoteEndpoint()org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceIdgetRemoteFragmentInstanceId()java.lang.StringgetRemotePlanNodeId()booleanisAborted()If the handle is aborted.booleanisFinished()If there are no more tsblocks to be sent and all the tsblocks have been fetched by downstream fragment instances.com.google.common.util.concurrent.ListenableFuture<?>isFull()Get a future that will be completed when the output buffer is not full.voidsend(int partition, java.util.List<org.apache.iotdb.tsfile.read.common.block.TsBlock> tsBlocks)Send aTsBlockto a specific partition.voidsend(org.apache.iotdb.tsfile.read.common.block.TsBlock tsBlock)Send a list of tsblocks to an unpartitioned output buffer.voidsetNoMoreTsBlocks()Notify the handle that there are no more tsblocks.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
-
SinkHandle
public SinkHandle(org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, java.lang.String remotePlanNodeId, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, LocalMemoryManager localMemoryManager, java.util.concurrent.ExecutorService executorService, org.apache.iotdb.tsfile.read.common.block.column.TsBlockSerde serde, MPPDataExchangeManager.SinkHandleListener sinkHandleListener, org.apache.iotdb.commons.client.IClientManager<org.apache.iotdb.common.rpc.thrift.TEndPoint,org.apache.iotdb.commons.client.sync.SyncDataNodeMPPDataExchangeServiceClient> mppDataExchangeServiceClientManager)
-
-
Method Detail
-
isFull
public com.google.common.util.concurrent.ListenableFuture<?> isFull()
Description copied from interface:ISinkHandleGet a future that will be completed when the output buffer is not full.- Specified by:
isFullin interfaceISinkHandle
-
send
public void send(org.apache.iotdb.tsfile.read.common.block.TsBlock tsBlock)
Description copied from interface:ISinkHandleSend a list of tsblocks to an unpartitioned output buffer. If no-more-tsblocks has been set, the invocation will be ignored. This can happen with limit queries. ARuntimeExceptionwill be thrown if any exception happened during the data transmission.- Specified by:
sendin interfaceISinkHandle
-
send
public void send(int partition, java.util.List<org.apache.iotdb.tsfile.read.common.block.TsBlock> tsBlocks)Description copied from interface:ISinkHandleSend aTsBlockto a specific partition. If no-more-tsblocks has been set, the send tsblock call is ignored. This can happen with limit queries. ARuntimeExceptionwill be thrown if any exception happened * during the data transmission.- Specified by:
sendin interfaceISinkHandle
-
setNoMoreTsBlocks
public void setNoMoreTsBlocks()
Description copied from interface:ISinkHandleNotify the handle that there are no more tsblocks. Any future calls to send a tsblock should be ignored.- Specified by:
setNoMoreTsBlocksin interfaceISinkHandle
-
abort
public void abort()
Description copied from interface:ISinkHandleAbort the sink handle. Discard all tsblocks which may still be in the memory buffer and cancel the future returned byISinkHandle.isFull().Should only be called in abnormal case
- Specified by:
abortin interfaceISinkHandle
-
close
public void close()
Description copied from interface:ISinkHandleClose the sink handle. Discard all tsblocks which may still be in the memory buffer and complete the future returned byISinkHandle.isFull().Should only be called in normal case.
- Specified by:
closein interfaceISinkHandle
-
isAborted
public boolean isAborted()
Description copied from interface:ISinkHandleIf the handle is aborted.- Specified by:
isAbortedin interfaceISinkHandle
-
isFinished
public boolean isFinished()
Description copied from interface:ISinkHandleIf there are no more tsblocks to be sent and all the tsblocks have been fetched by downstream fragment instances.- Specified by:
isFinishedin interfaceISinkHandle
-
getBufferRetainedSizeInBytes
public long getBufferRetainedSizeInBytes()
Description copied from interface:ISinkHandleGet the total amount of memory used by buffered tsblocks.- Specified by:
getBufferRetainedSizeInBytesin interfaceISinkHandle
-
getNumOfBufferedTsBlocks
public int getNumOfBufferedTsBlocks()
-
getRemoteEndpoint
public org.apache.iotdb.common.rpc.thrift.TEndPoint getRemoteEndpoint()
-
getRemoteFragmentInstanceId
public org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId getRemoteFragmentInstanceId()
-
getRemotePlanNodeId
public java.lang.String getRemotePlanNodeId()
-
getLocalFragmentInstanceId
public org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId getLocalFragmentInstanceId()
Description copied from interface:ISinkHandleGet the local fragment instance ID that this sink handle belongs to.- Specified by:
getLocalFragmentInstanceIdin interfaceISinkHandle
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setRetryIntervalInMs
public void setRetryIntervalInMs(long retryIntervalInMs)
-
-