After HBASE-20940 any local index query will open all HFiles of every Region involved in the query.
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/96afa0f1 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/96afa0f1 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/96afa0f1 Branch: refs/heads/4.14-cdh5.12 Commit: 96afa0f1e2891a56d980ff36d46dd1d1de01620b Parents: bce6fbb Author: Lars Hofhansl <la...@apache.org> Authored: Mon Sep 24 06:35:38 2018 +0100 Committer: Pedro Boado <pbo...@apache.org> Committed: Wed Oct 17 20:31:32 2018 +0100 ---------------------------------------------------------------------- .../phoenix/iterate/RegionScannerFactory.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/96afa0f1/phoenix-core/src/main/java/org/apache/phoenix/iterate/RegionScannerFactory.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/RegionScannerFactory.java b/phoenix-core/src/main/java/org/apache/phoenix/iterate/RegionScannerFactory.java index aed5805..d81224d 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/RegionScannerFactory.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/RegionScannerFactory.java @@ -37,7 +37,6 @@ import org.apache.phoenix.hbase.index.covered.update.ColumnReference; import org.apache.phoenix.index.IndexMaintainer; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.schema.KeyValueSchema; -import org.apache.phoenix.schema.PTable; import org.apache.phoenix.schema.ValueBitSet; import org.apache.phoenix.schema.tuple.*; import org.apache.phoenix.transaction.PhoenixTransactionContext; @@ -45,7 +44,6 @@ import org.apache.phoenix.util.EncodedColumnsUtil; import org.apache.phoenix.util.IndexUtil; import org.apache.phoenix.util.ScanUtil; import org.apache.phoenix.util.ServerUtil; -import org.apache.tephra.Transaction; import java.io.IOException; import java.util.List; @@ -103,25 +101,10 @@ public abstract class RegionScannerFactory { final ImmutableBytesWritable ptr, final boolean useQualifierAsListIndex) { return new RegionScanner() { - private boolean hasReferences = checkForReferenceFiles(); private HRegionInfo regionInfo = env.getRegionInfo(); private byte[] actualStartKey = getActualStartKey(); private boolean useNewValueColumnQualifier = EncodedColumnsUtil.useNewValueColumnQualifier(scan); - // If there are any reference files after local index region merge some cases we might - // get the records less than scan start row key. This will happen when we replace the - // actual region start key with merge region start key. This method gives whether are - // there any reference files in the region or not. - private boolean checkForReferenceFiles() { - if(!ScanUtil.isLocalIndex(scan)) return false; - for (byte[] family : scan.getFamilies()) { - if (getRegion().getStore(family).hasReferences()) { - return true; - } - } - return false; - } - // Get the actual scan start row of local index. This will be used to compare the row // key of the results less than scan start row when there are references. public byte[] getActualStartKey() { @@ -182,7 +165,7 @@ public abstract class RegionScannerFactory { arrayElementCell = result.get(arrayElementCellPosition); } if (ScanUtil.isLocalIndex(scan) && !ScanUtil.isAnalyzeTable(scan)) { - if(hasReferences && actualStartKey!=null) { + if(actualStartKey!=null) { next = scanTillScanStartRow(s, arrayKVRefs, arrayFuncRefs, result, null, arrayElementCell); if (result.isEmpty()) {