|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.io.HbaseObjectWritable
public class HbaseObjectWritable
This is a customized version of the polymorphic hadoop
ObjectWritable. It removes UTF8 (HADOOP-414).
Using Text intead of UTF-8 saves ~2% CPU between reading and writing
objects running a short sequentialWrite Performance Evaluation test just in
ObjectWritable alone; more when we're doing randomRead-ing. Other
optimizations include our passing codes for classes instead of the
actual class names themselves. This makes it so this class needs amendment
if non-Writable classes are introduced -- if passed a Writable for which we
have no code, we just do the old-school passing of the class name, etc. --
but passing codes the savings are large particularly when cell
data is small (If < a couple of kilobytes, the encoding/decoding of class
name and reflection to instantiate class was costing in excess of the cell
handling).
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
LOG
|
| Constructor Summary | |
|---|---|
HbaseObjectWritable()
default constructor for writable |
|
HbaseObjectWritable(java.lang.Class<?> declaredClass,
java.lang.Object instance)
|
|
HbaseObjectWritable(java.lang.Object instance)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
get()
|
org.apache.hadoop.conf.Configuration |
getConf()
|
java.lang.Class<?> |
getDeclaredClass()
|
long |
getWritableSize()
Provide a size hint to the caller. |
static long |
getWritableSize(java.lang.Object instance,
java.lang.Class declaredClass,
org.apache.hadoop.conf.Configuration conf)
|
void |
readFields(java.io.DataInput in)
|
static java.lang.Object |
readObject(java.io.DataInput in,
org.apache.hadoop.conf.Configuration conf)
Read a Writable, String, primitive type, or an array of
the preceding. |
static java.lang.Object |
readObject(java.io.DataInput in,
HbaseObjectWritable objectWritable,
org.apache.hadoop.conf.Configuration conf)
Read a Writable, String, primitive type, or an array of
the preceding. |
void |
set(java.lang.Object instance)
Reset the instance. |
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
|
static void |
writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
org.apache.hadoop.conf.Configuration conf)
Write a Writable, String, primitive type, or an array of
the preceding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public HbaseObjectWritable()
public HbaseObjectWritable(java.lang.Object instance)
instance -
public HbaseObjectWritable(java.lang.Class<?> declaredClass,
java.lang.Object instance)
declaredClass - instance - | Method Detail |
|---|
public java.lang.Object get()
public java.lang.Class<?> getDeclaredClass()
public void set(java.lang.Object instance)
instance - public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
public void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.Writablejava.io.IOException
public void write(java.io.DataOutput out)
throws java.io.IOException
write in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic long getWritableSize()
WritableWithSize
getWritableSize in interface WritableWithSize
public static long getWritableSize(java.lang.Object instance,
java.lang.Class declaredClass,
org.apache.hadoop.conf.Configuration conf)
public static void writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
Writable, String, primitive type, or an array of
the preceding.
out - instance - declaredClass - conf -
java.io.IOException
public static java.lang.Object readObject(java.io.DataInput in,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
Writable, String, primitive type, or an array of
the preceding.
in - conf -
java.io.IOException
public static java.lang.Object readObject(java.io.DataInput in,
HbaseObjectWritable objectWritable,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
Writable, String, primitive type, or an array of
the preceding.
in - objectWritable - conf -
java.io.IOExceptionpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||