public abstract class Key2ValKVPartition<K extends Key,V extends Value> extends KVPartition
Constructor and Description |
---|
Key2ValKVPartition() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the partition.
|
java.lang.Class<K> |
getKeyClass()
Get the class of the keys
|
<any> |
getKVMap()
Get the Object2ObjectOpenHashMap
|
int |
getNumWriteBytes()
Get the number of bytes of encoded data
|
V |
getVal(K key)
Get the associated value of the key
|
java.lang.Class<V> |
getVClass()
Get the class of the values
|
void |
initialize(java.lang.Class<K> kClass,
java.lang.Class<V> vClass)
Initialize the partition
|
boolean |
isEmpty()
Indicates if the partition is empty or not
|
ValStatus |
putKeyVal(K key,
V val,
ValCombiner<V> combiner)
Put the new key-value pair to the partition.
|
void |
read(java.io.DataInput in)
Read this from DataInput
|
V |
removeVal(K key)
Removes this key and the associated value
from this function if it is present.
|
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(java.lang.Class<K> kClass, java.lang.Class<V> vClass)
kClass
- the class of KeyvClass
- the class of Valuepublic ValStatus putKeyVal(K key, V val, ValCombiner<V> combiner)
key
- the new keyval
- the new valuecombiner
- the combinerpublic V removeVal(K key)
key
- the keypublic java.lang.Class<K> getKeyClass()
public java.lang.Class<V> getVClass()
public V getVal(K key)
key
- the keypublic <any> getKVMap()
public int size()
public boolean isEmpty()
public void clear()
public int getNumWriteBytes()
getNumWriteBytes
in class Writable
public void write(java.io.DataOutput out) throws java.io.IOException