Class MPPDataExchangeManager
- java.lang.Object
-
- org.apache.iotdb.db.mpp.execution.exchange.MPPDataExchangeManager
-
- All Implemented Interfaces:
IMPPDataExchangeManager
public class MPPDataExchangeManager extends java.lang.Object implements IMPPDataExchangeManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMPPDataExchangeManager.SinkHandleListenerstatic interfaceMPPDataExchangeManager.SourceHandleListener
-
Constructor Summary
Constructors Constructor Description MPPDataExchangeManager(LocalMemoryManager localMemoryManager, java.util.function.Supplier<org.apache.iotdb.tsfile.read.common.block.column.TsBlockSerde> tsBlockSerdeFactory, java.util.concurrent.ExecutorService executorService, 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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcreateFullIdFrom(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId fragmentInstanceId, java.lang.String suffix)ISinkHandlecreateLocalSinkHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, java.lang.String remotePlanNodeId, FragmentInstanceContext instanceContext)ISourceHandlecreateLocalSourceHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, java.lang.String localPlanNodeId, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, IMPPDataExchangeManagerCallback<java.lang.Throwable> onFailureCallback)ISinkHandlecreateSinkHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, java.lang.String remotePlanNodeId, FragmentInstanceContext instanceContext)Create a sink handle who sends data blocks to a remote downstream fragment instance in async manner.ISourceHandlecreateSourceHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, java.lang.String localPlanNodeId, org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, IMPPDataExchangeManagerCallback<java.lang.Throwable> onFailureCallback)Create a source handle who fetches data blocks from a remote upstream fragment instance for a plan node of a local fragment instance in async manner.voidforceDeregisterFragmentInstance(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId fragmentInstanceId)Release all the related resources, including data blocks that are not yet fetched by downstream fragment instances.org.apache.iotdb.db.mpp.execution.exchange.MPPDataExchangeManager.MPPDataExchangeServiceImplgetOrCreateMPPDataExchangeServiceImpl()
-
-
-
Constructor Detail
-
MPPDataExchangeManager
public MPPDataExchangeManager(LocalMemoryManager localMemoryManager, java.util.function.Supplier<org.apache.iotdb.tsfile.read.common.block.column.TsBlockSerde> tsBlockSerdeFactory, java.util.concurrent.ExecutorService executorService, org.apache.iotdb.commons.client.IClientManager<org.apache.iotdb.common.rpc.thrift.TEndPoint,org.apache.iotdb.commons.client.sync.SyncDataNodeMPPDataExchangeServiceClient> mppDataExchangeServiceClientManager)
-
-
Method Detail
-
getOrCreateMPPDataExchangeServiceImpl
public org.apache.iotdb.db.mpp.execution.exchange.MPPDataExchangeManager.MPPDataExchangeServiceImpl getOrCreateMPPDataExchangeServiceImpl()
-
createLocalSinkHandle
public ISinkHandle createLocalSinkHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, java.lang.String remotePlanNodeId, FragmentInstanceContext instanceContext)
- Specified by:
createLocalSinkHandlein interfaceIMPPDataExchangeManager
-
createSinkHandle
public ISinkHandle createSinkHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, java.lang.String remotePlanNodeId, FragmentInstanceContext instanceContext)
Description copied from interface:IMPPDataExchangeManagerCreate a sink handle who sends data blocks to a remote downstream fragment instance in async manner.- Specified by:
createSinkHandlein interfaceIMPPDataExchangeManager- Parameters:
localFragmentInstanceId- ID of the local fragment instance who generates and sends data blocks to the sink handle.remoteEndpoint- Hostname and Port of the remote fragment instance where the data blocks should be sent to.remotePlanNodeId- The sink plan node ID of the remote fragment instance.instanceContext- The context of local fragment instance.
-
createLocalSourceHandle
public ISourceHandle createLocalSourceHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, java.lang.String localPlanNodeId, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, IMPPDataExchangeManagerCallback<java.lang.Throwable> onFailureCallback)
- Specified by:
createLocalSourceHandlein interfaceIMPPDataExchangeManager
-
createSourceHandle
public ISourceHandle createSourceHandle(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId localFragmentInstanceId, java.lang.String localPlanNodeId, org.apache.iotdb.common.rpc.thrift.TEndPoint remoteEndpoint, org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId remoteFragmentInstanceId, IMPPDataExchangeManagerCallback<java.lang.Throwable> onFailureCallback)
Description copied from interface:IMPPDataExchangeManagerCreate a source handle who fetches data blocks from a remote upstream fragment instance for a plan node of a local fragment instance in async manner.- Specified by:
createSourceHandlein interfaceIMPPDataExchangeManager- Parameters:
localFragmentInstanceId- ID of the local fragment instance who receives data blocks from the source handle.localPlanNodeId- The local sink plan node ID.remoteEndpoint- Hostname and Port of the remote fragment instance where the data blocks should be received from.remoteFragmentInstanceId- ID of the remote fragment instance.onFailureCallback- The callback on failure.
-
forceDeregisterFragmentInstance
public void forceDeregisterFragmentInstance(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId fragmentInstanceId)
Release all the related resources, including data blocks that are not yet fetched by downstream fragment instances.This method should be called when a fragment instance finished in an abnormal state.
- Specified by:
forceDeregisterFragmentInstancein interfaceIMPPDataExchangeManager- Parameters:
fragmentInstanceId- ID of the fragment instance to be released.
-
createFullIdFrom
public static java.lang.String createFullIdFrom(org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId fragmentInstanceId, java.lang.String suffix)- Parameters:
suffix- should be like [PlanNodeId].SourceHandle/SinHandle
-
-