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>, Attributes, Row, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<Row>
Direct Known Subclasses:
Append, Delete, Put

public abstract class Mutation
extends OperationWithAttributes
implements Row


Field Summary
protected  Map<byte[],List<KeyValue>> familyMap
           
protected  long lockId
           
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
 int compareTo(Row d)
           
 UUID getClusterId()
           
 Durability getDurability()
          Get the current durability
 Map<byte[],List<KeyValue>> getFamilyMap()
          Method for retrieving the put's familyMap
 Map<String,Object> getFingerprint()
          Compile the column family (i.e.
 long getLockId()
          Deprecated. RowLock and associated operations are deprecated
 byte[] getRow()
          Method for retrieving the delete's row
 RowLock getRowLock()
          Deprecated. RowLock and associated operations are deprecated
 long getTimeStamp()
          Method for retrieving the timestamp
 boolean getWriteToWAL()
          Deprecated. Use getDurability() instead.
 boolean isEmpty()
          Method to check if the familyMap is empty
 int numFamilies()
           
 void setClusterId(UUID clusterId)
          Set the replication custer id.
 void setDurability(Durability d)
          Set the durability for this mutation.
 void setFamilyMap(Map<byte[],List<KeyValue>> map)
          Method for setting the put's familyMap
 void setWriteToWAL(boolean write)
          Deprecated. Use setDurability(Durability) instead.
 int size()
           
 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, readAttributes, setAttribute, setId, writeAttributes
 
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
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 

Field Detail

row

protected byte[] row

ts

protected long ts

lockId

protected long lockId

writeToWAL

protected boolean writeToWAL

familyMap

protected Map<byte[],List<KeyValue>> familyMap
Constructor Detail

Mutation

public Mutation()
Method Detail

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()
Deprecated. Use getDurability() instead.

Returns:
true if edits should be applied to WAL, false if not

setWriteToWAL

public void setWriteToWAL(boolean write)
Deprecated. Use setDurability(Durability) instead.

Set whether this Delete should be written to the WAL or not. Not writing the WAL means you may lose edits on server crash. This method will reset any changes made via setDurability(Durability)

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

setDurability

public void setDurability(Durability d)
Set the durability for this mutation. Note that RegionServers prior to 0.94.7 will only honor Durability.SKIP_WAL. This method will reset any changes made via setWriteToWAL(boolean)

Parameters:
d -

getDurability

public Durability getDurability()
Get the current durability


getFamilyMap

public Map<byte[],List<KeyValue>> getFamilyMap()
Method for retrieving the put's familyMap

Returns:
familyMap

setFamilyMap

public void setFamilyMap(Map<byte[],List<KeyValue>> 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>

getRowLock

public RowLock getRowLock()
Deprecated. RowLock and associated operations are deprecated

Method for retrieving the delete's RowLock

Returns:
RowLock

getLockId

public long getLockId()
Deprecated. RowLock and associated operations are deprecated

Method for retrieving the delete's lock ID.

Returns:
The lock ID.

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()
Returns:
the total number of KeyValues

numFamilies

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


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