org.apache.hadoop.hbase
Class HLogEdit

java.lang.Object
  extended by org.apache.hadoop.hbase.HLogEdit
All Implemented Interfaces:
HConstants, Writable

public class HLogEdit
extends Object
implements Writable, HConstants

A log value. These aren't sortable; you need to sort by the matching HLogKey. The table and row are already identified in HLogKey. This just indicates the column and value.


Field Summary
static ImmutableBytesWritable completeCacheFlush
          Value written to HLog on a complete cache flush
static ImmutableBytesWritable deleteBytes
          Value stored for a deleted item
 
Fields inherited from interface org.apache.hadoop.hbase.HConstants
ALL_META_COLUMNS, ALL_VERSIONS, COL_REGIONINFO, COL_REGIONINFO_ARRAY, COL_SERVER, COL_SPLITA, COL_SPLITB, COL_STARTCODE, COLUMN_FAMILY, COLUMN_FAMILY_ARRAY, COLUMN_FAMILY_STR, DEFAULT_HBASE_DIR, DEFAULT_HOST, DEFAULT_MASTER_ADDRESS, DEFAULT_MASTER_INFOPORT, DEFAULT_MASTER_PORT, DEFAULT_MAX_FILE_SIZE, DEFAULT_REGION_SERVER_CLASS, DEFAULT_REGIONSERVER_ADDRESS, DEFAULT_REGIONSERVER_INFOPORT, EMPTY_START_ROW, EMPTY_TEXT, FILE_SYSTEM_VERSION, HBASE_DIR, HREGION_LOGDIR_NAME, HREGION_OLDLOGFILE_NAME, LATEST_TIMESTAMP, MASTER_ADDRESS, META_TABLE_NAME, REGION_SERVER_CLASS, REGIONSERVER_ADDRESS, ROOT_TABLE_NAME, THREAD_WAKE_FREQUENCY, UTF8_ENCODING, VERSION_FILE_NAME
 
Constructor Summary
HLogEdit()
          Default constructor used by Writable
HLogEdit(Text column, byte[] bval, long timestamp)
          Construct a fully initialized HLogEdit
 
Method Summary
 Text getColumn()
           
 long getTimestamp()
           
 byte[] getVal()
           
static boolean isDeleted(byte[] value)
           
 void readFields(DataInput in)
          Deserialize the fields of this object from in.
 String toString()
           
 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, wait, wait, wait
 

Field Detail

deleteBytes

public static ImmutableBytesWritable deleteBytes
Value stored for a deleted item


completeCacheFlush

public static ImmutableBytesWritable completeCacheFlush
Value written to HLog on a complete cache flush

Constructor Detail

HLogEdit

public HLogEdit()
Default constructor used by Writable


HLogEdit

public HLogEdit(Text column,
                byte[] bval,
                long timestamp)
Construct a fully initialized HLogEdit

Parameters:
column - column name
bval - value
timestamp - timestamp for modification
Method Detail

isDeleted

public static boolean isDeleted(byte[] value)
Parameters:
value -
Returns:
True if an entry and its content is deleteBytes.

getColumn

public Text getColumn()
Returns:
the column

getVal

public byte[] getVal()
Returns:
the value

getTimestamp

public long getTimestamp()
Returns:
the timestamp

toString

public String toString()
Overrides:
toString in class Object
Returns:
First column name, timestamp, and first 128 bytes of the value bytes as a String.

write

public void write(DataOutput out)
           throws IOException
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
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