phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] BinShi-SecularBird commented on a change in pull request #463: Phoenix stats Initial Commit
Date Fri, 15 Mar 2019 02:20:06 GMT
BinShi-SecularBird commented on a change in pull request #463: Phoenix stats Initial Commit
URL: https://github.com/apache/phoenix/pull/463#discussion_r265829876
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 ##########
 @@ -550,6 +550,76 @@ 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.newArrayListWithExpectedSize(regionLocations.size());
+
+        //Map each HRegionLocation to a KeyRange - no Java 8
+        for(HRegionLocation regionLocation : regionLocations){
+            HRegionInfo regionInfo = regionLocation.getRegionInfo();
+
+            //Region is upperInclusive false by definition
+            KeyRange range = KeyRange.getKeyRange(regionInfo.getStartKey(), true, regionInfo.getEndKey(),
false);
+            regionKeyRanges.add(range);
+        }
+        return regionKeyRanges;
+    }
+
+    List<List<KeyRange>> getQueryRowKeyRanges(List<KeyRange> regionKeyRanges)
{
+        ScanRanges scanRanges = context.getScanRanges();
+
+        RowKeySchema schema = scanRanges.getSchema();
+
+        PTable table = getTable();
+        boolean isLocalIndex = table.getIndexType() == IndexType.LOCAL;
+
+        //Use the dataplan to build the queryRowKeyRanges
+        if (isLocalIndex) {
+            // should always have a data plan when a local index is being used.
+            if (dataPlan != null && dataPlan.getTableRef().getTable().getType()
+                    != PTableType.INDEX) { // Sanity check
+                scanRanges =
+                        computePrefixScanRanges(dataPlan.getContext().getScanRanges(),
+                                computeColumnsInCommon());
 
 Review comment:
   I prefer the following coding style which seems to be used by phoenix code base generally.
   
    <type >scanRanges = computePrefixScanRanges(
                 dataPlan.getContext().getScanRanges(), computeColumnsInCommon());
   
   Did you follow the following instructions on https://phoenix.apache.org/develop.html to
set phoenix coding style.
   Get Settings and Preferences Correct
   Import Settings from eclipse profile
   File -> Settings -> Editor -> Code Style -> Java
   Set From… -> Import… -> Eclipse XML Profile -> {repository}/dev/PhoenixCodeTemplate.xml
   
   

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