Class Delete
- All Implemented Interfaces:
- Comparable<Row>,- CellScannable,- Attributes,- Row,- HeapSize
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 EnvironmentEdgeManager.currentTime(). 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 SummaryFields inherited from class org.apache.hadoop.hbase.client.Mutationdurability, familyMap, MUTATION_OVERHEAD, row, tsFields inherited from class org.apache.hadoop.hbase.client.OperationWithAttributesID_ATRIBUTEFields inherited from interface org.apache.hadoop.hbase.client.RowCOMPARATOR
- 
Constructor SummaryConstructorsConstructorDescriptionDelete(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.Create a Delete operation using another Delete as template.
- 
Method SummaryModifier and TypeMethodDescriptionAdd an existing delete marker to this Delete object.addColumn(byte[] family, byte[] qualifier) Delete the latest version of the specified column.addColumn(byte[] family, byte[] qualifier, long timestamp) Delete the specified version of the specified column.addColumns(byte[] family, byte[] qualifier) Delete all versions of the specified column.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.addDeleteMarker(Cell kv) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.addFamily(byte[] family) Delete all versions of all columns of the specified family.addFamily(byte[] family, long timestamp) Delete all columns of the specified family with a timestamp less than or equal to the specified timestamp.addFamilyVersion(byte[] family, long timestamp) Delete all columns of the specified family with a timestamp equal to the specified timestamp.setACL(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 mutationsetFamilyCellMap(NavigableMap<byte[], List<Cell>> map) Deprecated.As of release 2.0.0, this will be removed in HBase 3.0.0.This method allows you to set an identifier on an operation.setPriority(int priority) 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.MutationcellScanner, 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, toMapMethods inherited from class org.apache.hadoop.hbase.client.OperationWithAttributesgetAttribute, getAttributeSize, getAttributesMap, getId, getPriority
- 
Constructor Details- 
DeleteCreate a Delete operation for the specified 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. - Parameters:
- row- row key
 
- 
DeleteCreate a Delete operation for the specified row and 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. - Parameters:
- row- row key
- timestamp- maximum version timestamp (only for delete row)
 
- 
DeleteCreate a Delete operation for the specified row and 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. - Parameters:
- row- We make a local copy of this passed in row.
 
- 
DeleteCreate a Delete operation for the specified row and 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. 
- 
DeleteCreate a Delete operation using another Delete as template.- Parameters:
- deleteToCopy- delete to copy
 
 
- 
- 
Method Details- 
addDeleteMarkerDeprecated.As of release 2.0.0, this will be removed in HBase 3.0.0. Useadd(Cell)insteadAdvanced use only. Add an existing delete marker to this Delete object.- Parameters:
- kv- An existing KeyValue of type "delete".
- Returns:
- this for invocation chaining
- Throws:
- IOException
 
- 
addAdd an existing delete marker to this Delete object.- Overrides:
- addin class- Mutation
- Parameters:
- cell- An existing cell of type "delete".
- Returns:
- this for invocation chaining
- Throws:
- IOException
 
- 
addFamilyDelete all versions of all columns of the specified family.Overrides previous calls to deleteColumn and deleteColumns for the specified family. - Parameters:
- family- family name
- Returns:
- this for invocation chaining
 
- 
addFamilyDelete all columns of the specified family with a timestamp less than or equal to the specified timestamp.Overrides previous calls to deleteColumn and deleteColumns for the specified family. - Parameters:
- family- family name
- timestamp- maximum version timestamp
- Returns:
- this for invocation chaining
 
- 
addFamilyVersionDelete all columns of the specified family with a timestamp equal to the specified timestamp.- Parameters:
- family- family name
- timestamp- version timestamp
- Returns:
- this for invocation chaining
 
- 
addColumnsDelete all versions of the specified column.- Parameters:
- family- family name
- qualifier- column qualifier
- Returns:
- this for invocation chaining
 
- 
addColumnsDelete all versions of the specified column with a timestamp less than or equal to the specified timestamp.- Parameters:
- family- family name
- qualifier- column qualifier
- timestamp- maximum version timestamp
- Returns:
- this for invocation chaining
 
- 
addColumnDelete the latest version of the specified column. This is an expensive call in that on the server-side, it first does a get to find the latest versions timestamp. Then it adds a delete using the fetched cells timestamp.- Parameters:
- family- family name
- qualifier- column qualifier
- Returns:
- this for invocation chaining
 
- 
addColumnDelete the specified version of the specified column.- Parameters:
- family- family name
- qualifier- column qualifier
- timestamp- version timestamp
- Returns:
- this for invocation chaining
 
- 
setTimestampDescription copied from class:MutationSet the timestamp of the delete.- Overrides:
- setTimestampin class- Mutation
 
- 
setAttributeDescription copied from interface:AttributesSets an attribute. In case value = null attribute is removed from the attributes map. Attribute names starting with _ indicate system attributes.- Specified by:
- setAttributein interface- Attributes
- Overrides:
- setAttributein class- OperationWithAttributes
- Parameters:
- name- attribute name
- value- attribute value
 
- 
setIdDescription copied from class:OperationWithAttributesThis 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:
- setIdin class- OperationWithAttributes
 
- 
setDurabilityDescription copied from class:MutationSet the durability for this mutation- Overrides:
- setDurabilityin class- Mutation
 
- 
setClusterIdsDescription copied from class:MutationMarks that the clusters with the given clusterIds have consumed the mutation- Overrides:
- setClusterIdsin class- Mutation
- Parameters:
- clusterIds- of the clusters that have consumed the mutation
 
- 
setCellVisibilityDescription copied from class:MutationSets the visibility expression associated with cells in this Mutation.- Overrides:
- setCellVisibilityin class- Mutation
 
- 
setACLDescription copied from class:MutationSet the ACL for this operation.
- 
setACLDescription copied from class:MutationSet the ACL for this operation.
- 
setTTLDescription copied from class:MutationSet the TTL desired for the result of the mutation, in milliseconds.
- 
setPriority- Overrides:
- setPriorityin class- OperationWithAttributes
 
 
-