From 0ceb3577fcdb093f9d245b6f9babf154fc7d3aa1 Mon Sep 17 00:00:00 2001 From: SiCheng-Zheng <643463623@qq.com> Date: Mon, 15 Aug 2022 15:19:17 +0800 Subject: [PATCH] HBASE-27301 Add Delete addFamilyVersion timestamp verify (#4700) Co-authored-by: SiCheng-Zheng Signed-off-by: Duo Zhang (cherry picked from commit b531e71455423a9f5a5956da90026085dde96117) --- .../src/main/java/org/apache/hadoop/hbase/client/Delete.java | 3 +++ 1 file changed, 3 insertions(+) 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 66716bea9cc..4b500b09d6e 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 @@ -200,6 +200,9 @@ public class Delete extends Mutation { * @return this for invocation chaining */ public Delete addFamilyVersion(final byte[] family, final long timestamp) { + if (timestamp < 0) { + throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + timestamp); + } List list = getCellList(family); list.add(new KeyValue(row, family, null, timestamp, KeyValue.Type.DeleteFamilyVersion)); return this;