public class Long2IntKVPartition extends KVPartition
Constructor and Description |
---|
Long2IntKVPartition() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the partition.
|
Long2IntOpenHashMap |
getKVMap()
Get the Long2IntOpenHashMap
|
int |
getNumWriteBytes()
Get the number of bytes of encoded data
|
int |
getVal(long key)
Get the associated value of the key
|
void |
initialize()
Initialization
|
boolean |
isEmpty()
Indicates if the partition is empty or not
|
ValStatus |
putKeyVal(long key,
int val,
TypeIntCombiner combiner)
Put the new key-value pair to the partition.
|
void |
read(java.io.DataInput in)
Read this from DataInput
|
int |
size()
Get the number of key-value pairs
|
void |
write(java.io.DataOutput out)
Write this to DataOutput
|
create, encode, forClass, free, getNumEnocdeBytes, newInstance, release
public void initialize()
public ValStatus putKeyVal(long key, int val, TypeIntCombiner combiner)
key
- the new keyval
- the new valuecombiner
- the combinerpublic int getVal(long key)
key
- the keypublic Long2IntOpenHashMap getKVMap()
public int size()
public boolean isEmpty()
public int getNumWriteBytes()
getNumWriteBytes
in class Writable
public void write(java.io.DataOutput out) throws java.io.IOException