From 615ceea25868549dafaa12173efe7da951ee660b Mon Sep 17 00:00:00 2001 From: no_apologies Date: Sat, 5 Aug 2017 23:19:38 +0800 Subject: [PATCH] Introduce Delete.add as a replacement for Delete#addDeleteMarker --- .../main/java/org/apache/hadoop/hbase/client/Delete.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 351d8a6..39a68fa 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 @@ -156,10 +156,22 @@ public class Delete extends Mutation implements Comparable { * @param kv An existing KeyValue of type "delete". * @return this for invocation chaining * @throws IOException + * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. + * Use {@link #add(Cell)} instead */ @SuppressWarnings("unchecked") + @Deprecated public Delete addDeleteMarker(Cell kv) throws IOException { - // TODO: Deprecate and rename 'add' so it matches how we add KVs to Puts. + return this.add(kv); + } + + /** + * Add an existing delete marker to this Delete object. + * @param kv An existing KeyValue of type "delete". + * @return this for invocation chaining + * @throws IOException + */ + public Delete add(Cell kv) throws IOException { if (!CellUtil.isDelete(kv)) { throw new IOException("The recently added KeyValue is not of type " + "delete. Rowkey: " + Bytes.toStringBinary(this.row)); @@ -178,7 +190,6 @@ public class Delete extends Mutation implements Comparable { return this; } - /** * Delete all versions of all columns of the specified family. *

-- 2.10.1