diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java index a6ddc14..3d93501 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java @@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.ExtendedCell; import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.IndividualBytesFieldCell; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.PrivateCellUtil; import org.apache.hadoop.hbase.RawCell; @@ -115,10 +116,9 @@ public abstract class Mutation extends OperationWithAttributes implements Row, C this.row = clone.getRow(); this.ts = clone.getTimestamp(); this.familyMap = clone.getFamilyCellMap().entrySet().stream() - .collect(Collectors.toMap(e -> e.getKey(), e -> new ArrayList<>(e.getValue()), - (k, v) -> { - throw new RuntimeException("collisions!!!"); - }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR))); + .collect(Collectors.toMap(e -> e.getKey(), e -> new ArrayList<>(e.getValue()), (k, v) -> { + throw new RuntimeException("collisions!!!"); + }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR))); } /** @@ -788,11 +788,18 @@ public abstract class Mutation extends OperationWithAttributes implements Row, C " doesn't match the original one " + Bytes.toStringBinary(this.row)); } - if (cell.getFamilyArray() == null || cell.getFamilyLength() == 0) { + byte[] family; + + if (cell instanceof IndividualBytesFieldCell) { + family = cell.getFamilyArray(); + } else { + family = CellUtil.cloneFamily(cell); + } + + if (family == null || family.length == 0) { throw new IllegalArgumentException("Family cannot be null"); } - byte[] family = CellUtil.cloneFamily(cell); if (cell instanceof ExtendedCell) { getCellList(family).add(cell); } else { diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 1a4320d..d928dd4 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -232,6 +232,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi "hbase.regionserver.minibatch.size"; public static final int DEFAULT_HBASE_REGIONSERVER_MINIBATCH_SIZE = 20000; + /** * This is the global default value for durability. All tables/mutations not * defining a durability or using USE_DEFAULT will default to this value.