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:32:58 UTC

[phoenix] branch 4.x 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 4.x
in repository https://gitbox.apache.org/repos/asf/phoenix.git


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

commit 5ad6ee7f7aa078f93ee7ce1017b1f6e31012b08a
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 f8df8f9..d0b50bc 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
@@ -179,12 +179,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