@InterfaceAudience.Public public class Append extends Mutation
This operation ensures atomicty to readers. Appends are done under a single row lock, so write operations to a row are synchronized, and readers are guaranteed to see this operation fully 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
addColumn(byte[], byte[], byte[])
method.
durability, familyMap, MUTATION_OVERHEAD, row, ts
ID_ATRIBUTE
COMPARATOR
Constructor and Description |
---|
Append(Append appendToCopy)
Copy constructor
|
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.
|
Append(byte[] row,
long ts,
NavigableMap<byte[],List<Cell>> familyMap)
Construct the Append with user defined data.
|
Modifier and Type | Method and Description |
---|---|
Append |
add(byte[] family,
byte[] qualifier,
byte[] value)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
Use
addColumn(byte[], byte[], byte[]) instead |
Append |
add(Cell cell)
Add column and value to this Append operation.
|
Append |
addColumn(byte[] family,
byte[] qualifier,
byte[] value)
Add the specified column and value to this Append operation.
|
protected long |
extraHeapSize()
Subclasses should override this method to add the heap size of their own fields.
|
TimeRange |
getTimeRange()
Gets the TimeRange used for this append.
|
boolean |
isReturnResults() |
Append |
setACL(Map<String,org.apache.hadoop.hbase.security.access.Permission> perms) |
Append |
setACL(String user,
org.apache.hadoop.hbase.security.access.Permission perms) |
Append |
setAttribute(String name,
byte[] value)
Sets an attribute.
|
Append |
setCellVisibility(org.apache.hadoop.hbase.security.visibility.CellVisibility expression)
Sets the visibility expression associated with cells in this Mutation.
|
Append |
setClusterIds(List<UUID> clusterIds)
Marks that the clusters with the given clusterIds have consumed the mutation
|
Append |
setDurability(Durability d)
Set the durability for this mutation
|
Append |
setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
Use
Append(byte[], long, NavigableMap) instead |
Append |
setId(String id)
This method allows you to set an identifier on an operation.
|
Append |
setPriority(int priority) |
Append |
setReturnResults(boolean returnResults) |
Append |
setTimeRange(long minStamp,
long maxStamp)
Sets the TimeRange to be used on the Get for this append.
|
Append |
setTimestamp(long timestamp)
Set the timestamp of the delete.
|
Append |
setTTL(long ttl)
Set the TTL desired for the result of the mutation, in milliseconds.
|
cellScanner, compareTo, get, getACL, getCellVisibility, getClusterIds, getDurability, getFamilyCellMap, getFingerprint, getRow, getTimestamp, getTimeStamp, getTTL, has, has, has, has, has, heapSize, isEmpty, numFamilies, size, toMap
getAttribute, getAttributeSize, getAttributesMap, getId, getPriority
public Append(byte[] row)
At least one column must be appended to.
row
- row key; makes a local copy of passed in array.public Append(Append appendToCopy)
appendToCopy
- append to copypublic Append(byte[] rowArray, int rowOffset, int rowLength)
At least one column must be appended to.
rowArray
- Makes a copy out of this buffer.rowOffset
- rowLength
- public Append(byte[] row, long ts, NavigableMap<byte[],List<Cell>> familyMap)
row
- row. CAN'T be nullts
- timestampfamilyMap
- the map to collect all cells internally. CAN'T be nullpublic Append setTimeRange(long minStamp, long maxStamp)
This is useful for when you have counters that only last for specific periods of time (ie. counters that are partitioned by time). By setting the range of valid times for this append, you can potentially gain some performance with a more optimal Get operation. Be careful adding the time range to this class as you will update the old cell if the time range doesn't include the latest cells.
This range is used as [minStamp, maxStamp).
minStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusivepublic TimeRange getTimeRange()
protected long extraHeapSize()
Mutation
extraHeapSize
in class Mutation
public Append setReturnResults(boolean returnResults)
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.public boolean isReturnResults()
@Deprecated public Append add(byte[] family, byte[] qualifier, byte[] value)
addColumn(byte[], byte[], byte[])
insteadfamily
- family namequalifier
- column qualifiervalue
- value to append to specified columnpublic Append addColumn(byte[] family, byte[] qualifier, byte[] value)
family
- family namequalifier
- column qualifiervalue
- value to append to specified columnpublic Append add(Cell cell)
cell
- public Append setTimestamp(long timestamp)
Mutation
setTimestamp
in class Mutation
public Append setAttribute(String name, byte[] value)
Attributes
setAttribute
in interface Attributes
setAttribute
in class OperationWithAttributes
name
- attribute namevalue
- attribute valuepublic Append setId(String id)
OperationWithAttributes
setId
in class OperationWithAttributes
id
- id to set for the scanpublic Append setDurability(Durability d)
Mutation
setDurability
in class Mutation
@Deprecated public Append setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
Append(byte[], long, NavigableMap)
insteadsetFamilyCellMap
in class Mutation
public Append setClusterIds(List<UUID> clusterIds)
Mutation
setClusterIds
in class Mutation
clusterIds
- of the clusters that have consumed the mutationpublic Append setCellVisibility(org.apache.hadoop.hbase.security.visibility.CellVisibility expression)
Mutation
setCellVisibility
in class Mutation
public Append setPriority(int priority)
setPriority
in class OperationWithAttributes
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.