org.apache.hadoop.hbase.client
Class RowMutations

java.lang.Object
  extended by org.apache.hadoop.hbase.client.RowMutations
All Implemented Interfaces:
Comparable<Row>, Row, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<Row>

public class RowMutations
extends Object
implements Row

Performs multiple mutations atomically on a single row. Currently Put and Delete are supported. The mutations are performed in the order in which they were added.


Constructor Summary
RowMutations()
          Constructor for Writable.
RowMutations(byte[] row)
          Create an atomic mutation for the specified row.
 
Method Summary
 void add(Delete d)
          Add a Delete operation to the list of mutations
 void add(Put p)
          Add a Put operation to the list of mutations
 int compareTo(Row i)
           
 List<Mutation> getMutations()
           
 byte[] getRow()
           
 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

RowMutations

public RowMutations()
Constructor for Writable. DO NOT USE


RowMutations

public RowMutations(byte[] row)
Create an atomic mutation for the specified row.

Parameters:
row - row key
Method Detail

add

public void add(Put p)
         throws IOException
Add a Put operation to the list of mutations

Parameters:
p - The Put to add
Throws:
IOException

add

public void add(Delete d)
         throws IOException
Add a Delete operation to the list of mutations

Parameters:
d - The Delete to add
Throws:
IOException

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

compareTo

public int compareTo(Row i)
Specified by:
compareTo in interface Comparable<Row>

getRow

public byte[] getRow()
Specified by:
getRow in interface Row
Returns:
The row.

getMutations

public List<Mutation> getMutations()
Returns:
An unmodifiable list of the current mutations.


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.