@InterfaceAudience.Public public class Delete extends Mutation
To delete an entire row, instantiate a Delete object with the row to delete. To further define the scope of what to delete, perform additional methods as outlined below.
To delete specific families, execute deleteFamily
for each family to delete.
To delete multiple versions of specific columns, execute
deleteColumns
for each column to delete.
To delete specific versions of specific columns, execute
deleteColumn
for each column version to delete.
Specifying timestamps, deleteFamily and deleteColumns will delete all versions with a timestamp less than or equal to that passed. If no timestamp is specified, an entry is added with a timestamp of 'now' where 'now' is the servers's System.currentTimeMillis(). Specifying a timestamp to the deleteColumn method will delete versions only with a timestamp equal to that specified. If no timestamp is passed to deleteColumn, internally, it figures the most recent cell's timestamp and adds a delete at that timestamp; i.e. it deletes the most recently added cell.
The timestamp passed to the constructor is used ONLY for delete of rows. For anything less -- a deleteColumn, deleteColumns or deleteFamily -- then you need to use the method overrides that take a timestamp. The constructor timestamp is not referenced.
durability, familyMap, MUTATION_OVERHEAD, row, ts
ID_ATRIBUTE
COMPARATOR
Constructor and Description |
---|
Delete(byte[] row)
Create a Delete operation for the specified row.
|
Delete(byte[] row,
int rowOffset,
int rowLength)
Create a Delete operation for the specified row and timestamp.
|
Delete(byte[] row,
int rowOffset,
int rowLength,
long timestamp)
Create a Delete operation for the specified row and timestamp.
|
Delete(byte[] row,
long timestamp)
Create a Delete operation for the specified row and timestamp.
|
Delete(byte[] row,
long ts,
NavigableMap<byte[],List<Cell>> familyMap)
Construct the Delete with user defined data.
|
Delete(Delete deleteToCopy) |
Modifier and Type | Method and Description |
---|---|
Delete |
add(Cell cell)
Add an existing delete marker to this Delete object.
|
Delete |
addColumn(byte[] family,
byte[] qualifier)
Delete the latest version of the specified column.
|
Delete |
addColumn(byte[] family,
byte[] qualifier,
long timestamp)
Delete the specified version of the specified column.
|
Delete |
addColumns(byte[] family,
byte[] qualifier)
Delete all versions of the specified column.
|
Delete |
addColumns(byte[] family,
byte[] qualifier,
long timestamp)
Delete all versions of the specified column with a timestamp less than
or equal to the specified timestamp.
|
Delete |
addDeleteMarker(Cell kv)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0. Use
add(Cell)
instead |
Delete |
addFamily(byte[] family)
Delete all versions of all columns of the specified family.
|
Delete |
addFamily(byte[] family,
long timestamp)
Delete all columns of the specified family with a timestamp less than
or equal to the specified timestamp.
|
Delete |
addFamilyVersion(byte[] family,
long timestamp)
Delete all columns of the specified family with a timestamp equal to
the specified timestamp.
|
Delete |
setACL(Map<String,Permission> perms) |
Delete |
setACL(String user,
Permission perms) |
Delete |
setAttribute(String name,
byte[] value)
Sets an attribute.
|
Delete |
setCellVisibility(CellVisibility expression)
Sets the visibility expression associated with cells in this Mutation.
|
Delete |
setClusterIds(List<UUID> clusterIds)
Marks that the clusters with the given clusterIds have consumed the mutation
|
Delete |
setDurability(Durability d)
Set the durability for this mutation
|
Delete |
setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0.
Use
Delete(byte[], long, NavigableMap) instead |
Delete |
setId(String id)
This method allows you to set an identifier on an operation.
|
Delete |
setPriority(int priority) |
Delete |
setTimestamp(long timestamp)
Set the timestamp of the delete.
|
Delete |
setTTL(long ttl)
Set the TTL desired for the result of the mutation, in milliseconds.
|
cellScanner, checkRow, checkRow, checkRow, compareTo, createPutKeyValue, createPutKeyValue, createPutKeyValue, extraHeapSize, get, getACL, getCellList, getCellVisibility, getClusterIds, getDurability, getFamilyCellMap, getFingerprint, getRow, getTimestamp, getTimeStamp, getTTL, has, has, has, has, has, heapSize, isEmpty, isReturnResults, numFamilies, setReturnResults, size, toCellVisibility, toMap
getAttribute, getAttributeSize, getAttributesMap, getId, getPriority
public Delete(byte[] row)
If no further operations are done, this will delete everything associated with the specified row (all versions of all columns in all families), with timestamp from current point in time to the past. Cells defining timestamp for a future point in time (timestamp > current time) will not be deleted.
row
- row keypublic Delete(byte[] row, long timestamp)
If no further operations are done, this will delete all columns in all families of the specified row with a timestamp less than or equal to the specified timestamp.
This timestamp is ONLY used for a delete row operation. If specifying families or columns, you must specify each timestamp individually.
row
- row keytimestamp
- maximum version timestamp (only for delete row)public Delete(byte[] row, int rowOffset, int rowLength)
If no further operations are done, this will delete all columns in all families of the specified row with a timestamp less than or equal to the specified timestamp.
This timestamp is ONLY used for a delete row operation. If specifying families or columns, you must specify each timestamp individually.
row
- We make a local copy of this passed in row.rowOffset
- rowLength
- public Delete(byte[] row, int rowOffset, int rowLength, long timestamp)
If no further operations are done, this will delete all columns in all families of the specified row with a timestamp less than or equal to the specified timestamp.
This timestamp is ONLY used for a delete row operation. If specifying families or columns, you must specify each timestamp individually.
row
- We make a local copy of this passed in row.rowOffset
- rowLength
- timestamp
- maximum version timestamp (only for delete row)public Delete(byte[] row, long ts, NavigableMap<byte[],List<Cell>> familyMap)
Cell.Type
2) the row of each cell must be same with passed row.row
- row. CAN'T be nullts
- timestampfamilyMap
- the map to collect all cells internally. CAN'T be null@Deprecated public Delete addDeleteMarker(Cell kv) throws IOException
add(Cell)
insteadkv
- An existing KeyValue of type "delete".IOException
public Delete add(Cell cell) throws IOException
add
in class Mutation
cell
- An existing cell of type "delete".IOException
public Delete addFamily(byte[] family)
Overrides previous calls to deleteColumn and deleteColumns for the specified family.
family
- family namepublic Delete addFamily(byte[] family, long timestamp)
Overrides previous calls to deleteColumn and deleteColumns for the specified family.
family
- family nametimestamp
- maximum version timestamppublic Delete addFamilyVersion(byte[] family, long timestamp)
family
- family nametimestamp
- version timestamppublic Delete addColumns(byte[] family, byte[] qualifier)
family
- family namequalifier
- column qualifierpublic Delete addColumns(byte[] family, byte[] qualifier, long timestamp)
family
- family namequalifier
- column qualifiertimestamp
- maximum version timestamppublic Delete addColumn(byte[] family, byte[] qualifier)
family
- family namequalifier
- column qualifierpublic Delete addColumn(byte[] family, byte[] qualifier, long timestamp)
family
- family namequalifier
- column qualifiertimestamp
- version timestamppublic Delete setTimestamp(long timestamp)
Mutation
setTimestamp
in class Mutation
public Delete setAttribute(String name, byte[] value)
Attributes
setAttribute
in interface Attributes
setAttribute
in class OperationWithAttributes
name
- attribute namevalue
- attribute valuepublic Delete setId(String id)
OperationWithAttributes
setId
in class OperationWithAttributes
id
- id to set for the scanpublic Delete setDurability(Durability d)
Mutation
setDurability
in class Mutation
@Deprecated public Delete setFamilyCellMap(NavigableMap<byte[],List<Cell>> map)
Delete(byte[], long, NavigableMap)
insteadsetFamilyCellMap
in class Mutation
public Delete setClusterIds(List<UUID> clusterIds)
Mutation
setClusterIds
in class Mutation
clusterIds
- of the clusters that have consumed the mutationpublic Delete setCellVisibility(CellVisibility expression)
Mutation
setCellVisibility
in class Mutation
public Delete setACL(String user, Permission perms)
public Delete setACL(Map<String,Permission> perms)
public Delete setTTL(long ttl)
Mutation
public Delete setPriority(int priority)
setPriority
in class OperationWithAttributes
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.