You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by vj...@apache.org on 2021/03/12 14:31:05 UTC

[phoenix] branch 5.1 updated: PHOENIX-6385 : For non-small Scan, not to use Scan#setSmall for HBase 2.x versions (#1167)

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

vjasani pushed a commit to branch 5.1
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.1 by this push:
     new a897ea1  PHOENIX-6385 : For non-small Scan, not to use Scan#setSmall for HBase 2.x versions (#1167)
a897ea1 is described below

commit a897ea115ccef4f1237d5924a8a116023666fa3d
Author: Viraj Jasani <vj...@apache.org>
AuthorDate: Fri Mar 12 18:55:53 2021 +0530

    PHOENIX-6385 : For non-small Scan, not to use Scan#setSmall for HBase 2.x versions (#1167)
    
    Signed-off-by: Anoop Sam John <an...@apache.org>
---
 phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
index e20d006..45a4ddc 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
@@ -180,12 +180,19 @@ public class ScanUtil {
             newScan.setFamilyMap(clonedMap);
             // Carry over the reversed attribute
             newScan.setReversed(scan.isReversed());
-            newScan.setSmall(scan.isSmall());
+            if (scan.isSmall()) {
+                // HBASE-25644 : Only if Scan#setSmall(boolean) is called with
+                // true, readType should be set PREAD. For non-small scan,
+                // setting setSmall(false) is redundant and degrades perf
+                // without HBASE-25644 fix.
+                newScan.setSmall(true);
+            }
             return newScan;
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
+
     /**
      * Intersects the scan start/stop row with the startKey and stopKey
      * @param scan