org.apache.hadoop.hbase.io
Class BatchUpdate

java.lang.Object
  extended by org.apache.hadoop.hbase.io.BatchUpdate
All Implemented Interfaces:
Iterable<BatchOperation>, org.apache.hadoop.io.Writable

public class BatchUpdate
extends Object
implements org.apache.hadoop.io.Writable, Iterable<BatchOperation>

A Writable object that contains a series of BatchOperations There is one BatchUpdate object per server, so a series of batch operations can result in multiple BatchUpdate objects if the batch contains rows that are served by multiple region servers.


Constructor Summary
BatchUpdate()
          Default constructor used serializing.
BatchUpdate(byte[] row)
          Initialize a BatchUpdate operation on a row.
BatchUpdate(byte[] row, long timestamp)
          Initialize a BatchUpdate operation on a row with a specific timestamp.
BatchUpdate(String row)
          Initialize a BatchUpdate operation on a row.
BatchUpdate(String row, long timestamp)
          Initialize a BatchUpdate operation on a row with a specific timestamp.
BatchUpdate(org.apache.hadoop.io.Text row)
          Deprecated. Use String or byte [] overload instead
BatchUpdate(org.apache.hadoop.io.Text row, long timestamp)
          Deprecated. Use String or byte [] overload instead
 
Method Summary
 void delete(byte[] column)
          Delete the value for a column Deletes the cell whose row/column/commit-timestamp match those of the delete.
 void delete(String column)
          Delete the value for a column Deletes the cell whose row/column/commit-timestamp match those of the delete.
 void delete(org.apache.hadoop.io.Text column)
          Deprecated. Use String or byte [] overload instead
 byte[] getRow()
           
 long getTimestamp()
          Return the timestamp this BatchUpdate will be committed with.
 Iterator<BatchOperation> iterator()
           
 void put(byte[] column, byte[] val)
          Change a value for the specified column
 void put(String column, byte[] val)
          Change a value for the specified column
 void put(org.apache.hadoop.io.Text column, byte[] val)
          Deprecated. Use String or byte [] overload instead
 void readFields(DataInput in)
           
 void setTimestamp(long timestamp)
          Set this BatchUpdate's timestamp.
 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

BatchUpdate

public BatchUpdate()
Default constructor used serializing. Do not use directly.


BatchUpdate

public BatchUpdate(org.apache.hadoop.io.Text row)
Deprecated. Use String or byte [] overload instead

Initialize a BatchUpdate operation on a row. Timestamp is assumed to be now.

Parameters:
row -

BatchUpdate

public BatchUpdate(String row)
Initialize a BatchUpdate operation on a row. Timestamp is assumed to be now.

Parameters:
row -

BatchUpdate

public BatchUpdate(byte[] row)
Initialize a BatchUpdate operation on a row. Timestamp is assumed to be now.

Parameters:
row -

BatchUpdate

public BatchUpdate(String row,
                   long timestamp)
Initialize a BatchUpdate operation on a row with a specific timestamp.

Parameters:
row -

BatchUpdate

public BatchUpdate(org.apache.hadoop.io.Text row,
                   long timestamp)
Deprecated. Use String or byte [] overload instead

Initialize a BatchUpdate operation on a row with a specific timestamp.

Parameters:
row -

BatchUpdate

public BatchUpdate(byte[] row,
                   long timestamp)
Initialize a BatchUpdate operation on a row with a specific timestamp.

Parameters:
row -
Method Detail

getRow

public byte[] getRow()
Returns:
the row

getTimestamp

public long getTimestamp()
Return the timestamp this BatchUpdate will be committed with.


setTimestamp

public void setTimestamp(long timestamp)
Set this BatchUpdate's timestamp.


put

public void put(org.apache.hadoop.io.Text column,
                byte[] val)
Deprecated. Use String or byte [] overload instead

Change a value for the specified column

Parameters:
column - column whose value is being set
val - new value for column. Cannot be null (can be empty).

put

public void put(String column,
                byte[] val)
Change a value for the specified column

Parameters:
column - column whose value is being set
val - new value for column. Cannot be null (can be empty).

put

public void put(byte[] column,
                byte[] val)
Change a value for the specified column

Parameters:
column - column whose value is being set
val - new value for column. Cannot be null (can be empty).

delete

public void delete(org.apache.hadoop.io.Text column)
Deprecated. Use String or byte [] overload instead

Delete the value for a column Deletes the cell whose row/column/commit-timestamp match those of the delete.

Parameters:
column - name of column whose value is to be deleted

delete

public void delete(String column)
Delete the value for a column Deletes the cell whose row/column/commit-timestamp match those of the delete.

Parameters:
column - name of column whose value is to be deleted

delete

public void delete(byte[] column)
Delete the value for a column Deletes the cell whose row/column/commit-timestamp match those of the delete.

Parameters:
column - name of column whose value is to be deleted

iterator

public Iterator<BatchOperation> iterator()
Specified by:
iterator in interface Iterable<BatchOperation>
Returns:
Iterator

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