|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.hive.ql.exec.TopNHash
public class TopNHash
Stores binary key/value in sorted manner to get top-n key/value TODO: rename to TopNHeap?
Nested Class Summary | |
---|---|
static interface |
TopNHash.BinaryCollector
For interaction between operator and top-n hash. |
Field Summary | |
---|---|
static int |
EXCLUDE
|
static int |
FORWARD
|
static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
TopNHash()
|
Method Summary | |
---|---|
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. |
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,
org.apache.hadoop.io.BytesWritable value,
int keyHash,
boolean vectorized)
Stores the value for the key in the heap. |
int |
tryStoreKey(HiveKey key)
Try store the non-vectorized key. |
void |
tryStoreVectorizedKey(HiveKey key,
int batchIndex)
Try to put the key from the current vectorized batch into the heap. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static org.apache.commons.logging.Log LOG
public static final int FORWARD
public static final int EXCLUDE
Constructor Detail |
---|
public TopNHash()
Method Detail |
---|
public void initialize(int topN, float memUsage, boolean isMapGroupBy, TopNHash.BinaryCollector collector)
public int tryStoreKey(HiveKey key) throws HiveException, IOException
key
- Serialized key.
HiveException
IOException
public int startVectorizedBatch(int size) throws IOException, HiveException
size
- batch size
IOException
HiveException
public void tryStoreVectorizedKey(HiveKey key, int batchIndex) throws HiveException, IOException
key
- the key.batchIndex
- The index of the key in the vectorized batch (sequential, not .selected).
HiveException
IOException
public int getVectorizedBatchResult(int batchIndex)
batchIndex
- index of the key in the batch.
tryStoreKey(HiveKey)
public HiveKey getVectorizedKeyToForward(int batchIndex)
batchIndex
- index of the key in the batch.
public int getVectorizedKeyDistLength(int batchIndex)
batchIndex
- index of the key in the batch.
public void storeValue(int index, org.apache.hadoop.io.BytesWritable value, int keyHash, boolean vectorized)
index
- The index, either from tryStoreKey or from tryStoreVectorizedKey result.value
- The value to store.keyHash
- The key hash to store.vectorized
- Whether the result is coming from a vectorized batch.public void flush() throws HiveException
HiveException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |