org.apache.hadoop.hbase.client
Class RowMutations

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

@InterfaceAudience.Public
@InterfaceStability.Evolving
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.

We compare and equate mutations based off their row so be careful putting RowMutations into Sets or using them as keys in Maps.


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)
           
 boolean equals(Object obj)
           
 List<Mutation> getMutations()
           
 byte[] getRow()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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

compareTo

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

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.