From 5addaa96f562b2e6cf13e9fe19fb922a415f2671 Mon Sep 17 00:00:00 2001 From: Reid Chan Date: Sat, 12 Aug 2017 18:43:55 +0800 Subject: [PATCH] HBASE-18554 Append#add doesn't check the row of passed cell --- .../src/main/java/org/apache/hadoop/hbase/client/Append.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java index 2bd08608f3..884645d780 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java @@ -130,9 +130,12 @@ public class Append extends Mutation { * @param cell * @return This instance */ - @SuppressWarnings("unchecked") public Append add(final Cell cell) { // Presume it is KeyValue for now. + if (!Bytes.equals(this.row, CellUtil.cloneRow(cell))) { + // If not the same row, just ignore it and return. + return this; + } byte [] family = CellUtil.cloneFamily(cell); List list = this.familyMap.get(family); if (list == null) { -- 2.11.0 (Apple Git-81)