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 #482: PHOENIX-4925 Use Segment tree to organize Guide Post Info
Date Tue, 16 Apr 2019 14:59:20 GMT
BinShi-SecularBird commented on a change in pull request #482: PHOENIX-4925 Use Segment tree
to organize Guide Post Info
URL: https://github.com/apache/phoenix/pull/482#discussion_r275843639
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/schema/stats/DefaultStatisticsCollector.java
 ##########
 @@ -276,11 +273,14 @@ private void writeStatistics(final Region region, boolean delete, List<Mutation>
                     continue;
                 }
                 if (!guidePostsInfoWriterMap.containsKey(cfKey)) {
-                    Pair<Long, GuidePostsInfoBuilder> emptyGps = new Pair<Long,
GuidePostsInfoBuilder>(0l, new GuidePostsInfoBuilder());
+                    Pair<Pair<Long, Long>, GuidePostChunkBuilder> emptyGps =
+                            new Pair<Pair<Long, Long>, GuidePostChunkBuilder>(new
Pair(0l, 0l), new GuidePostChunkBuilder());
                     guidePostsInfoWriterMap.put(cfKey, emptyGps);
                 }
             }
         }
+
+        Set<ImmutableBytesPtr> fams = guidePostsInfoWriterMap.keySet();
 
 Review comment:
   The behavior is the same, after moving the line from 259 to 283. The purpose of movement
is to have more robust code which is independent of the concrete implementation of map.
   
   The original logic is:
   STEP 1. Get the fams key set;
   STEP 2. Discover new entries which are added to the map at lines 280 ~ 281
   STEP 3. The new entries added at step 2 actually will be reflected in fams key set too.
For such entries, the stats deletions (and no stats insertions) will be generated.
   
   I don't like this code -- getting fams key set first, then adding new entries to the map
and the entries automatically reflected in fams key set -- this is non-determistic and depends
on the concrete implementation of map, so I moved the line from 259 to 283 to make the code
more solid.

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