public abstract class PartitionerTemplate extends Object implements Partitioner
| Modifier and Type | Class and Description |
|---|---|
class |
PartitionerTemplate.OutgoingRecordBatch |
TEMPLATE_DEFINITION| Constructor and Description |
|---|
PartitionerTemplate() |
| Modifier and Type | Method and Description |
|---|---|
void |
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).
|
PartitionOutgoingBatch |
getOutgoingBatch(int index)
Method to get PartitionOutgoingBatch based on the fact that there can be > 1 Partitioner
|
List<? extends PartitionOutgoingBatch> |
getOutgoingBatches() |
OperatorStats |
getStats() |
void |
initialize() |
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) |
void |
setup(FragmentContext context,
RecordBatch incoming,
HashPartitionSender popConfig,
OperatorStats stats,
OperatorContext oContext,
int start,
int end) |
public List<? extends PartitionOutgoingBatch> getOutgoingBatches()
getOutgoingBatches in interface Partitionerpublic PartitionOutgoingBatch getOutgoingBatch(int index)
PartitionergetOutgoingBatch in interface Partitionerpublic final void setup(FragmentContext context, RecordBatch incoming, HashPartitionSender popConfig, OperatorStats stats, OperatorContext oContext, int start, int end) throws SchemaChangeException
setup in interface PartitionerSchemaChangeExceptionprotected PartitionerTemplate.OutgoingRecordBatch newOutgoingRecordBatch(OperatorStats stats, HashPartitionSender operator, AccountingDataTunnel tunnel, FragmentContext context, BufferAllocator allocator, int oppositeMinorFragmentId)
public OperatorStats getStats()
getStats in interface Partitionerpublic void flushOutgoingBatches(boolean isLastBatch,
boolean schemaChanged)
throws IOException
flushOutgoingBatches in interface PartitionerisLastBatch - true if this is the last incoming batchschemaChanged - true if the schema has changedIOExceptionpublic void partitionBatch(RecordBatch incoming) throws IOException
partitionBatch in interface PartitionerIOExceptionpublic void initialize()
initialize in interface Partitionerpublic void clear()
clear in interface Partitionerpublic abstract void doSetup(@Named(value="context")
FragmentContext context,
@Named(value="incoming")
RecordBatch incoming,
@Named(value="outgoing")
PartitionerTemplate.OutgoingRecordBatch[] outgoing)
throws SchemaChangeException
SchemaChangeExceptionpublic abstract int doEval(@Named(value="inIndex")
int inIndex)
throws SchemaChangeException
SchemaChangeExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.