phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] dbwong commented on a change in pull request #463: Phoenix stats Initial Commit
Date Fri, 05 Apr 2019 21:30:33 GMT
dbwong commented on a change in pull request #463: Phoenix stats Initial Commit
URL: https://github.com/apache/phoenix/pull/463#discussion_r272749994
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 ##########
 @@ -550,15 +550,48 @@ public BaseResultIterators(QueryPlan plan, Integer perScanLimit, Integer
offset,
         }
         return ranges;
     }
-    
+
+    private List<KeyRange> getRegionRowKeyRanges() throws SQLException {
+        List<HRegionLocation> regionLocations = getRegionBoundaries(scanGrouper); //
Load the region information
+
+        List<KeyRange> regionKeyRanges = Lists.newArrayListWithCapacity(regionLocations.size());
+
+        // Map each HRegionLocation to a KeyRange - no Java 8
+        for (int i = 0; i < regionLocations.size(); i++) {
+            HRegionLocation regionLocation = regionLocations.get(i);
+            HRegionInfo regionInfo = regionLocation.getRegionInfo();
+
+            // Region is lowerInclusive true by definition
+            byte[] startKey = regionInfo.getStartKey();
+            boolean lowerInclusive = true;
+            // The first region has an unbound lower key.
+            if (i == 0) {
+                startKey = KeyRange.UNBOUND;
+                lowerInclusive = false;
+            }
+
+            // Region is upperInclusive false by definition
+            byte[] endKey = regionInfo.getEndKey();
+            // The last region has an unbound upper key.
+            if (i == regionLocations.size() - 1) {
+                endKey = KeyRange.UNBOUND;
+            }
+
+            KeyRange range = KeyRange.getKeyRange(startKey, lowerInclusive, regionInfo.getEndKey(),
false);
 
 Review comment:
   Good catch actually.  endKey is correct a typo.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message