Class AbstractDeMuxExchange
java.lang.Object
org.apache.drill.exec.physical.base.AbstractBase
org.apache.drill.exec.physical.base.AbstractSingle
org.apache.drill.exec.physical.base.AbstractExchange
org.apache.drill.exec.physical.config.AbstractDeMuxExchange
- All Implemented Interfaces:
Iterable<PhysicalOperator>,GraphValue<PhysicalOperator>,Exchange,PhysicalOperator
- Direct Known Subclasses:
UnorderedDeMuxExchange
DeMuxExchange is opposite of MuxExchange. It is used when the sender has overhead that is proportional to the
number of receivers. DeMuxExchange is run one instance per Drillbit endpoint which collects and distributes data
belonging to local receiving fragments running on the same Drillbit.
Example:
On a 3 node cluster, if the sender has 10 receivers on each node each sender requires 30 buffers. By inserting
DeMuxExchange, we create one receiver per node which means total of 3 receivers for each sender. If the number of
senders is 10, we use 10*3 buffers instead of 10*30. DeMuxExchange has a overhead of buffer space that is equal to
number of local receivers. In this case each DeMuxExchange needs 10 buffers, so total of 3*10 buffers.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.physical.base.Exchange
Exchange.ParallelizationDependency -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LogicalExpressionprotected Map<Integer, MinorFragmentEndpoint> protected com.google.common.collect.ArrayListMultimap<Integer, MinorFragmentEndpoint> Fields inherited from class org.apache.drill.exec.physical.base.AbstractExchange
receiverLocations, receiverMajorFragmentId, senderLocations, senderMajorFragmentIdFields inherited from class org.apache.drill.exec.physical.base.AbstractSingle
childFields inherited from class org.apache.drill.exec.physical.base.AbstractBase
INIT_ALLOCATION, initialAllocation, MAX_ALLOCATION, maxAllocation, userName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidIn DeMuxExchange, sender fragment parallelization and endpoint assignment depends on receiver fragment endpoint assignments.getReceiverParallelizationInfo(List<CoordinationProtos.DrillbitEndpoint> senderFragmentEndpoints) Default receiver parallelization width range is [1, Integer.MAX_VALUE] and affinity to nodes where sender fragments are running.getSender(int minorFragmentId, PhysicalOperator child) Get the Sender associated with the given minorFragmentId.getSenderParallelizationInfo(List<CoordinationProtos.DrillbitEndpoint> receiverFragmentEndpoints) Default sender parallelization width range is [1, Integer.MAX_VALUE] and no endpoint affinityMethods inherited from class org.apache.drill.exec.physical.base.AbstractExchange
accept, getDefaultAffinityMap, getOperatorType, getReceiverMemory, getSenderMemory, isExecutable, setupReceivers, setupReceivers, setupSenders, setupSendersMethods inherited from class org.apache.drill.exec.physical.base.AbstractSingle
getChild, getNewWithChild, getNewWithChildren, iteratorMethods inherited from class org.apache.drill.exec.physical.base.AbstractBase
accept, getCost, getInitialAllocation, getMaxAllocation, getOperatorId, getSVMode, getUserName, isBufferedOperator, setCost, setMaxAllocation, setOperatorIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.drill.exec.physical.base.Exchange
getChild, getReceiverMethods inherited from interface org.apache.drill.common.graph.GraphValue
acceptMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.apache.drill.exec.physical.base.PhysicalOperator
getCost, getInitialAllocation, getMaxAllocation, getNewWithChildren, getOperatorId, getSVMode, getUserName, isBufferedOperator, setCost, setMaxAllocation, setOperatorId
-
Field Details
-
expr
-
receiverToSenderMapping
-
senderToReceiversMapping
protected com.google.common.collect.ArrayListMultimap<Integer,MinorFragmentEndpoint> senderToReceiversMapping
-
-
Constructor Details
-
AbstractDeMuxExchange
-
-
Method Details
-
getExpression
-
getSenderParallelizationInfo
public ParallelizationInfo getSenderParallelizationInfo(List<CoordinationProtos.DrillbitEndpoint> receiverFragmentEndpoints) Description copied from class:AbstractExchangeDefault sender parallelization width range is [1, Integer.MAX_VALUE] and no endpoint affinity- Specified by:
getSenderParallelizationInfoin interfaceExchange- Overrides:
getSenderParallelizationInfoin classAbstractExchange- Parameters:
receiverFragmentEndpoints- Endpoints assigned to receiver fragment if available, otherwise an empty list.- Returns:
- Sender
ParallelizationInfo.
-
getReceiverParallelizationInfo
public ParallelizationInfo getReceiverParallelizationInfo(List<CoordinationProtos.DrillbitEndpoint> senderFragmentEndpoints) Description copied from class:AbstractExchangeDefault receiver parallelization width range is [1, Integer.MAX_VALUE] and affinity to nodes where sender fragments are running.- Specified by:
getReceiverParallelizationInfoin interfaceExchange- Overrides:
getReceiverParallelizationInfoin classAbstractExchange- Parameters:
senderFragmentEndpoints- Endpoints assigned to receiver fragment if available, otherwise an empty list.- Returns:
- Receiver
ParallelizationInfo.
-
getSender
Description copied from interface:ExchangeGet the Sender associated with the given minorFragmentId. Cannot be called until after setupSenders() and setupReceivers() have been called.- Parameters:
minorFragmentId- The minor fragment id, must be in the range [0, fragment.width).child- The feeding node for the requested sender.- Returns:
- The materialized sender for the given arguments.
-
getParallelizationDependency
In DeMuxExchange, sender fragment parallelization and endpoint assignment depends on receiver fragment endpoint assignments.- Specified by:
getParallelizationDependencyin interfaceExchange- Overrides:
getParallelizationDependencyin classAbstractExchange
-
createSenderReceiverMapping
protected void createSenderReceiverMapping()
-