org.apache.hadoop.hbase.io
Class HbaseMapWritable

java.lang.Object
  extended by org.apache.hadoop.hbase.io.HbaseMapWritable
All Implemented Interfaces:
Map<Writable,Writable>, Configurable, Writable

public class HbaseMapWritable
extends Object
implements Map<Writable,Writable>, Writable, Configurable

A Writable Map. Like MapWritable but dumb. It will fail if passed a Writable it has not already been told about. Its also been primed with hbase Writables.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
HbaseMapWritable()
          Default constructor.
 
Method Summary
 void clear()
          
 boolean containsKey(Object key)
          
 boolean containsValue(Object value)
          
 Set<Map.Entry<Writable,Writable>> entrySet()
          
 Writable get(Object key)
          
protected  Class<?> getClass(byte id)
           
 Configuration getConf()
          Return the configuration used by this object.
protected  byte getId(Class<?> clazz)
           
 boolean isEmpty()
          
 Set<Writable> keySet()
          
 Writable put(Writable key, Writable value)
          
 void putAll(Map<? extends Writable,? extends Writable> t)
          
 void readFields(DataInput in)
          Deserialize the fields of this object from in.
 Writable remove(Object key)
          
 void setConf(Configuration conf)
          Set the configuration to be used by this object.
 int size()
          
 Collection<Writable> values()
          
 void write(DataOutput out)
          Serialize the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

HbaseMapWritable

public HbaseMapWritable()
Default constructor.

Method Detail

getConf

public Configuration getConf()
Description copied from interface: Configurable
Return the configuration used by this object.

Specified by:
getConf in interface Configurable
Returns:
the conf

setConf

public void setConf(Configuration conf)
Description copied from interface: Configurable
Set the configuration to be used by this object.

Specified by:
setConf in interface Configurable
Parameters:
conf - the conf to set

clear

public void clear()

Specified by:
clear in interface Map<Writable,Writable>

containsKey

public boolean containsKey(Object key)

Specified by:
containsKey in interface Map<Writable,Writable>

containsValue

public boolean containsValue(Object value)

Specified by:
containsValue in interface Map<Writable,Writable>

entrySet

public Set<Map.Entry<Writable,Writable>> entrySet()

Specified by:
entrySet in interface Map<Writable,Writable>

get

public Writable get(Object key)

Specified by:
get in interface Map<Writable,Writable>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface Map<Writable,Writable>

keySet

public Set<Writable> keySet()

Specified by:
keySet in interface Map<Writable,Writable>

put

public Writable put(Writable key,
                    Writable value)

Specified by:
put in interface Map<Writable,Writable>

putAll

public void putAll(Map<? extends Writable,? extends Writable> t)

Specified by:
putAll in interface Map<Writable,Writable>

remove

public Writable remove(Object key)

Specified by:
remove in interface Map<Writable,Writable>

size

public int size()

Specified by:
size in interface Map<Writable,Writable>

values

public Collection<Writable> values()

Specified by:
values in interface Map<Writable,Writable>

getClass

protected Class<?> getClass(byte id)
Returns:
the Class class for the specified id

getId

protected byte getId(Class<?> clazz)
Returns:
the id for the specified Class

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Serialize the fields of this object to out.

Specified by:
write in interface Writable
Parameters:
out - DataOuput to serialize this object into.
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Deserialize the fields of this object from in.

For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Parameters:
in - DataInput to deseriablize this object from.
Throws:
IOException


Copyright © 2006 The Apache Software Foundation