Class Append
- All Implemented Interfaces:
CellScannable
,Attributes
,Row
,ExtendedCellScannable
,HeapSize
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.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final long
private static final org.slf4j.Logger
private TimeRange
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
Fields inherited from interface org.apache.hadoop.hbase.client.Row
COMPARATOR
-
Constructor Summary
ConstructorDescriptionAppend
(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.Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionAdd column and value to this Append operation.addColumn
(byte[] family, byte[] qualifier, byte[] value) Add the specified column and value to this Append operation.protected long
Subclasses should override this method to add the heap size of their own fields.get a CellBuilder instance that already has relevant Type and Row set.Gets the TimeRange used for this append.boolean
Returns current setting for returnResultssetACL
(String user, Permission perms) Set the ACL for this operation.setACL
(Map<String, Permission> perms) Set the ACL for this operation.setAttribute
(String name, byte[] value) Sets an attribute.setCellVisibility
(CellVisibility expression) Sets the visibility expression associated with cells in this Mutation.setClusterIds
(List<UUID> clusterIds) Marks that the clusters with the given clusterIds have consumed the mutationSet the durability for this mutationThis method allows you to set an identifier on an operation.setPriority
(int priority) setReturnResults
(boolean returnResults) True (default) if the append operation should return the results.setTimeRange
(long minStamp, long maxStamp) Sets the TimeRange to be used on the Get for this append.setTimestamp
(long timestamp) Set the timestamp of the delete.setTTL
(long ttl) Set the TTL desired for the result of the mutation, in milliseconds.Methods inherited from class org.apache.hadoop.hbase.client.Mutation
cellScanner, checkRow, checkRow, checkRow, checkTimestamp, createPutKeyValue, createPutKeyValue, createPutKeyValue, get, getACL, getCellBuilder, getCellBuilder, getCellList, getCellVisibility, getClusterIds, getDurability, getFamilyCellMap, getFingerprint, getRow, getTimestamp, getTTL, has, has, has, has, has, heapSize, isEmpty, numFamilies, size, toCellVisibility, toMap
Methods inherited from class org.apache.hadoop.hbase.client.OperationWithAttributes
getAttribute, getAttributeSize, getAttributesMap, getId, getPriority
-
Field Details
-
LOG
-
HEAP_OVERHEAD
-
tr
-
-
Constructor Details
-
Append
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
Copy constructor- Parameters:
appendToCopy
- append to copy
-
Append
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.
-
-
Method Details
-
setTimeRange
Sets the TimeRange to be used on the Get for this append.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).
- Parameters:
minStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusive
-
getTimeRange
Gets the TimeRange used for this append. -
extraHeapSize
Description copied from class:Mutation
Subclasses should override this method to add the heap size of their own fields.- Overrides:
extraHeapSize
in classMutation
- Returns:
- the heap size to add (will be aligned).
-
setReturnResults
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.- Overrides:
setReturnResults
in classMutation
-
isReturnResults
Returns current setting for returnResults- Overrides:
isReturnResults
in classMutation
-
addColumn
Add the specified column and value to this Append operation.- Parameters:
family
- family namequalifier
- column qualifiervalue
- value to append to specified column
-
add
Add column and value to this Append operation. -
setTimestamp
Description copied from class:Mutation
Set the timestamp of the delete.- Overrides:
setTimestamp
in classMutation
-
setAttribute
Description copied from interface:Attributes
Sets an attribute. In case value = null attribute is removed from the attributes map. Attribute names starting with _ indicate system attributes.- Specified by:
setAttribute
in interfaceAttributes
- Overrides:
setAttribute
in classOperationWithAttributes
- Parameters:
name
- attribute namevalue
- attribute value
-
setId
Description copied from class:OperationWithAttributes
This method allows you to set an identifier on an operation. The original motivation for this was to allow the identifier to be used in slow query logging, but this could obviously be useful in other places. One use of this could be to put a class.method identifier in here to see where the slow query is coming from. id to set for the scan- Overrides:
setId
in classOperationWithAttributes
-
setDurability
Description copied from class:Mutation
Set the durability for this mutation- Overrides:
setDurability
in classMutation
-
setClusterIds
Description copied from class:Mutation
Marks that the clusters with the given clusterIds have consumed the mutation- Overrides:
setClusterIds
in classMutation
- Parameters:
clusterIds
- of the clusters that have consumed the mutation
-
setCellVisibility
Description copied from class:Mutation
Sets the visibility expression associated with cells in this Mutation.- Overrides:
setCellVisibility
in classMutation
-
setACL
Description copied from class:Mutation
Set the ACL for this operation. -
setACL
Description copied from class:Mutation
Set the ACL for this operation. -
setPriority
- Overrides:
setPriority
in classOperationWithAttributes
-
setTTL
Description copied from class:Mutation
Set the TTL desired for the result of the mutation, in milliseconds. -
getCellBuilder
Description copied from class:Mutation
get a CellBuilder instance that already has relevant Type and Row set.- Specified by:
getCellBuilder
in classMutation
- Parameters:
type
- e.g CellBuilderType.SHALLOW_COPY- Returns:
- CellBuilder which already has relevant Type and Row set.
-