org.hbase.async
Class DeleteRequest

java.lang.Object
  extended by org.hbase.async.HBaseRpc
      extended by org.hbase.async.DeleteRequest
All Implemented Interfaces:
HBaseRpc.HasFamily, HBaseRpc.HasKey, HBaseRpc.HasQualifiers, HBaseRpc.HasTable, HBaseRpc.HasTimestamp

public final class DeleteRequest
extends HBaseRpc
implements HBaseRpc.HasTable, HBaseRpc.HasKey, HBaseRpc.HasFamily, HBaseRpc.HasQualifiers

Deletes some data into HBase.

A note on passing byte arrays in argument

None of the method that receive a byte[] in argument will copy it. For more info, please refer to the documentation of HBaseRpc.

A note on passing Strings in argument

All strings are assumed to use the platform's default charset.

A note on passing timestamps in argument

Irrespective of the order in which you send RPCs, a DeleteRequest that is created with a specific timestamp in argument will only delete values in HBase that were previously stored with a timestamp less than or equal to that of the DeleteRequest.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.hbase.async.HBaseRpc
HBaseRpc.HasFamily, HBaseRpc.HasKey, HBaseRpc.HasQualifier, HBaseRpc.HasQualifiers, HBaseRpc.HasTable, HBaseRpc.HasTimestamp, HBaseRpc.HasValue, HBaseRpc.HasValues
 
Constructor Summary
DeleteRequest(byte[] table, byte[] key)
          Constructor to delete an entire row.
DeleteRequest(byte[] table, byte[] key, byte[] family)
          Constructor to delete a specific family.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[] qualifier)
          Constructor to delete a specific cell.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[][] qualifiers)
          Constructor to delete a specific number of cells in a row.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[][] qualifiers, long timestamp)
          Constructor to delete a specific number of cells in a row.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[][] qualifiers, long timestamp, RowLock lock)
          Constructor to delete a specific number of cells in a row with a row lock.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[][] qualifiers, RowLock lock)
          Constructor to delete a specific number of cells in a row.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[] qualifier, long timestamp)
          Constructor to delete a specific cell before a specific timestamp.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[] qualifier, long timestamp, RowLock lock)
          Constructor to delete a specific cell with an explicit row lock.
DeleteRequest(byte[] table, byte[] key, byte[] family, byte[] qualifier, RowLock lock)
          Constructor to delete a specific cell with an explicit row lock.
DeleteRequest(byte[] table, byte[] key, byte[] family, long timestamp)
          Constructor to delete a specific family before a specific timestamp.
DeleteRequest(byte[] table, byte[] key, long timestamp)
          Constructor to delete an entire row before a specific timestamp.
DeleteRequest(byte[] table, KeyValue kv)
          Constructor to delete a specific cell.
DeleteRequest(byte[] table, KeyValue kv, RowLock lock)
          Constructor to delete a specific cell with an explicit row lock.
DeleteRequest(String table, String key)
          Constructor to delete an entire row.
DeleteRequest(String table, String key, String family)
          Constructor to delete a specific family.
DeleteRequest(String table, String key, String family, String qualifier)
          Constructor to delete a specific cell.
DeleteRequest(String table, String key, String family, String qualifier, RowLock lock)
          Constructor to delete a specific cell with an explicit row lock.
 
Method Summary
 byte[] family()
          Returns the family this RPC is for.
 byte[] key()
          Returns the row key this RPC is for.
 byte[][] qualifiers()
          Returns the column qualifiers this RPC is for.
 void setBufferable(boolean bufferable)
          Sets whether or not this RPC is can be buffered on the client side.
 void setDurable(boolean durable)
          Changes the durability setting of this edit.
 byte[] table()
          Returns the name of the table this RPC is for.
 long timestamp()
          Returns the strictly positive timestamp contained in this RPC.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hbase.async.HBaseRpc.HasFamily
family
 

Constructor Detail

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key)
Constructor to delete an entire row. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
Throws:
IllegalArgumentException - if any argument is malformed.

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     long timestamp)
Constructor to delete an entire row before a specific timestamp. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
timestamp - The timestamp to set on this edit.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.2

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family)
Constructor to delete a specific family. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.1

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     long timestamp)
Constructor to delete a specific family before a specific timestamp. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
timestamp - The timestamp to set on this edit.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.2

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[] qualifier)
Constructor to delete a specific cell. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifier - The column qualifier to delete in that family. Can be null since version 1.1.
Throws:
IllegalArgumentException - if any argument is malformed.

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[] qualifier,
                     long timestamp)
Constructor to delete a specific cell before a specific timestamp. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifier - The column qualifier to delete in that family. Can be null, to delete the whole family.
timestamp - The timestamp to set on this edit.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.2

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[][] qualifiers)
Constructor to delete a specific number of cells in a row. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifiers - The column qualifiers to delete in that family.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.1

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[][] qualifiers,
                     long timestamp)
