@InterfaceAudience.Public public abstract class Mutation extends OperationWithAttributes implements Row, CellScannable, HeapSize
Modifier and Type | Field and Description |
---|---|
protected Durability |
durability |
protected NavigableMap<byte[],List<Cell>> |
familyMap |
static long |
MUTATION_OVERHEAD |
protected byte[] |
row |
protected long |
ts |
ID_ATRIBUTE
COMPARATOR
Modifier | Constructor and Description |
---|---|
protected |
Mutation()
empty construction.
|
protected |
Mutation(byte[] row,
long ts,
NavigableMap<byte[],List<Cell>> familyMap)
Construct the mutation with user defined data.
|
protected |
Mutation(Mutation clone) |
Modifier and Type | Method and Description |
---|---|
CellScanner |
cellScanner() |
int |
compareTo(Row d)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
Use
Row.COMPARATOR instead |
protected long |
extraHeapSize()
Subclasses should override this method to add the heap size of their own fields.
|
List<Cell> |
get(byte[] family,
byte[] qualifier)
Returns a list of all KeyValue objects with matching column family and qualifier.
|
byte[] |
getACL() |
CellVisibility |
getCellVisibility() |
List<UUID> |
getClusterIds() |
Durability |
getDurability()
Get the current durability
|
NavigableMap<byte[],List<Cell>> |
getFamilyCellMap()
Method for retrieving the put's familyMap
|
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 |
getTimeStamp()
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
Use
getTimestamp() instead |
long |
getTTL()
Return the TTL requested for the result of the mutation, in milliseconds.
|
boolean |
has(byte[] family,
byte[] qualifier)
A convenience method to determine if this object's familyMap contains
a value assigned to the given family & qualifier.
|
boolean |
has(byte[] family,
byte[] qualifier,
byte[] value)
A convenience method to determine if this object's familyMap contains
a value assigned to the given family, qualifier and timestamp.
|
boolean |
has(byte[] family,
byte[] qualifier,
long ts)
A convenience method to determine if this object's familyMap contains
a value assigned to the given family, qualifier and timestamp.
|
boolean |
has(byte[] family,
byte[] qualifier,
long ts,
byte[] value)
A convenience method to determine if this object's familyMap contains
the given value assigned to the given family, qualifier and timestamp.
|
protected boolean |
has(byte[] family,
byte[] qualifier,
long ts,
byte[] value,
boolean ignoreTS,
boolean ignoreValue) |
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)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
Use
Mutation(byte[], long, NavigableMap) instead |
protected Mutation |
setReturnResults(boolean returnResults) |
Mutation |
setTimestamp(long timestamp)
Set the timestamp of the delete.
|
Mutation |
setTTL(long ttl)
Set the TTL desired for the result of the mutation, in milliseconds.
|
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, getPriority, setAttribute, setId, setPriority
public static final long MUTATION_OVERHEAD
protected byte[] row
protected long ts
protected Durability durability
protected NavigableMap<byte[],List<Cell>> familyMap
protected Mutation()
protected Mutation(Mutation clone)
protected Mutation(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 CellScanner cellScanner()
cellScanner
in interface CellScannable
Cell
spublic Map<String,Object> getFingerprint()
getFingerprint
in class Operation
public Map<String,Object> toMap(int maxCols)
public Mutation setDurability(Durability d)
d
- public Durability getDurability()
public NavigableMap<byte[],List<Cell>> getFamilyCellMap()
@Deprecated public Mutation setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
Mutation(byte[], long, NavigableMap)
insteadpublic boolean isEmpty()
public byte[] getRow()
@Deprecated public int compareTo(Row d)
Row.COMPARATOR
insteadcompareTo
in interface Comparable<Row>
compareTo
in interface Row
@Deprecated public long getTimeStamp()
getTimestamp()
insteadpublic 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()
public Mutation setTimestamp(long timestamp)
public boolean has(byte[] family, byte[] qualifier)
family
- column familyqualifier
- column qualifierpublic boolean has(byte[] family, byte[] qualifier, long ts)
family
- column familyqualifier
- column qualifierts
- timestamppublic boolean has(byte[] family, byte[] qualifier, byte[] value)
family
- column familyqualifier
- column qualifiervalue
- value to checkpublic boolean has(byte[] family, byte[] qualifier, long ts, byte[] value)
family
- column familyqualifier
- column qualifierts
- timestampvalue
- value to checkpublic List<Cell> get(byte[] family, byte[] qualifier)
family
- column familyqualifier
- column qualifierprotected boolean has(byte[] family, byte[] qualifier, long ts, byte[] value, boolean ignoreTS, boolean ignoreValue)
Copyright © 2007–2019 Cloudera. All rights reserved.