You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2019/04/04 17:42:37 UTC

[GitHub] [phoenix] karanmehta93 commented on a change in pull request #463: Phoenix stats Initial Commit

karanmehta93 commented on a change in pull request #463: Phoenix stats Initial Commit
URL: https://github.com/apache/phoenix/pull/463#discussion_r272291837
 
 

 ##########
 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:
   `regionInfo.getEndKey()` or `endKey`?
   

----------------------------------------------------------------
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