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
BatchOperation(byte[] column)
          Creates a DELETE batch operation.
BatchOperation(byte[] column, byte[] value)
          Create a batch operation.
BatchOperation(String column)
          Creates a DELETE batch operation.
BatchOperation(String column, String value)
          Create a batch operation.
 
Method Summary
 byte[] getColumn()
           
 byte[] getValue()
           
 boolean isPut()
           
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BatchOperation

public BatchOperation()
Default constructor


BatchOperation

public BatchOperation(byte[] column)
Creates a DELETE batch operation.

Parameters:
column - column name

BatchOperation

public BatchOperation(String column)
Creates a DELETE batch operation.

Parameters:
column - column name

BatchOperation

public BatchOperation(String column,
                      String value)
Create a batch operation.

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

BatchOperation

public BatchOperation(byte[] 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 byte[] 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).

toString

public String toString()
Overrides:
toString in class Object

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