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 string
| 49 | * value at the specified timestamp is deleted. |
| 50 | */ |
| 51 | public final class DeleteRequest extends BatchableRpc |
| 52 | implements HBaseRpc.HasTable, HBaseRpc.HasKey, |
| 53 | HBaseRpc.HasFamily, HBaseRpc.HasQualifiers, HBaseRpc.IsEdit { |
| 54 | |
| 55 | private static final byte[] DELETE = new byte[] { |
| 56 | 'd', 'e', 'l', 'e', 't', 'e' |
| 57 | }; |
| 58 | |
| 59 | /** Code type used for serialized `Delete' objects. */ |
| 60 | static final byte CODE = 31; |
| 61 | |
| 62 | /** Special value for {@link #qualifiers} when deleting a whole family. */ |
| 63 | private static final byte[][] DELETE_FAMILY_MARKER = |
| 64 | new byte[][] { HBaseClient.EMPTY_ARRAY }; |
| 65 | |
| 66 | /** Special value for {@link #family} when deleting a whole row. */ |
| 67 | static final byte[] WHOLE_ROW = new byte[0]; |
| 68 | |
| 69 | private final byte[][] qualifiers; |
| 70 | |
| 71 | /** Whether to delete the value only at the specified timestamp. */ |
| 72 | private boolean at_timestamp_only = false; |
| 73 | |
| 74 | /** |
| 75 | * Constructor to delete an entire row. |
| 76 | * <strong>These byte arrays will NOT be copied.</strong> |
| 77 | * @param table The table to edit. |
| 78 | * @param key The key of the row to edit in that table. |
| 79 | * @throws IllegalArgumentException if any argument is malformed. |
| 80 | */ |
| 81 | public DeleteRequest(final byte[] table, final byte[] key) { |
| 82 | this(table, key, null, null, KeyValue.TIMESTAMP_NOW, RowLock.NO_LOCK); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Constructor to delete an entire row before a specific timestamp. |
| 87 | * <strong>These byte arrays will NOT be copied.</strong> |
| 88 | * @param table The table to edit. |
| 89 | * @param key The key of the row to edit in that table. |
| 90 | * @param timestamp The timestamp to set on this edit. |
| 91 | * @throws IllegalArgumentException if any argument is malformed. |
| 92 | * @since 1.2 |
| 93 | */ |
| 94 | public DeleteRequest(final byte[] table, final byte[] key, |
| 95 | final long timestamp) { |
| 96 | this(table, key, null, null, timestamp, RowLock.NO_LOCK); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Constructor to delete a specific family. |
| 101 | * <strong>These byte arrays will NOT be copied.</strong> |
| 102 | * @param table The table to edit. |
| 103 | * @param key The key of the row to edit in that table. |
| 104 | * @param family The column family to edit in that table. |
| 105 | * @throws IllegalArgumentException if any argument is malformed. |
| 106 | * @since 1.1 |
| 107 | */ |
| 108 | public DeleteRequest(final byte[] table, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…