diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
index ad7d89e..ea76d0d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java
@@ -43,15 +43,15 @@ import org.apache.hadoop.hbase.util.Bytes;
* to delete. To further define the scope of what to delete, perform
* additional methods as outlined below.
*
- * To delete specific families, execute {@link #deleteFamily(byte[]) deleteFamily}
+ * To delete specific families, execute {@link #addFamily(byte[]) deleteFamily}
* for each family to delete.
*
* To delete multiple versions of specific columns, execute
- * {@link #deleteColumns(byte[], byte[]) deleteColumns}
+ * {@link #addColumns(byte[], byte[]) deleteColumns}
* for each column to delete.
*
* To delete specific versions of specific columns, execute
- * {@link #deleteColumn(byte[], byte[], long) deleteColumn}
+ * {@link #addColumn(byte[], byte[], long) deleteColumn}
* for each column version to delete.
*
* Specifying timestamps, deleteFamily and deleteColumns will delete all
@@ -185,8 +185,22 @@ public class Delete extends Mutation implements Comparable {
* specified family.
* @param family family name
* @return this for invocation chaining
+ * @deprecated Since 1.0.0. Use {@link #addFamily(byte[])}
*/
+ @Deprecated
public Delete deleteFamily(byte [] family) {
+ return addFamily(family);
+ }
+
+ /**
+ * Delete all versions of all columns of the specified family.
+ *
+ * Overrides previous calls to deleteColumn and deleteColumns for the
+ * specified family.
+ * @param family family name
+ * @return this for invocation chaining
+ */
+ public Delete addFamily(final byte [] family) {
this.deleteFamily(family, this.ts);
return this;
}
@@ -200,9 +214,24 @@ public class Delete extends Mutation implements Comparable {
* @param family family name
* @param timestamp maximum version timestamp
* @return this for invocation chaining
+ * @deprecated Since 1.0.0. Use {@link #addFamily(byte[], long)}
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public Delete deleteFamily(byte [] family, long timestamp) {
+ return addFamily(family, timestamp);
+ }
+
+ /**
+ * Delete 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.
+ * @param family family name
+ * @param timestamp maximum version timestamp
+ * @return this for invocation chaining
+ */
+ public Delete addFamily(final byte [] family, final long timestamp) {
if (timestamp < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + timestamp);
}
@@ -226,6 +255,19 @@ public class Delete extends Mutation implements Comparable {
* @return this for invocation chaining
*/
public Delete deleteFamilyVersion(byte [] family, long timestamp) {
+ return addFamilyVersion(family, timestamp);
+ }
+
+ /**
+ * Delete all columns of the specified family with a timestamp equal to
+ * the specified timestamp.
+ * @param family family name
+ * @param timestamp version timestamp
+ * @return this for invocation chaining
+ * @deprecated Since hbase-1.0.0. Use {@link #addFamilyVersion(byte[], long)}
+ */
+ @Deprecated
+ public Delete addFamilyVersion(final byte [] family, final long timestamp) {
List list = familyMap.get(family);
if(list == null) {
list = new ArrayList();
@@ -236,15 +278,26 @@ public class Delete extends Mutation implements Comparable {
return this;
}
-
/**
* Delete all versions of the specified column.
* @param family family name
* @param qualifier column qualifier
* @return this for invocation chaining
+ * @deprecated Since hbase-1.0.0. Use {@link #addColumns(byte[], byte[])}
*/
+ @Deprecated
public Delete deleteColumns(byte [] family, byte [] qualifier) {
- this.deleteColumns(family, qualifier, this.ts);
+ return addColumns(family, qualifier);
+ }
+
+ /**
+ * Delete all versions of the specified column.
+ * @param family family name
+ * @param qualifier column qualifier
+ * @return this for invocation chaining
+ */
+ public Delete addColumns(final byte [] family, final byte [] qualifier) {
+ addColumns(family, qualifier, this.ts);
return this;
}
@@ -255,9 +308,22 @@ public class Delete extends Mutation implements Comparable {
* @param qualifier column qualifier
* @param timestamp maximum version timestamp
* @return this for invocation chaining
+ * @deprecated Since hbase-1.0.0. Use {@link #addColumns(byte[], byte[], long)}
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public Delete deleteColumns(byte [] family, byte [] qualifier, long timestamp) {
+ return addColumns(family, qualifier, timestamp);
+ }
+
+ /**
+ * Delete all versions of the specified column with a timestamp less than
+ * or equal to the specified timestamp.
+ * @param family family name
+ * @param qualifier column qualifier
+ * @param timestamp maximum version timestamp
+ * @return this for invocation chaining
+ */
+ public Delete addColumns(final byte [] family, final byte [] qualifier, final long timestamp) {
if (timestamp < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + timestamp);
}
@@ -279,8 +345,23 @@ public class Delete extends Mutation implements Comparable {
* @param family family name
* @param qualifier column qualifier
* @return this for invocation chaining
+ * @deprecated Since hbase-1.0.0. Use {@link #addColumn(byte[], byte[])}
*/
+ @Deprecated
public Delete deleteColumn(byte [] family, byte [] qualifier) {
+ return addColumn(family, qualifier);
+ }
+
+ /**
+ * Delete 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.
+ * @param family family name
+ * @param qualifier column qualifier
+ * @return this for invocation chaining
+ */
+ public Delete addColumn(final byte [] family, final byte [] qualifier) {
this.deleteColumn(family, qualifier, this.ts);
return this;
}
@@ -291,9 +372,21 @@ public class Delete extends Mutation implements Comparable {
* @param qualifier column qualifier
* @param timestamp version timestamp
* @return this for invocation chaining
+ * @deprecated Since hbase-1.0.0. Use {@link #addColumn(byte[], byte[], long)}
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public Delete deleteColumn(byte [] family, byte [] qualifier, long timestamp) {
+ return addColumn(family, qualifier, timestamp);
+ }
+
+ /**
+ * Delete the specified version of the specified column.
+ * @param family family name
+ * @param qualifier column qualifier
+ * @param timestamp version timestamp
+ * @return this for invocation chaining
+ */
+ public Delete addColumn(byte [] family, byte [] qualifier, long timestamp) {
if (timestamp < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + timestamp);
}
| |