From 87f1af842ab1a5e8242b446e45f5b7e14604a349 Mon Sep 17 00:00:00 2001 From: tedyu Date: Fri, 25 Mar 2016 19:05:15 -0700 Subject: [PATCH] HBASE-15496 Throw RowTooBigException only for user scan/get (Guanghao Zhang) --- .../apache/hadoop/hbase/regionserver/ScanQueryMatcher.java | 4 ++++ .../org/apache/hadoop/hbase/regionserver/StoreScanner.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java index c832255aeb6..2ee9ee131ce 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanQueryMatcher.java @@ -622,6 +622,10 @@ public class ScanQueryMatcher { } } + boolean isUserScan() { + return this.isUserScan; + } + //Used only for testing purposes static MatchCode checkColumn(ColumnTracker columnTracker, byte[] bytes, int offset, int length, long ttl, byte type, boolean ignoreCount) throws IOException { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java index ddf0721d652..bfa83359616 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java @@ -347,7 +347,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner if (!isParallelSeek) { long totalScannersSoughtBytes = 0; for (KeyValueScanner scanner : scanners) { - if (totalScannersSoughtBytes >= maxRowSize) { + if (matcher.isUserScan() && totalScannersSoughtBytes >= maxRowSize) { throw new RowTooBigException("Max row size allowed: " + maxRowSize + ", but row is bigger than that"); } @@ -557,7 +557,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner scannerContext.incrementSizeProgress(CellUtil.estimatedHeapSizeOfWithoutTags(cell)); scannerContext.incrementBatchProgress(1); - if (totalBytesRead > maxRowSize) { + if (matcher.isUserScan() && totalBytesRead > maxRowSize) { throw new RowTooBigException("Max row size allowed: " + maxRowSize + ", but the row is bigger than that."); }