|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.client.Operation
org.apache.hadoop.hbase.client.OperationWithAttributes
org.apache.hadoop.hbase.client.Mutation
org.apache.hadoop.hbase.client.Delete
@InterfaceAudience.Public @InterfaceStability.Stable public class Delete
Used to perform Delete operations on a single row.
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.
Field Summary |
---|
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 |
Constructor Summary | |
---|---|
Delete(byte[] row)
Create a Delete operation for the specified row. |
|
Delete(byte[] rowArray,
int rowOffset,
int rowLength)
Create a Delete operation for the specified row and timestamp. |
|
Delete(byte[] rowArray,
int rowOffset,
int rowLength,
long ts)
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(Delete d)
|
Method Summary | |
---|---|
Delete |
addDeleteMarker(Cell kv)
Advanced use only. |
Delete |
deleteColumn(byte[] family,
byte[] qualifier)
Delete the latest version of the specified column. |
Delete |
deleteColumn(byte[] family,
byte[] qualifier,
long timestamp)
Delete the specified version of the specified column. |
Delete |
deleteColumns(byte[] family,
byte[] qualifier)
Delete all versions of the specified column. |
Delete |
deleteColumns(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 |
deleteFamily(byte[] family)
Delete all versions of all columns of the specified family. |
Delete |
deleteFamily(byte[] family,
long timestamp)
Delete all columns of the specified family with a timestamp less than or equal to the specified timestamp. |
Delete |
deleteFamilyVersion(byte[] family,
long timestamp)
Delete all columns of the specified family with a timestamp equal to the specified timestamp. |
void |
setTimestamp(long timestamp)
Set the timestamp of the delete. |
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. |
Methods inherited from class org.apache.hadoop.hbase.client.Mutation |
---|
cellScanner, compareTo, extraHeapSize, getClusterIds, getDurability, getFamilyCellMap, getFamilyMap, getFingerprint, getRow, getTimeStamp, getWriteToWAL, heapSize, isEmpty, numFamilies, setClusterIds, setDurability, setFamilyCellMap, setFamilyMap, setWriteToWAL, size |
Methods inherited from class org.apache.hadoop.hbase.client.OperationWithAttributes |
---|
getAttribute, getAttributeSize, getAttributesMap, getId, setAttribute, setId |
Methods inherited from class org.apache.hadoop.hbase.client.Operation |
---|
toJSON, toJSON, toMap, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
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).
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[] rowArray, 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.
rowArray
- We make a local copy of this passed in row.rowOffset
- rowLength
- public Delete(byte[] rowArray, int rowOffset, int rowLength, long ts)
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.
rowArray
- We make a local copy of this passed in row.rowOffset
- rowLength
- ts
- maximum version timestamp (only for delete row)public Delete(Delete d)
d
- Delete to clone.Method Detail |
---|
public Delete addDeleteMarker(Cell kv) throws IOException
kv
- An existing KeyValue of type "delete".
IOException
public Delete deleteFamily(byte[] family)
Overrides previous calls to deleteColumn and deleteColumns for the specified family.
family
- family name
public Delete deleteFamily(byte[] family, long timestamp)
Overrides previous calls to deleteColumn and deleteColumns for the specified family.
family
- family nametimestamp
- maximum version timestamp
public Delete deleteFamilyVersion(byte[] family, long timestamp)
family
- family nametimestamp
- version timestamp
public Delete deleteColumns(byte[] family, byte[] qualifier)
family
- family namequalifier
- column qualifier
public Delete deleteColumns(byte[] family, byte[] qualifier, long timestamp)
family
- family namequalifier
- column qualifiertimestamp
- maximum version timestamp
public Delete deleteColumn(byte[] family, byte[] qualifier)
family
- family namequalifier
- column qualifier
public Delete deleteColumn(byte[] family, byte[] qualifier, long timestamp)
family
- family namequalifier
- column qualifiertimestamp
- version timestamp
public void setTimestamp(long timestamp)
timestamp
- public Map<String,Object> toMap(int maxCols)
Mutation
toMap
in class Mutation
maxCols
- a limit on the number of columns output prior to truncation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |