public abstract class PriorityQueueTemplate extends Object implements PriorityQueue
TEMPLATE_DEFINITION| Constructor and Description |
|---|
PriorityQueueTemplate() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(RecordBatchData batch)
The elements in the given batch are added to the priority queue.
|
void |
cleanup()
Releases all the memory consumed by the priority queue.
|
int |
compare(int leftIndex,
int rightIndex) |
abstract int |
doEval(int leftIndex,
int rightIndex) |
abstract void |
doSetup(VectorContainer incoming,
RecordBatch outgoing) |
void |
generate()
This method must be called before fetching the final priority queue hyper batch and final Sv4 vector.
|
SelectionVector4 |
getFinalSv4()
Retrieves the selection vector used to select the elements in the priority queue from the hyper batch
provided by the
PriorityQueue.getHyperBatch() method. |
VectorContainer |
getHyperBatch()
Retrieves the final priority queue HyperBatch containing the results.
|
SelectionVector4 |
getSv4() |
void |
init(int limit,
BufferAllocator allocator,
boolean hasSv2)
Initializes the priority queue.
|
int |
pop() |
void |
resetQueue(VectorContainer container,
SelectionVector4 v4) |
void |
swap(int sv0,
int sv1) |
public void init(int limit,
BufferAllocator allocator,
boolean hasSv2)
throws SchemaChangeException
PriorityQueueinit in interface PriorityQueuelimit - The size of the priority queue.allocator - The BufferAllocator to use when creating the priority queue.hasSv2 - True when incoming batches have 2 byte selection vectors. False otherwise.SchemaChangeExceptionpublic void resetQueue(VectorContainer container, SelectionVector4 v4) throws SchemaChangeException
resetQueue in interface PriorityQueueSchemaChangeExceptionpublic void add(RecordBatchData batch) throws SchemaChangeException
PriorityQueuePriorityQueue.init(int, BufferAllocator, boolean)
method.add in interface PriorityQueuebatch - The batch containing elements we want to add.SchemaChangeExceptionpublic void generate()
throws SchemaChangeException
PriorityQueuegenerate in interface PriorityQueueSchemaChangeExceptionpublic VectorContainer getHyperBatch()
PriorityQueuePriorityQueue.generate().getHyperBatch in interface PriorityQueuepublic SelectionVector4 getSv4()
getSv4 in interface PriorityQueuepublic SelectionVector4 getFinalSv4()
PriorityQueuePriorityQueue.getHyperBatch() method. Note: this should be called after PriorityQueue.generate().getFinalSv4 in interface PriorityQueuepublic void cleanup()
PriorityQueuecleanup in interface PriorityQueuepublic int pop()
public void swap(int sv0,
int sv1)
public int compare(int leftIndex,
int rightIndex)
throws SchemaChangeException
SchemaChangeExceptionpublic abstract void doSetup(@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.