You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by sn...@apache.org on 2020/05/20 02:39:18 UTC

[incubator-pinot] branch hotfix-hashmap-init created (now 2601c01)

This is an automated email from the ASF dual-hosted git repository.

snlee pushed a change to branch hotfix-hashmap-init
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at 2601c01  Reverting the change from #5291

This branch includes the following new commits:

     new 2601c01  Reverting the change from #5291

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[incubator-pinot] 01/01: Reverting the change from #5291

Posted by sn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

snlee pushed a commit to branch hotfix-hashmap-init
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 2601c01ca1174fb9f178077941512c1f06b6eef2
Author: Seunghyun Lee <sn...@linkedin.com>
AuthorDate: Tue May 19 19:12:06 2020 -0700

    Reverting the change from #5291
    
    For the use cases with high qps with low selectivity queries,
    initializing the hashmap with the size of the upperbound incurred
    more penalty as opposed to improving performance by reducing
    the number of hashmap resizes.
---
 .../groupby/DictionaryBasedGroupKeyGenerator.java   | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
index e2da862..fc0e55b 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
@@ -109,15 +109,15 @@ public class DictionaryBasedGroupKeyGenerator implements GroupKeyGenerator {
 
     if (longOverflow) {
       _globalGroupIdUpperBound = numGroupsLimit;
-      _rawKeyHolder = new ArrayMapBasedHolder(_globalGroupIdUpperBound);
+      _rawKeyHolder = new ArrayMapBasedHolder();
     } else {
       if (cardinalityProduct > Integer.MAX_VALUE) {
         _globalGroupIdUpperBound = numGroupsLimit;
-        _rawKeyHolder = new LongMapBasedHolder(_globalGroupIdUpperBound);
+        _rawKeyHolder = new LongMapBasedHolder();
       } else {
         _globalGroupIdUpperBound = Math.min((int) cardinalityProduct, numGroupsLimit);
         if (cardinalityProduct > arrayBasedThreshold) {
-          _rawKeyHolder = new IntMapBasedHolder(_globalGroupIdUpperBound);
+          _rawKeyHolder = new IntMapBasedHolder();
         } else {
           _rawKeyHolder = new ArrayBasedHolder();
         }
@@ -259,12 +259,11 @@ public class DictionaryBasedGroupKeyGenerator implements GroupKeyGenerator {
   }
 
   private class IntMapBasedHolder implements RawKeyHolder {
-    private final Int2IntOpenHashMap _rawKeyToGroupIdMap;
+    private final Int2IntOpenHashMap _rawKeyToGroupIdMap = new Int2IntOpenHashMap();
 
     private int _numGroups = 0;
 
-    public IntMapBasedHolder(int initialSize) {
-      _rawKeyToGroupIdMap = new Int2IntOpenHashMap(initialSize);
+    public IntMapBasedHolder() {
       _rawKeyToGroupIdMap.defaultReturnValue(INVALID_ID);
     }
 
@@ -438,12 +437,11 @@ public class DictionaryBasedGroupKeyGenerator implements GroupKeyGenerator {
   }
 
   private class LongMapBasedHolder implements RawKeyHolder {
-    private final Long2IntOpenHashMap _rawKeyToGroupIdMap;
+    private final Long2IntOpenHashMap _rawKeyToGroupIdMap = new Long2IntOpenHashMap();
 
     private int _numGroups = 0;
 
-    public LongMapBasedHolder(int initialSize) {
-      _rawKeyToGroupIdMap = new Long2IntOpenHashMap(initialSize);
+    public LongMapBasedHolder() {
       _rawKeyToGroupIdMap.defaultReturnValue(INVALID_ID);
     }
 
@@ -609,12 +607,11 @@ public class DictionaryBasedGroupKeyGenerator implements GroupKeyGenerator {
   }
 
   private class ArrayMapBasedHolder implements RawKeyHolder {
-    private final Object2IntOpenHashMap<IntArray> _rawKeyToGroupIdMap;
+    private final Object2IntOpenHashMap<IntArray> _rawKeyToGroupIdMap = new Object2IntOpenHashMap<>();
 
     private int _numGroups = 0;
 
-    public ArrayMapBasedHolder(int initialSize) {
-      _rawKeyToGroupIdMap = new Object2IntOpenHashMap<>(initialSize);
+    public ArrayMapBasedHolder() {
       _rawKeyToGroupIdMap.defaultReturnValue(INVALID_ID);
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org