Constructor to delete a specific number of cells in a row. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifiers - The column qualifiers to delete in that family.
timestamp - The timestamp to set on this edit.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.2

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[] qualifier,
                     RowLock lock)
Constructor to delete a specific cell with an explicit row lock. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifier - The column qualifier to delete in that family.
lock - An explicit row lock to use with this request.
Throws:
IllegalArgumentException - if any argument is malformed.

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[] qualifier,
                     long timestamp,
                     RowLock lock)
Constructor to delete a specific cell with an explicit row lock. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifier - The column qualifier to delete in that family.
timestamp - The timestamp to set on this edit.
lock - An explicit row lock to use with this request.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.2

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[][] qualifiers,
                     RowLock lock)
Constructor to delete a specific number of cells in a row. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifiers - The column qualifiers to delete in that family. Can be null.
lock - An explicit row lock to use with this request.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.1

DeleteRequest

public DeleteRequest(byte[] table,
                     byte[] key,
                     byte[] family,
                     byte[][] qualifiers,
                     long timestamp,
                     RowLock lock)
Constructor to delete a specific number of cells in a row with a row lock. These byte arrays will NOT be copied.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifiers - The column qualifiers to delete in that family. Can be null.
timestamp - The timestamp to set on this edit.
lock - An explicit row lock to use with this request.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.2

DeleteRequest

public DeleteRequest(String table,
                     String key)
Constructor to delete an entire row.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
Throws:
IllegalArgumentException - if any argument is malformed.

DeleteRequest

public DeleteRequest(String table,
                     String key,
                     String family)
Constructor to delete a specific family.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
Throws:
IllegalArgumentException - if any argument is malformed.
Since:
1.1

DeleteRequest

public DeleteRequest(String table,
                     String key,
                     String family,
                     String qualifier)
Constructor to delete a specific cell.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifier - The column qualifier to delete in that family. Can be null since version 1.1.
Throws:
IllegalArgumentException - if any argument is malformed.

DeleteRequest

public DeleteRequest(String table,
                     String key,
                     String family,
                     String qualifier,
                     RowLock lock)
Constructor to delete a specific cell with an explicit row lock.

Parameters:
table - The table to edit.
key - The key of the row to edit in that table.
family - The column family to edit in that table.
qualifier - The column qualifier to delete in that family. Can be null since version 1.1.
lock - An explicit row lock to use with this request.
Throws:
IllegalArgumentException - if any argument is malformed.

DeleteRequest

public DeleteRequest(byte[] table,
                     KeyValue kv)
Constructor to delete a specific cell.

Parameters:
table - The table to edit.
kv - The specific KeyValue to delete. Note that if this KeyValue specifies a timestamp, then this specific timestamp only will be deleted.
Since:
1.2

DeleteRequest

public DeleteRequest(byte[] table,
                     KeyValue kv,
                     RowLock lock)
Constructor to delete a specific cell with an explicit row lock.

Parameters:
table - The table to edit.
kv - The specific KeyValue to delete. Note that if this KeyValue specifies a timestamp, then this specific timestamp only will be deleted.
lock - An explicit row lock to use with this request.
Since:
1.2
Method Detail

table

public byte[] table()
Description copied from interface: HBaseRpc.HasTable
Returns the name of the table this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
table in interface HBaseRpc.HasTable

key

public byte[] key()
Description copied from interface: HBaseRpc.HasKey
Returns the row key this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
key in interface HBaseRpc.HasKey

qualifiers

public byte[][] qualifiers()
Description copied from interface: HBaseRpc.HasQualifiers
Returns the column qualifiers this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
qualifiers in interface HBaseRpc.HasQualifiers

toString

public String toString()
Overrides:
toString in class HBaseRpc

setBufferable

public final void setBufferable(boolean bufferable)
Sets whether or not this RPC is can be buffered on the client side. The default is true.

Setting this to false bypasses the client-side buffering, which is used to send RPCs in batches for greater throughput, and causes this RPC to be sent directly to the server.

Parameters:
bufferable - Whether or not this RPC can be buffered (i.e. delayed) before being sent out to HBase.
See Also:
HBaseClient.setFlushInterval(short)

setDurable

public final void setDurable(boolean durable)
Changes the durability setting of this edit. The default is true. Make sure you've read and understood the data durability section before setting this to false.

Parameters:
durable - Whether or not this edit should be stored with data durability guarantee.

family

public final byte[] family()
Description copied from interface: HBaseRpc.HasFamily
Returns the family this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
family in interface HBaseRpc.HasFamily

timestamp

public final long timestamp()
Description copied from interface: HBaseRpc.HasTimestamp
Returns the strictly positive timestamp contained in this RPC.

Specified by:
timestamp in interface HBaseRpc.HasTimestamp