TEMPLATE_DEFINITION| Constructor and Description |
|---|
MSortTemplate() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
int |
compare(int leftIndex,
int rightIndex) |
abstract int |
doEval(int leftIndex,
int rightIndex) |
abstract void |
doSetup(FragmentContextInterface context,
VectorContainer incoming,
RecordBatch outgoing) |
SelectionVector4 |
getSV4() |
static long |
memoryNeeded(int recordCount)
For given recordCount how much memory does MSorter needs for its own purpose.
|
protected int |
merge(int leftStart,
int rightStart,
int rightEnd,
int outStart)
Given two regions within the selection vector 4 (a left and a right), merge
the two regions to produce a combined output region in the auxiliary
selection vector.
|
void |
setup(FragmentContextInterface context,
BufferAllocator allocator,
SelectionVector4 vector4,
VectorContainer hyperBatch,
int outputBatchSize,
int desiredBatchSize) |
void |
sort()
Merge a set of pre-sorted runs to produce a combined
result set.
|
void |
swap(int sv0,
int sv1) |
public void setup(FragmentContextInterface context, BufferAllocator allocator, SelectionVector4 vector4, VectorContainer hyperBatch, int outputBatchSize, int desiredBatchSize) throws SchemaChangeException
setup in interface MSorterSchemaChangeExceptionpublic static long memoryNeeded(int recordCount)
recordCount - protected int merge(int leftStart,
int rightStart,
int rightEnd,
int outStart)
leftStart - rightStart - rightEnd - outStart - public SelectionVector4 getSV4()
public void sort()
Runs are merge pairwise in multiple passes, providing performance of O(n * m * log(n)), where n = number of runs, m = number of records per run.
public void swap(int sv0,
int sv1)
swap in interface org.apache.hadoop.util.IndexedSortablepublic int compare(int leftIndex,
int rightIndex)
compare in interface org.apache.hadoop.util.IndexedSortablepublic abstract void doSetup(@Named(value="context")
FragmentContextInterface context,
@Named(value="incoming")
VectorContainer incoming,
@Named(value="outgoing")
RecordBatch outgoing)
throws SchemaChangeException
SchemaChangeExceptionpublic abstract int doEval(@Named(value="leftIndex")
int leftIndex,
@Named(value="rightIndex")
int rightIndex)
throws SchemaChangeException
SchemaChangeExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.