[ 
https://issues.apache.org/jira/browse/PHOENIX-1453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14259203#comment-14259203
 ] 

James Taylor commented on PHOENIX-1453:
---------------------------------------

One more minor nit. In StatisticsUtil, you can save an extra map lookup by 
doing the put into the map up front, and then calling combine only if there was 
an old value there (like the old code):
{code}
+            if (cfName != null) {
+                GuidePostsRegionInfo newGPRegionInfo = 
GuidePostsRegionInfo.fromBytes(valuePtr.get(),
+                        valuePtr.getOffset(), valuePtr.getLength());
+                newGPRegionInfo.addRowCount(rowCount);
+                // TODO: do a put here instead and then conditionally do a 
combine with the old value
+                GuidePostsInfo guidePostsInfo = guidePostsPerCf.get(cfName);
+                if (guidePostsInfo == null) {
+                    guidePostsPerCf.put(cfName, new GuidePostsInfo(new long[] 
{ newGPRegionInfo.getByteCount() },
+                            newGPRegionInfo.getGuidePosts(), new long[] { 
newGPRegionInfo.getRowCount() }));
+                } else {
+                    guidePostsInfo.combine(newGPRegionInfo);
+                }
+            }
{code}

> Collect row counts per region in stats table
> --------------------------------------------
>
>                 Key: PHOENIX-1453
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1453
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: ramkrishna.s.vasudevan
>         Attachments: Phoenix-1453.patch, Phoenix-1453_1.patch, 
> Phoenix-1453_10.patch, Phoenix-1453_2.patch, Phoenix-1453_3.patch, 
> Phoenix-1453_7.patch, Phoenix-1453_8.patch
>
>
> We currently collect guideposts per equal chunk, but we should also capture 
> row counts. Should we have a parallel array with the guideposts that count 
> rows per guidepost, or is it enough to have a per region count?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to