org.apache.hadoop.hbase.io
Class BatchOperation

java.lang.Object
  extended by org.apache.hadoop.hbase.io.BatchOperation
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class BatchOperation
extends Object
implements org.apache.hadoop.io.Writable

Batch update operation. If value is null, its a DELETE operation. If its non-null, its a PUT. This object is purposely bare-bones because many instances are created during bulk uploads. We have one class for DELETEs and PUTs rather than a class per type because it makes the serialization easier.

See Also:
BatchUpdate

Constructor Summary
BatchOperation()
          Default constructor used by Writable
BatchOperation(org.apache.hadoop.io.Text column)
          Creates a DELETE batch operation.
BatchOperation(org.apache.hadoop.io.Text column, byte[] value)
          Create a batch operation.
 
Method Summary
 org.apache.hadoop.io.Text getColumn()
           
 byte[] getValue()
           
 boolean isPut()
           
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchOperation

public BatchOperation()
Default constructor used by Writable


BatchOperation

public BatchOperation(org.apache.hadoop.io.Text column)
Creates a DELETE batch operation.

Parameters:
column - column name

BatchOperation

public BatchOperation(org.apache.hadoop.io.Text column,
                      byte[] value)
Create a batch operation.

Parameters:
column - column name
value - column value. If non-null, this is a PUT operation.
Method Detail

getColumn

public org.apache.hadoop.io.Text getColumn()
Returns:
the column

getValue

public byte[] getValue()
Returns:
the value

isPut

public boolean isPut()
Returns:
True if this is a PUT operation (this.value is not null).

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2008 The Apache Software Foundation