Class AbstractExchange
java.lang.Object
org.apache.drill.exec.physical.base.AbstractBase
org.apache.drill.exec.physical.base.AbstractSingle
org.apache.drill.exec.physical.base.AbstractExchange
- All Implemented Interfaces:
Iterable<PhysicalOperator>
,GraphValue<PhysicalOperator>
,Exchange
,PhysicalOperator
- Direct Known Subclasses:
AbstractDeMuxExchange
,AbstractMuxExchange
,BroadcastExchange
,HashToMergeExchange
,HashToRandomExchange
,OrderedPartitionExchange
,RangePartitionExchange
,SingleMergeExchange
,UnionExchange
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.physical.base.Exchange
Exchange.ParallelizationDependency
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<CoordinationProtos.DrillbitEndpoint>
protected int
protected List<CoordinationProtos.DrillbitEndpoint>
protected int
Fields inherited from class org.apache.drill.exec.physical.base.AbstractSingle
child
Fields inherited from class org.apache.drill.exec.physical.base.AbstractBase
INIT_ALLOCATION, initialAllocation, MAX_ALLOCATION, maxAllocation, userName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal <T,
X, E extends Throwable>
Taccept
(PhysicalVisitor<T, X, E> physicalVisitor, X value) Provides capability to build a set of output based on traversing a query graph tree.protected static List<EndpointAffinity>
getDefaultAffinityMap
(List<CoordinationProtos.DrillbitEndpoint> fragmentEndpoints) Get a default endpoint affinity map where affinity of a Drillbit is proportional to the number of its occurrences in given endpoint list.Get the parallelization dependency of the Exchange.long
getReceiverMemory
(int receivers, int senders) Returns the memory requirement for the receiver side of the exchange operator.getReceiverParallelizationInfo
(List<CoordinationProtos.DrillbitEndpoint> senderFragmentEndpoints) Default receiver parallelization width range is [1, Integer.MAX_VALUE] and affinity to nodes where sender fragments are running.long
getSenderMemory
(int receivers, int senders) Returns the memory requirement for the sender side of the exchange operator.getSenderParallelizationInfo
(List<CoordinationProtos.DrillbitEndpoint> receiverFragmentEndpoints) Default sender parallelization width range is [1, Integer.MAX_VALUE] and no endpoint affinityboolean
Exchanges are not executable.final void
setupReceivers
(int majorFragmentId, List<CoordinationProtos.DrillbitEndpoint> receiverLocations) Inform this Exchange node about its receiver locations.protected void
setupReceivers
(List<CoordinationProtos.DrillbitEndpoint> receiverLocations) final void
setupSenders
(int majorFragmentId, List<CoordinationProtos.DrillbitEndpoint> senderLocations) Inform this Exchange node about its sender locations.protected void
setupSenders
(List<CoordinationProtos.DrillbitEndpoint> senderLocations) Methods inherited from class org.apache.drill.exec.physical.base.AbstractSingle
getChild, getNewWithChild, getNewWithChildren, iterator
Methods inherited from class org.apache.drill.exec.physical.base.AbstractBase
accept, getCost, getInitialAllocation, getMaxAllocation, getOperatorId, getSVMode, getUserName, isBufferedOperator, setCost, setMaxAllocation, setOperatorId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.physical.base.Exchange
getChild, getReceiver, getSender
Methods inherited from interface org.apache.drill.common.graph.GraphValue
accept
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.apache.drill.exec.physical.base.PhysicalOperator
getCost, getInitialAllocation, getMaxAllocation, getNewWithChildren, getOperatorId, getSVMode, getUserName, isBufferedOperator, setCost, setMaxAllocation, setOperatorId
-
Field Details
-
senderMajorFragmentId
protected int senderMajorFragmentId -
receiverMajorFragmentId
protected int receiverMajorFragmentId -
senderLocations
-
receiverLocations
-
-
Constructor Details
-
AbstractExchange
-
-
Method Details
-
isExecutable
public boolean isExecutable()Exchanges are not executable. The Execution layer first has to set their parallelization and convert them into something executable- Specified by:
isExecutable
in interfacePhysicalOperator
- Overrides:
isExecutable
in classAbstractBase
-
getSenderParallelizationInfo
public ParallelizationInfo getSenderParallelizationInfo(List<CoordinationProtos.DrillbitEndpoint> receiverFragmentEndpoints) Default sender parallelization width range is [1, Integer.MAX_VALUE] and no endpoint affinity- Specified by:
getSenderParallelizationInfo
in interfaceExchange
- Parameters:
receiverFragmentEndpoints
- Endpoints assigned to receiver fragment if available, otherwise an empty list.- Returns:
- Sender
ParallelizationInfo
.
-
getReceiverParallelizationInfo
public ParallelizationInfo getReceiverParallelizationInfo(List<CoordinationProtos.DrillbitEndpoint> senderFragmentEndpoints) Default receiver parallelization width range is [1, Integer.MAX_VALUE] and affinity to nodes where sender fragments are running.- Specified by:
getReceiverParallelizationInfo
in interfaceExchange
- Parameters:
senderFragmentEndpoints
- Endpoints assigned to receiver fragment if available, otherwise an empty list.- Returns:
- Receiver
ParallelizationInfo
.
-
getDefaultAffinityMap
protected static List<EndpointAffinity> getDefaultAffinityMap(List<CoordinationProtos.DrillbitEndpoint> fragmentEndpoints) Get a default endpoint affinity map where affinity of a Drillbit is proportional to the number of its occurrences in given endpoint list.- Parameters:
fragmentEndpoints
- Drillbit endpoint assignments of fragments.- Returns:
- List of EndpointAffinity objects for each Drillbit endpoint given fragmentEndpoints.
-
setupSenders
-
setupReceivers
protected void setupReceivers(List<CoordinationProtos.DrillbitEndpoint> receiverLocations) throws PhysicalOperatorSetupException - Throws:
PhysicalOperatorSetupException
-
setupSenders
public final void setupSenders(int majorFragmentId, List<CoordinationProtos.DrillbitEndpoint> senderLocations) throws PhysicalOperatorSetupException Description copied from interface:Exchange
Inform this Exchange node about its sender locations. This list should be index-ordered the same as the expected minorFragmentIds for each sender.- Specified by:
setupSenders
in interfaceExchange
- Throws:
PhysicalOperatorSetupException
-
setupReceivers
public final void setupReceivers(int majorFragmentId, List<CoordinationProtos.DrillbitEndpoint> receiverLocations) throws PhysicalOperatorSetupException Description copied from interface:Exchange
Inform this Exchange node about its receiver locations. This list should be index-ordered the same as the expected minorFragmentIds for each receiver.- Specified by:
setupReceivers
in interfaceExchange
- Throws:
PhysicalOperatorSetupException
-
accept
public final <T,X, T acceptE extends Throwable> (PhysicalVisitor<T, X, throws EE> physicalVisitor, X value) Description copied from interface:PhysicalOperator
Provides capability to build a set of output based on traversing a query graph tree.- Specified by:
accept
in interfacePhysicalOperator
- Throws:
E extends Throwable
-
getOperatorType
- Specified by:
getOperatorType
in interfacePhysicalOperator
-
getParallelizationDependency
Description copied from interface:Exchange
Get the parallelization dependency of the Exchange.- Specified by:
getParallelizationDependency
in interfaceExchange
-
getSenderMemory
public long getSenderMemory(int receivers, int senders) Description copied from interface:Exchange
Returns the memory requirement for the sender side of the exchange operator.- Specified by:
getSenderMemory
in interfaceExchange
- Parameters:
receivers
- number of receivers at the receiving end of this exchange operator.senders
- number of senders sending the rows for this exchange operator.- Returns:
- Total memory required by this operator.
-
getReceiverMemory
public long getReceiverMemory(int receivers, int senders) Description copied from interface:Exchange
Returns the memory requirement for the receiver side of the exchange operator.- Specified by:
getReceiverMemory
in interfaceExchange
- Parameters:
receivers
- number of receivers receiving the rows sent by the sender side of this exchange operator.senders
- number of senders sending the rows.- Returns:
- Total memory required by this operator.
-