HBASE-27301 Add Delete addFamilyVersion timestamp verify (#4700)

Co-authored-by: SiCheng-Zheng <zhengsicheng@jd.com>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit b531e71455)
This commit is contained in:
SiCheng-Zheng 2022-08-15 15:19:17 +08:00 committed by Duo Zhang
parent da472aac06
commit 0ceb3577fc
1 changed files with 3 additions and 0 deletions

View File

@ -200,6 +200,9 @@ public class Delete extends Mutation {
* @return this for invocation chaining * @return this for invocation chaining
*/ */
public Delete addFamilyVersion(final byte[] family, final long timestamp) { 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<Cell> list = getCellList(family);
list.add(new KeyValue(row, family, null, timestamp, KeyValue.Type.DeleteFamilyVersion)); list.add(new KeyValue(row, family, null, timestamp, KeyValue.Type.DeleteFamilyVersion));
return this; return this;