org.apache.hadoop.hbase.client
Class Mutation

java.lang.Object
  extended by org.apache.hadoop.hbase.client.Operation
      extended by org.apache.hadoop.hbase.client.OperationWithAttributes
          extended by org.apache.hadoop.hbase.client.Mutation
All Implemented Interfaces:
Comparable<Row>, CellScannable, Attributes, Row, HeapSize
Direct Known Subclasses:
Append, Delete, Increment, Put

@InterfaceAudience.Public
@InterfaceStability.Evolving
public abstract class Mutation
extends OperationWithAttributes
implements Row, CellScannable, HeapSize


Field Summary
protected  Durability durability
           
protected  NavigableMap<byte[],List<Cell>> familyMap
           
static long MUTATION_OVERHEAD
           
protected  byte[] row
           
protected  long ts
           
 
Fields inherited from class org.apache.hadoop.hbase.client.OperationWithAttributes
ID_ATRIBUTE
 
Constructor Summary
Mutation()
           
 
Method Summary
 CellScanner cellScanner()
           
 int compareTo(Row d)
           
protected  long extraHeapSize()
          Subclasses should override this method to add the heap size of their own fields.
 List<UUID> getClusterIds()
           
 Durability getDurability()
          Get the current durability
 NavigableMap<byte[],List<Cell>> getFamilyCellMap()
          Method for retrieving the put's familyMap
 Map<byte[],List<KeyValue>> getFamilyMap()
          Deprecated. 
 Map<String,Object> getFingerprint()
          Compile the column family (i.e.
 byte[] getRow()
          Method for retrieving the delete's row
 long getTimeStamp()
          Method for retrieving the timestamp
 boolean getWriteToWAL()
          Deprecated. 
 long heapSize()
           
 boolean isEmpty()
          Method to check if the familyMap is empty
 int numFamilies()
           
 void setClusterIds(List<UUID> clusterIds)
          Marks that the clusters with the given clusterIds have consumed the mutation
 void setDurability(Durability d)
          Set the durability for this mutation
 void setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
          Method for setting the put's familyMap
 void setFamilyMap(NavigableMap<byte[],List<KeyValue>> map)
          Deprecated. use setFamilyCellMap(NavigableMap) instead.
 void setWriteToWAL(boolean writeToWal)
          Deprecated. 
 int size()
          Number of KeyValues carried by this Mutation.
 Map<String,Object> toMap(int maxCols)
          Compile the details beyond the scope of getFingerprint (row, columns, timestamps, etc.) into a Map along with the fingerprinted information.
 
Methods inherited from class org.apache.hadoop.hbase.client.OperationWithAttributes
getAttribute, getAttributeSize, getAttributesMap, getId, setAttribute, setId
 
Methods inherited from class org.apache.hadoop.hbase.client.Operation
toJSON, toJSON, toMap, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MUTATION_OVERHEAD

public static final long MUTATION_OVERHEAD

row

protected byte[] row

ts

protected long ts

durability

protected Durability durability

familyMap

protected NavigableMap<byte[],List<Cell>> familyMap
Constructor Detail

Mutation

public Mutation()
Method Detail

cellScanner

public CellScanner cellScanner()
Specified by:
cellScanner in interface CellScannable

getFingerprint

public Map<String,Object> getFingerprint()
Compile the column family (i.e. schema) information into a Map. Useful for parsing and aggregation by debugging, logging, and administration tools.

Specified by:
getFingerprint in class Operation
Returns:
Map

toMap

public Map<String,Object> toMap(int maxCols)
Compile the details beyond the scope of getFingerprint (row, columns, timestamps, etc.) into a Map along with the fingerprinted information. Useful for debugging, logging, and administration tools.

Specified by:
toMap in class Operation
Parameters:
maxCols - a limit on the number of columns output prior to truncation
Returns:
Map

setDurability

public void setDurability(Durability d)
Set the durability for this mutation

Parameters:
d -

getDurability

public Durability getDurability()
Get the current durability


setWriteToWAL

@Deprecated
public void setWriteToWAL(boolean writeToWal)
Deprecated. 

Set the durability for this mutation. If this is set to true, the default durability of the table is set.

Parameters:
writeToWal -

getWriteToWAL

@Deprecated
public boolean getWriteToWAL()
Deprecated. 

Get the durability for this mutation.

Returns:
- true if this mutation is set to write to the WAL either synchronously, asynchronously or fsync to disk on the file system. - to get the exact durability, use the {#getDurability} method.

getFamilyMap

@Deprecated
public Map<byte[],List<KeyValue>> getFamilyMap()
Deprecated. 


getFamilyCellMap

public NavigableMap<byte[],List<Cell>> getFamilyCellMap()
Method for retrieving the put's familyMap

Returns:
familyMap

setFamilyCellMap

public void setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
Method for setting the put's familyMap


setFamilyMap

@Deprecated
public void setFamilyMap(NavigableMap<byte[],List<KeyValue>> map)
Deprecated. use setFamilyCellMap(NavigableMap) instead.

Method for setting the put's familyMap that is deprecated and inefficient.


isEmpty

public boolean isEmpty()
Method to check if the familyMap is empty

Returns:
true if empty, false otherwise

getRow

public byte[] getRow()
Method for retrieving the delete's row

Specified by:
getRow in interface Row
Returns:
row

compareTo

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

getTimeStamp

public long getTimeStamp()
Method for retrieving the timestamp

Returns:
timestamp

setClusterIds

public void setClusterIds(List<UUID> clusterIds)
Marks that the clusters with the given clusterIds have consumed the mutation

Parameters:
clusterIds - of the clusters that have consumed the mutation

getClusterIds

public List<UUID> getClusterIds()
Returns:
the set of clusterIds that have consumed the mutation

size

public int size()
Number of KeyValues carried by this Mutation.

Returns:
the total number of KeyValues

numFamilies

public int numFamilies()
Returns:
the number of different families

heapSize

public long heapSize()
Specified by:
heapSize in interface HeapSize
Returns:
Calculate what Mutation adds to class heap size.

extraHeapSize

protected long extraHeapSize()
Subclasses should override this method to add the heap size of their own fields.

Returns:
the heap size to add (will be aligned).


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