Class PartitionerTemplate
java.lang.Object
org.apache.drill.exec.physical.impl.partitionsender.PartitionerTemplate
- All Implemented Interfaces:
Partitioner
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface org.apache.drill.exec.physical.impl.partitionsender.Partitioner
TEMPLATE_DEFINITION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()abstract intdoEval(int inIndex) abstract voiddoSetup(FragmentContext context, RecordBatch incoming, PartitionerTemplate.OutgoingRecordBatch[] outgoing) voidflushOutgoingBatches(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()voidprotected PartitionerTemplate.OutgoingRecordBatchinjectMembers(PartitionerTemplate.OutgoingRecordBatch outgoingRecordBatch) protected PartitionerTemplate.OutgoingRecordBatchnewOutgoingRecordBatch(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.voidpartitionBatch(RecordBatch incoming) final voidsetup(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:
getOutgoingBatchesin interfacePartitioner
-
getOutgoingBatch
Description copied from interface:PartitionerGet PartitionOutgoingBatch based on the fact that there can be > 1 Partitioner- Specified by:
getOutgoingBatchin interfacePartitioner- Parameters:
index-- 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:
setupin 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:
getStatsin 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:
flushOutgoingBatchesin interfacePartitioner- Parameters:
isLastBatch- true if this is the last incoming batchschemaChanged- true if the schema has changed- Throws:
IOException
-
partitionBatch
- Specified by:
partitionBatchin interfacePartitioner- Throws:
IOException
-
initialize
public void initialize()- Specified by:
initializein interfacePartitioner
-
clear
public void clear()- Specified by:
clearin 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
-