@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class Mutation extends OperationWithAttributes implements Row, CellScannable, HeapSize
Modifier and Type | Field and Description |
---|---|
private static String |
CONSUMED_CLUSTER_IDS
The attribute for storing the list of clusters that have consumed the change.
|
protected Durability |
durability |
protected NavigableMap<byte[],List<Cell>> |
familyMap |
static long |
MUTATION_OVERHEAD |
private static String |
OP_ATTRIBUTE_TTL
The attribute for storing TTL for the result of the mutation.
|
protected static String |
RETURN_RESULTS
Deprecated.
this field is private as of HBase 2.0.
|
protected byte[] |
row |
protected long |
ts |
ID_ATRIBUTE
Constructor and Description |
---|
Mutation() |
Modifier and Type | Method and Description |
---|---|
CellScanner |
cellScanner() |
private static Map<String,Object> |
cellToStringMap(Cell c) |
(package private) static byte[] |
checkRow(byte[] row) |
(package private) static byte[] |
checkRow(byte[] row,
int offset,
int length) |
(package private) static void |
checkRow(ByteBuffer row) |
int |
compareTo(Row d) |
(package private) KeyValue |
createPutKeyValue(byte[] family,
byte[] qualifier,
long ts,
byte[] value) |
(package private) KeyValue |
createPutKeyValue(byte[] family,
byte[] qualifier,
long ts,
byte[] value,
Tag[] tags)
Create a KeyValue with this objects row key and the Put identifier.
|
(package private) KeyValue |
createPutKeyValue(byte[] family,
ByteBuffer qualifier,
long ts,
ByteBuffer value,
Tag[] tags) |
protected long |
extraHeapSize()
Subclasses should override this method to add the heap size of their own fields.
|
byte[] |
getACL() |
(package private) List<Cell> |
getCellList(byte[] family)
Creates an empty list if one doesn't exist for the given column family
or else it returns the associated list of Cell objects.
|
CellVisibility |
getCellVisibility() |
List<UUID> |
getClusterIds() |
Durability |
getDurability()
Get the current durability
|
NavigableMap<byte[],List<Cell>> |
getFamilyCellMap()
Method for retrieving the put's familyMap
|
NavigableMap<byte[],List<KeyValue>> |
getFamilyMap()
Deprecated.
use
getFamilyCellMap() instead. |
Map<String,Object> |
getFingerprint()
Compile the column family (i.e.
|
byte[] |
getRow()
Method for retrieving the delete's row
|
long |
getTimeStamp()
Method for retrieving the timestamp
|
long |
getTTL()
Return the TTL requested for the result of the mutation, in milliseconds.
|
boolean |
getWriteToWAL()
Deprecated.
Use
getDurability() instead. |
long |
heapSize() |
boolean |
isEmpty()
Method to check if the familyMap is empty
|
protected boolean |
isReturnResults() |
int |
numFamilies() |
Mutation |
setACL(Map<String,Permission> perms) |
Mutation |
setACL(String user,
Permission perms) |
Mutation |
setCellVisibility(CellVisibility expression)
Sets the visibility expression associated with cells in this Mutation.
|
Mutation |
setClusterIds(List<UUID> clusterIds)
Marks that the clusters with the given clusterIds have consumed the mutation
|
Mutation |
setDurability(Durability d)
Set the durability for this mutation
|
Mutation |
setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
Method for setting the put's familyMap
|
Mutation |
setFamilyMap(NavigableMap<byte[],List<KeyValue>> map)
Deprecated.
use
setFamilyCellMap(NavigableMap) instead. |
protected Mutation |
setReturnResults(boolean returnResults) |
Mutation |
setTTL(long ttl)
Set the TTL desired for the result of the mutation, in milliseconds.
|
Mutation |
setWriteToWAL(boolean write)
Deprecated.
Use
setDurability(Durability) instead. |
int |
size()
Number of KeyValues carried by this Mutation.
|
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.
|
getAttribute, getAttributeSize, getAttributesMap, getId, setAttribute, setId
public static final long MUTATION_OVERHEAD
private static final String CONSUMED_CLUSTER_IDS
private static final String OP_ATTRIBUTE_TTL
@Deprecated protected static final String RETURN_RESULTS
protected byte[] row
protected long ts
protected Durability durability
protected NavigableMap<byte[],List<Cell>> familyMap
public CellScanner cellScanner()
cellScanner
in interface CellScannable
Cell
sList<Cell> getCellList(byte[] family)
family
- column familyKeyValue createPutKeyValue(byte[] family, byte[] qualifier, long ts, byte[] value)
KeyValue createPutKeyValue(byte[] family, byte[] qualifier, long ts, byte[] value, Tag[] tags)
family
- qualifier
- ts
- value
- tags
- - Specify the Tags as an Array KeyValue.Tag
KeyValue createPutKeyValue(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value, Tag[] tags)
public Map<String,Object> getFingerprint()
getFingerprint
in class Operation
public Map<String,Object> toMap(int maxCols)
@Deprecated public boolean getWriteToWAL()
getDurability()
instead.@Deprecated public Mutation setWriteToWAL(boolean write)
setDurability(Durability)
instead.setDurability(Durability)
write
- true if edits should be written to WAL, false if notpublic Mutation setDurability(Durability d)
d
- public Durability getDurability()
public NavigableMap<byte[],List<Cell>> getFamilyCellMap()
public Mutation setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
@Deprecated public NavigableMap<byte[],List<KeyValue>> getFamilyMap()
getFamilyCellMap()
instead.@Deprecated public Mutation setFamilyMap(NavigableMap<byte[],List<KeyValue>> map)
setFamilyCellMap(NavigableMap)
instead.public boolean isEmpty()
public byte[] getRow()
public int compareTo(Row d)
compareTo
in interface Comparable<Row>
public long getTimeStamp()
public Mutation setClusterIds(List<UUID> clusterIds)
clusterIds
- of the clusters that have consumed the mutationpublic List<UUID> getClusterIds()
public Mutation setCellVisibility(CellVisibility expression)
expression
- public CellVisibility getCellVisibility() throws DeserializationException
DeserializationException
public int size()
public int numFamilies()
public long heapSize()
public byte[] getACL()
public Mutation setACL(String user, Permission perms)
user
- User short nameperms
- Permissions for the userpublic Mutation setACL(Map<String,Permission> perms)
perms
- A map of permissions for a user or userspublic long getTTL()
public Mutation setTTL(long ttl)
ttl
- the TTL desired for the result of the mutation, in milliseconds@InterfaceAudience.Private protected boolean isReturnResults()
@InterfaceAudience.Private protected Mutation setReturnResults(boolean returnResults)
protected long extraHeapSize()
static byte[] checkRow(byte[] row)
row
- Row to checkrow
IllegalArgumentException
- Thrown if row
is empty or null or
> HConstants.MAX_ROW_LENGTH
static byte[] checkRow(byte[] row, int offset, int length)
row
- Row to checkoffset
- length
- row
IllegalArgumentException
- Thrown if row
is empty or null or
> HConstants.MAX_ROW_LENGTH
static void checkRow(ByteBuffer row)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.