Class PartitionerTemplate
java.lang.Object
org.apache.drill.exec.physical.impl.partitionsender.PartitionerTemplate
- All Implemented Interfaces:
Partitioner
-
Nested Class Summary
-
Field Summary
Fields inherited from interface org.apache.drill.exec.physical.impl.partitionsender.Partitioner
TEMPLATE_DEFINITION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
abstract int
doEval
(int inIndex) abstract void
doSetup
(FragmentContext context, RecordBatch incoming, PartitionerTemplate.OutgoingRecordBatch[] outgoing) void
flushOutgoingBatches
(boolean isLastBatch, boolean schemaChanged) Flush each outgoing record batch, and optionally reset the state of each outgoing record batch (on schema change).getOutgoingBatch
(int index) Get PartitionOutgoingBatch based on the fact that there can be > 1 PartitionerList<? extends PartitionOutgoingBatch>
getStats()
void
protected PartitionerTemplate.OutgoingRecordBatch
injectMembers
(PartitionerTemplate.OutgoingRecordBatch outgoingRecordBatch) protected PartitionerTemplate.OutgoingRecordBatch
newOutgoingRecordBatch
(OperatorStats stats, HashPartitionSender operator, AccountingDataTunnel tunnel, FragmentContext context, BufferAllocator allocator, int oppositeMinorFragmentId) Shim method to be overridden in plain-old Java mode by the subclass to instantiate the generated inner class.void
partitionBatch
(RecordBatch incoming) final void
setup
(ExchangeFragmentContext context, RecordBatch incoming, HashPartitionSender popConfig, OperatorStats stats, OperatorContext oContext, ClassGenerator<?> cg, int start, int end)
-
Field Details
-
cg
-
context
-
-
Constructor Details
-
PartitionerTemplate
public PartitionerTemplate()
-
-
Method Details
-
getOutgoingBatches
- Specified by:
getOutgoingBatches
in interfacePartitioner
-
getOutgoingBatch
Description copied from interface:Partitioner
Get PartitionOutgoingBatch based on the fact that there can be > 1 Partitioner- Specified by:
getOutgoingBatch
in interfacePartitioner
- Returns:
- PartitionOutgoingBatch that matches index within Partitioner. This method can return null if index does not fall within boundary of this Partitioner
-
setup
public final void setup(ExchangeFragmentContext context, RecordBatch incoming, HashPartitionSender popConfig, OperatorStats stats, OperatorContext oContext, ClassGenerator<?> cg, int start, int end) throws SchemaChangeException - Specified by:
setup
in interfacePartitioner
- Throws:
SchemaChangeException
-
newOutgoingRecordBatch
protected PartitionerTemplate.OutgoingRecordBatch newOutgoingRecordBatch(OperatorStats stats, HashPartitionSender operator, AccountingDataTunnel tunnel, FragmentContext context, BufferAllocator allocator, int oppositeMinorFragmentId) Shim method to be overridden in plain-old Java mode by the subclass to instantiate the generated inner class. Byte-code manipulation appears to fix up the byte codes directly. The name is special, it must be "new" + inner class name. -
injectMembers
protected PartitionerTemplate.OutgoingRecordBatch injectMembers(PartitionerTemplate.OutgoingRecordBatch outgoingRecordBatch) -
getStats
- Specified by:
getStats
in interfacePartitioner
-
flushOutgoingBatches
Flush each outgoing record batch, and optionally reset the state of each outgoing record batch (on schema change). Note that the schema is updated based on incoming at the time this function is invoked.- Specified by:
flushOutgoingBatches
in interfacePartitioner
- Parameters:
isLastBatch
- true if this is the last incoming batchschemaChanged
- true if the schema has changed- Throws:
IOException
-
partitionBatch
- Specified by:
partitionBatch
in interfacePartitioner
- Throws:
IOException
-
initialize
public void initialize()- Specified by:
initialize
in interfacePartitioner
-
clear
public void clear()- Specified by:
clear
in interfacePartitioner
-
doSetup
public abstract void doSetup(@Named("context") FragmentContext context, @Named("incoming") RecordBatch incoming, @Named("outgoing") PartitionerTemplate.OutgoingRecordBatch[] outgoing) throws SchemaChangeException - Throws:
SchemaChangeException
-
doEval
- Throws:
SchemaChangeException
-