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 2021/11/08 16:54:26 UTC

[GitHub] [pinot] walterddr commented on a change in pull request #7720: memoize literals in query context in order to deduplicate them

walterddr commented on a change in pull request #7720:
URL: https://github.com/apache/pinot/pull/7720#discussion_r744909950



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/request/context/QueryContext.java
##########
@@ -314,6 +318,10 @@ public void setGroupTrimThreshold(int groupTrimThreshold) {
     _groupTrimThreshold = groupTrimThreshold;
   }
 
+  public <K, V> V getOrComputeSharedValue(Class<V> type, K key, Function<K, V> mapper) {

Review comment:
       could you also add some documentation to the class javadoc?

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/request/context/QueryContext.java
##########
@@ -74,6 +77,7 @@
   private final List<ExpressionContext> _groupByExpressions;
   private final FilterContext _havingFilter;
   private final List<OrderByExpressionContext> _orderByExpressions;
+  private final Function<Class<?>, Map<?, ?>> _sharedValues = MemoizedClassAssociation.of(ConcurrentHashMap::new);

Review comment:
       nit: can we put this after _brokerRequest? to me all the private final variable here are parsed from _BrokerRequest thus "immutable", it would be nice to keep them together




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

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

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