@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.
Modifier and Type | Field and Description |
---|---|
private static long |
HEAP_OVERHEAD |
private static org.slf4j.Logger |
LOG |
private TimeRange |
tr |
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,Permission> perms) |
Append |
setACL(String user,
Permission perms) |
Append |
setAttribute(String name,
byte[] value)
Sets an attribute.
|
Append |
setCellVisibility(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, checkRow, checkRow, checkRow, compareTo, createPutKeyValue, createPutKeyValue, createPutKeyValue, get, getACL, getCellList, getCellVisibility, getClusterIds, getDurability, getFamilyCellMap, getFingerprint, getRow, getTimestamp, getTimeStamp, getTTL, has, has, has, has, has, heapSize, isEmpty, numFamilies, size, toCellVisibility, toMap
getAttribute, getAttributeSize, getAttributesMap, getId, getPriority
private static final org.slf4j.Logger LOG
private static final long HEAP_OVERHEAD
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)
setReturnResults
in class Mutation
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()
isReturnResults
in class Mutation
@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 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(CellVisibility expression)
Mutation
setCellVisibility
in class Mutation
public Append setACL(String user, Permission perms)
public Append setACL(Map<String,Permission> perms)
public Append setPriority(int priority)
setPriority
in class OperationWithAttributes
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.