You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/05/20 06:54:16 UTC

[GitHub] [incubator-pinot] fx19880617 opened a new pull request #5419: Use thread local for groupby raw key holders

fx19880617 opened a new pull request #5419:
URL: https://github.com/apache/incubator-pinot/pull/5419


   


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



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


[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5419: [WIP]Use thread local for groupby raw key holders

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on a change in pull request #5419:
URL: https://github.com/apache/incubator-pinot/pull/5419#discussion_r428222776



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
##########
@@ -106,18 +108,26 @@ public DictionaryBasedGroupKeyGenerator(TransformOperator transformOperator,
 
       _isSingleValueColumn[i] = transformOperator.getResultMetadata(groupByExpression).isSingleValue();
     }
-
     if (longOverflow) {
       _globalGroupIdUpperBound = numGroupsLimit;
-      _rawKeyHolder = new ArrayMapBasedHolder(_globalGroupIdUpperBound);
+      if (!mapBasedRawKeyHolders.containsKey(ArrayMapBasedHolder.class.getName())) {
+        mapBasedRawKeyHolders.put(ArrayMapBasedHolder.class.getName(), new ArrayMapBasedHolder(_globalGroupIdUpperBound).getInternal());

Review comment:
       True. I feel we may need to have a range of groupIdBound, and only do thread local for them. if it's too small or too large, maybe just create new objects without and with initial size.




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



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


[GitHub] [incubator-pinot] mayankshriv commented on a change in pull request #5419: [WIP]Use thread local for groupby raw key holders

Posted by GitBox <gi...@apache.org>.
mayankshriv commented on a change in pull request #5419:
URL: https://github.com/apache/incubator-pinot/pull/5419#discussion_r428218159



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
##########
@@ -106,18 +108,26 @@ public DictionaryBasedGroupKeyGenerator(TransformOperator transformOperator,
 
       _isSingleValueColumn[i] = transformOperator.getResultMetadata(groupByExpression).isSingleValue();
     }
-
     if (longOverflow) {
       _globalGroupIdUpperBound = numGroupsLimit;
-      _rawKeyHolder = new ArrayMapBasedHolder(_globalGroupIdUpperBound);
+      if (!mapBasedRawKeyHolders.containsKey(ArrayMapBasedHolder.class.getName())) {
+        mapBasedRawKeyHolders.put(ArrayMapBasedHolder.class.getName(), new ArrayMapBasedHolder(_globalGroupIdUpperBound).getInternal());

Review comment:
       I think initializing to `_globalGroupIdUpperBound` got introduced in #5291. For many cases with multiple group by columns (high cardinality and/or MV columns) this number can be huge. Unclear to me if making this thread-local will protect against such cases that may require allocating huge chunk of memory upfornt.




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



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


[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request #5419: [WIP]Use thread local for groupby raw key holders

Posted by GitBox <gi...@apache.org>.
fx19880617 commented on a change in pull request #5419:
URL: https://github.com/apache/incubator-pinot/pull/5419#discussion_r428220074



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
##########
@@ -106,18 +108,26 @@ public DictionaryBasedGroupKeyGenerator(TransformOperator transformOperator,
 
       _isSingleValueColumn[i] = transformOperator.getResultMetadata(groupByExpression).isSingleValue();
     }
-
     if (longOverflow) {
       _globalGroupIdUpperBound = numGroupsLimit;
-      _rawKeyHolder = new ArrayMapBasedHolder(_globalGroupIdUpperBound);
+      if (!mapBasedRawKeyHolders.containsKey(ArrayMapBasedHolder.class.getName())) {

Review comment:
       those types are internal and not exposed outside `DictionaryBasedGroupKeyGenerator.java`




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



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


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #5419: [WIP]Use thread local for groupby raw key holders

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #5419:
URL: https://github.com/apache/incubator-pinot/pull/5419#discussion_r428187692



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
##########
@@ -106,18 +108,26 @@ public DictionaryBasedGroupKeyGenerator(TransformOperator transformOperator,
 
       _isSingleValueColumn[i] = transformOperator.getResultMetadata(groupByExpression).isSingleValue();
     }
-
     if (longOverflow) {
       _globalGroupIdUpperBound = numGroupsLimit;
-      _rawKeyHolder = new ArrayMapBasedHolder(_globalGroupIdUpperBound);
+      if (!mapBasedRawKeyHolders.containsKey(ArrayMapBasedHolder.class.getName())) {

Review comment:
       Use `computeIfAbsent()` to save one extra map lookup.
   Also, because you already know the type of key holders, maybe add a separate class to store different type of holders without map lookup?




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



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


[GitHub] [incubator-pinot] snleee merged pull request #5419: Use thread local for groupby raw key holders

Posted by GitBox <gi...@apache.org>.
snleee merged pull request #5419:
URL: https://github.com/apache/incubator-pinot/pull/5419


   


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



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