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  NavigableMap<byte[],List<? extends Cell>> familyMap
           
protected  byte[] row
           
protected  long ts
           
protected  boolean writeToWAL
           
 
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.
 UUID getClusterId()
           
 NavigableMap<byte[],List<? extends Cell>> getFamilyMap()
          Method for retrieving the put's familyMap
 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()
           
 long heapSize()
           
 boolean isEmpty()
          Method to check if the familyMap is empty
 int numFamilies()
           
 void setClusterId(UUID clusterId)
          Set the replication custer id.
 void setFamilyMap(NavigableMap<byte[],List<? extends Cell>> map)
          Method for setting the put's familyMap
 void setWriteToWAL(boolean write)
          Set whether this Delete should be written to the WAL or not.
 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

row

protected byte[] row

ts

protected long ts

writeToWAL

protected boolean writeToWAL

familyMap

protected NavigableMap<byte[],List<? extends 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

getWriteToWAL

public boolean getWriteToWAL()
Returns:
true if edits should be applied to WAL, false if not

setWriteToWAL

public void setWriteToWAL(boolean write)
Set whether this Delete should be written to the WAL or not. Not writing the WAL means you may lose edits on server crash.

Parameters:
write - true if edits should be written to WAL, false if not

getFamilyMap

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

Returns:
familyMap

setFamilyMap

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


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

setClusterId

public void setClusterId(UUID clusterId)
Set the replication custer id.

Parameters:
clusterId -

getClusterId

public UUID getClusterId()
Returns:
The replication cluster id.

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.