public class PTFTopNHash extends TopNHash
TopNHash.BinaryCollector| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isMapGroupBy |
protected float |
memUsage |
| Constructor and Description |
|---|
PTFTopNHash() |
| Modifier and Type | Method and Description |
|---|---|
int |
_tryStoreKey(HiveKey key,
boolean partColsIsNull,
int batchIndex) |
void |
flush()
Flushes all the rows cached in the heap.
|
int |
getVectorizedBatchResult(int batchIndex)
Get vectorized batch result for particular index.
|
int |
getVectorizedKeyDistLength(int batchIndex)
After vectorized batch is processed, can return distribution keys length of a key.
|
int |
getVectorizedKeyHashCode(int batchIndex)
After vectorized batch is processed, can return hashCode of a key.
|
HiveKey |
getVectorizedKeyToForward(int batchIndex)
After vectorized batch is processed, can return the key that caused a particular row
to be forwarded.
|
void |
initialize(int topN,
float memUsage,
boolean isMapGroupBy,
TopNHash.BinaryCollector collector) |
int |
startVectorizedBatch(int size)
Perform basic checks and initialize TopNHash for the new vectorized row batch.
|
void |
storeValue(int index,
int hashCode,
org.apache.hadoop.io.BytesWritable value,
boolean vectorized)
Stores the value for the key in the heap.
|
int |
tryStoreKey(HiveKey key,
boolean partColsIsNull)
Try store the non-vectorized key.
|
void |
tryStoreVectorizedKey(HiveKey key,
boolean partColsIsNull,
int batchIndex)
Try to put the key from the current vectorized batch into the heap.
|
public void initialize(int topN,
float memUsage,
boolean isMapGroupBy,
TopNHash.BinaryCollector collector)
initialize in class TopNHashpublic int tryStoreKey(HiveKey key, boolean partColsIsNull) throws HiveException, IOException
TopNHashtryStoreKey in class TopNHashkey - Serialized key.HiveExceptionIOExceptionpublic int _tryStoreKey(HiveKey key, boolean partColsIsNull, int batchIndex) throws HiveException, IOException
HiveExceptionIOExceptionpublic void storeValue(int index,
int hashCode,
org.apache.hadoop.io.BytesWritable value,
boolean vectorized)
TopNHashstoreValue in class TopNHashindex - The index, either from tryStoreKey or from tryStoreVectorizedKey result.value - The value to store.vectorized - Whether the result is coming from a vectorized batch.public void flush()
throws HiveException
TopNHashflush in class TopNHashHiveExceptionpublic int startVectorizedBatch(int size)
throws IOException,
HiveException
TopNHashstartVectorizedBatch in class TopNHashsize - batch sizeIOExceptionHiveExceptionpublic void tryStoreVectorizedKey(HiveKey key, boolean partColsIsNull, int batchIndex) throws HiveException, IOException
TopNHashtryStoreVectorizedKey in class TopNHashkey - the key.batchIndex - The index of the key in the vectorized batch (sequential, not .selected).HiveExceptionIOExceptionpublic int getVectorizedBatchResult(int batchIndex)
TopNHashgetVectorizedBatchResult in class TopNHashbatchIndex - index of the key in the batch.#tryStoreKey(HiveKey)public HiveKey getVectorizedKeyToForward(int batchIndex)
TopNHashgetVectorizedKeyToForward in class TopNHashbatchIndex - index of the key in the batch.public int getVectorizedKeyDistLength(int batchIndex)
TopNHashgetVectorizedKeyDistLength in class TopNHashbatchIndex - index of the key in the batch.public int getVectorizedKeyHashCode(int batchIndex)
TopNHashgetVectorizedKeyHashCode in class TopNHashbatchIndex - index of the key in the batch.Copyright © 2017 The Apache Software Foundation. All rights reserved.