org.apache.hadoop.hbase.client
Class Append

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
              extended by org.apache.hadoop.hbase.client.Append
All Implemented Interfaces:
Comparable<Row>, CellScannable, Attributes, Row, HeapSize

@InterfaceAudience.Public
@InterfaceStability.Stable
public class Append
extends Mutation

Performs Append operations on a single row.

Note that this operation does not appear atomic to readers. Appends are done under a single row lock, so write operations to a row are synchronized, but readers do not take row locks so get and scan operations can see this operation partially completed.

To append to a set of columns of a row, instantiate an Append object with the row to append to. At least one column to append must be specified using the add(byte[], byte[], byte[]) method.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.client.Mutation
durability, familyMap, MUTATION_OVERHEAD, row, ts
 
Fields inherited from class org.apache.hadoop.hbase.client.OperationWithAttributes
ID_ATRIBUTE
 
Constructor Summary
Append(byte[] row)
          Create a Append operation for the specified row.
Append(byte[] rowArray, int rowOffset, int rowLength)
          Create a Append operation for the specified row.
 
Method Summary
 Append add(byte[] family, byte[] qualifier, byte[] value)
          Add the specified column and value to this Append operation.
 Append add(Cell cell)
          Add column and value to this Append operation.
 boolean isReturnResults()
           
 void setReturnResults(boolean returnResults)
           
 
Methods inherited from class org.apache.hadoop.hbase.client.Mutation
cellScanner, compareTo, extraHeapSize, getClusterIds, getDurability, getFamilyCellMap, getFamilyMap, getFingerprint, getRow, getTimeStamp, getWriteToWAL, heapSize, isEmpty, numFamilies, setClusterIds, setDurability, setFamilyCellMap, setFamilyMap, setWriteToWAL, size, toMap
 
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
 

Constructor Detail

Append

public Append(byte[] row)
Create a Append operation for the specified row.

At least one column must be appended to.

Parameters:
row - row key; makes a local copy of passed in array.

Append

public Append(byte[] rowArray,
              int rowOffset,
              int rowLength)
Create a Append operation for the specified row.

At least one column must be appended to.

Parameters:
rowArray - Makes a copy out of this buffer.
rowOffset -
rowLength -
Method Detail

setReturnResults

public void setReturnResults(boolean returnResults)
Parameters:
returnResults - True (default) if the append operation should return the results. A client that is not interested in the result can save network bandwidth setting this to false.

isReturnResults

public boolean isReturnResults()
Returns:
current setting for returnResults

add

public Append add(byte[] family,
                  byte[] qualifier,
                  byte[] value)
Add the specified column and value to this Append operation.

Parameters:
family - family name
qualifier - column qualifier
value - value to append to specified column
Returns:
this

add

public Append add(Cell cell)
Add column and value to this Append operation.

Parameters:
cell -
Returns:
This instance


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