This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 1b5d20dcf654c97e0a8e8938cab3e2c66b9aea8c
Author: SiCheng-Zheng <[email protected]>
AuthorDate: Mon Aug 15 15:19:17 2022 +0800

    HBASE-27301 Add Delete addFamilyVersion  timestamp verify (#4700)
    
    Co-authored-by: SiCheng-Zheng <[email protected]>
    Signed-off-by: Duo Zhang <[email protected]>
    (cherry picked from commit b531e71455423a9f5a5956da90026085dde96117)
---
 hbase-client/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<Cell> list = getCellList(family);
     list.add(new KeyValue(row, family, null, timestamp, 
KeyValue.Type.DeleteFamilyVersion));
     return this;

Reply via email to