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
FieldsModifier and TypeFieldDescriptionprotected List<CoordinationProtos.DrillbitEndpoint> protected intprotected List<CoordinationProtos.DrillbitEndpoint> protected intFields 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 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.longgetReceiverMemory(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.longgetSenderMemory(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 affinitybooleanExchanges are not executable.final voidsetupReceivers(int majorFragmentId, List<CoordinationProtos.DrillbitEndpoint> receiverLocations) Inform this Exchange node about its receiver locations.protected voidsetupReceivers(List<CoordinationProtos.DrillbitEndpoint> receiverLocations) final voidsetupSenders(int majorFragmentId, List<CoordinationProtos.DrillbitEndpoint> senderLocations) Inform this Exchange node about its sender locations.protected voidsetupSenders(List<CoordinationProtos.DrillbitEndpoint> senderLocations) Methods 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, getReceiver, getSenderMethods 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
-
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:
isExecutablein interfacePhysicalOperator- Overrides:
isExecutablein 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:
getSenderParallelizationInfoin 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:
getReceiverParallelizationInfoin 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:ExchangeInform this Exchange node about its sender locations. This list should be index-ordered the same as the expected minorFragmentIds for each sender.- Specified by:
setupSendersin interfaceExchange- Parameters:
senderLocations-- Throws:
PhysicalOperatorSetupException
-
setupReceivers
public final void setupReceivers(int majorFragmentId, List<CoordinationProtos.DrillbitEndpoint> receiverLocations) throws PhysicalOperatorSetupException Description copied from interface:ExchangeInform this Exchange node about its receiver locations. This list should be index-ordered the same as the expected minorFragmentIds for each receiver.- Specified by:
setupReceiversin interfaceExchange- Parameters:
receiverLocations-- Throws:
PhysicalOperatorSetupException
-
accept
public final <T,X, T acceptE extends Throwable> (PhysicalVisitor<T, X, throws EE> physicalVisitor, X value) Description copied from interface:PhysicalOperatorProvides capability to build a set of output based on traversing a query graph tree.- Specified by:
acceptin interfacePhysicalOperator- Parameters:
physicalVisitor-- Throws:
E
-
getOperatorType
- Specified by:
getOperatorTypein interfacePhysicalOperator
-
getParallelizationDependency
Description copied from interface:ExchangeGet the parallelization dependency of the Exchange.- Specified by:
getParallelizationDependencyin interfaceExchange
-
getSenderMemory
public long getSenderMemory(int receivers, int senders) Description copied from interface:ExchangeReturns the memory requirement for the sender side of the exchange operator.- Specified by:
getSenderMemoryin 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:ExchangeReturns the memory requirement for the receiver side of the exchange operator.- Specified by:
getReceiverMemoryin 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.
-