Class MemorySourceHandle
- java.lang.Object
-
- org.apache.iotdb.db.mpp.plan.execution.memory.MemorySourceHandle
-
- All Implemented Interfaces:
ISourceHandle
public class MemorySourceHandle extends java.lang.Object implements ISourceHandle
-
-
Constructor Summary
Constructors Constructor Description MemorySourceHandle(org.apache.iotdb.tsfile.read.common.block.TsBlock result)
-
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.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.
-
-
-
Method Detail
-
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
-
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
-
isFinished
public boolean isFinished()
Description copied from interface:ISourceHandleIf there are more tsblocks.- Specified by:
isFinishedin 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
-
isAborted
public boolean isAborted()
Description copied from interface:ISourceHandleIf this handle is aborted.- Specified by:
isAbortedin 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
-
-