org.apache.hadoop.hbase.io
Class HbaseMapWritable<K,V>
java.lang.Object
org.apache.hadoop.hbase.io.HbaseMapWritable<K,V>
- Type Parameters:
K - key TODO: Parameter K is never used, could be removed.V - value Expects a Writable or byte [].
- All Implemented Interfaces:
- java.util.Map<byte[],V>, java.util.SortedMap<byte[],V>, org.apache.hadoop.conf.Configurable, CodeToClassAndBack, org.apache.hadoop.io.Writable
public class HbaseMapWritable<K,V>
- extends java.lang.Object
- implements java.util.SortedMap<byte[],V>, org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable, CodeToClassAndBack
A Writable Map.
Like MapWritable but dumb. It will fail
if passed a value type that it has not already been told about. Its been
primed with hbase Writables and byte []. Keys are always byte arrays.
| Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
|
Field Summary |
protected java.util.SortedMap<byte[],V> |
instance
|
|
Constructor Summary |
HbaseMapWritable()
The default contructor where a TreeMap is used |
HbaseMapWritable(java.util.SortedMap<byte[],V> map)
Contructor where another SortedMap can be used |
|
Method Summary |
void |
clear()
|
java.util.Comparator<? super byte[]> |
comparator()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set<java.util.Map.Entry<byte[],V>> |
entrySet()
|
byte[] |
firstKey()
|
V |
get(java.lang.Object key)
|
protected java.lang.Class<?> |
getClass(byte id)
|
org.apache.hadoop.conf.Configuration |
getConf()
|
protected byte |
getId(java.lang.Class<?> clazz)
|
java.util.SortedMap<byte[],V> |
headMap(byte[] toKey)
|
boolean |
isEmpty()
|
java.util.Set<byte[]> |
keySet()
|
byte[] |
lastKey()
|
V |
put(byte[] key,
V value)
|
void |
putAll(java.util.Map<? extends byte[],? extends V> m)
|
void |
readFields(java.io.DataInput in)
|
V |
remove(java.lang.Object key)
|
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
int |
size()
|
java.util.SortedMap<byte[],V> |
subMap(byte[] fromKey,
byte[] toKey)
|
java.util.SortedMap<byte[],V> |
tailMap(byte[] fromKey)
|
java.lang.String |
toString()
|
java.util.Collection<V> |
values()
|
void |
write(java.io.DataOutput out)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
instance
protected java.util.SortedMap<byte[],V> instance
HbaseMapWritable
public HbaseMapWritable()
- The default contructor where a TreeMap is used
HbaseMapWritable
public HbaseMapWritable(java.util.SortedMap<byte[],V> map)
- Contructor where another SortedMap can be used
- Parameters:
map - the SortedMap to be used
getConf
public org.apache.hadoop.conf.Configuration getConf()
- Specified by:
getConf in interface org.apache.hadoop.conf.Configurable
- Returns:
- the conf
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf)
- Specified by:
setConf in interface org.apache.hadoop.conf.Configurable
- Parameters:
conf - the conf to set
clear
public void clear()
- Specified by:
clear in interface java.util.Map<byte[],V>
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey in interface java.util.Map<byte[],V>
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue in interface java.util.Map<byte[],V>
entrySet
public java.util.Set<java.util.Map.Entry<byte[],V>> entrySet()
- Specified by:
entrySet in interface java.util.Map<byte[],V>- Specified by:
entrySet in interface java.util.SortedMap<byte[],V>
get
public V get(java.lang.Object key)
- Specified by:
get in interface java.util.Map<byte[],V>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface java.util.Map<byte[],V>
keySet
public java.util.Set<byte[]> keySet()
- Specified by:
keySet in interface java.util.Map<byte[],V>- Specified by:
keySet in interface java.util.SortedMap<byte[],V>
size
public int size()
- Specified by:
size in interface java.util.Map<byte[],V>
values
public java.util.Collection<V> values()
- Specified by:
values in interface java.util.Map<byte[],V>- Specified by:
values in interface java.util.SortedMap<byte[],V>
putAll
public void putAll(java.util.Map<? extends byte[],? extends V> m)
- Specified by:
putAll in interface java.util.Map<byte[],V>
remove
public V remove(java.lang.Object key)
- Specified by:
remove in interface java.util.Map<byte[],V>
put
public V put(byte[] key,
V value)
- Specified by:
put in interface java.util.Map<byte[],V>
comparator
public java.util.Comparator<? super byte[]> comparator()
- Specified by:
comparator in interface java.util.SortedMap<byte[],V>
firstKey
public byte[] firstKey()
- Specified by:
firstKey in interface java.util.SortedMap<byte[],V>
headMap
public java.util.SortedMap<byte[],V> headMap(byte[] toKey)
- Specified by:
headMap in interface java.util.SortedMap<byte[],V>
lastKey
public byte[] lastKey()
- Specified by:
lastKey in interface java.util.SortedMap<byte[],V>
subMap
public java.util.SortedMap<byte[],V> subMap(byte[] fromKey,
byte[] toKey)
- Specified by:
subMap in interface java.util.SortedMap<byte[],V>
tailMap
public java.util.SortedMap<byte[],V> tailMap(byte[] fromKey)
- Specified by:
tailMap in interface java.util.SortedMap<byte[],V>
getClass
protected java.lang.Class<?> getClass(byte id)
- Returns:
- the Class class for the specified id
getId
protected byte getId(java.lang.Class<?> clazz)
- Returns:
- the id for the specified Class
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- See Also:
Object.toString()
write
public void write(java.io.DataOutput out)
throws java.io.IOException
- Specified by:
write in interface org.apache.hadoop.io.Writable
- Throws:
java.io.IOException
readFields
public void readFields(java.io.DataInput in)
throws java.io.IOException
- Specified by:
readFields in interface org.apache.hadoop.io.Writable
- Throws:
java.io.IOException
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.