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 2022/02/07 19:35:34 UTC

[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #8140: Allocation free `DataBlockCache` lookups

Jackie-Jiang commented on a change in pull request #8140:
URL: https://github.com/apache/pinot/pull/8140#discussion_r800992938



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/common/DataBlockCache.java
##########
@@ -462,28 +452,15 @@ public void fillValues(String column, TransformEvaluator evaluator, String[][] b
     return numValues;
   }
 
-  /**
-   * Helper class to store pair of column name and data type.
-   */
-  private static class ColumnTypePair {
-    final String _column;
-    final FieldSpec.DataType _dataType;
-
-    ColumnTypePair(@Nonnull String column, @Nonnull FieldSpec.DataType dataType) {
-      _column = column;
-      _dataType = dataType;
-    }
+  private boolean markLoaded(FieldSpec.DataType dataType, String column) {
+    return _columnValueLoaded.computeIfAbsent(dataType, k -> new HashSet<>()).add(column);
+  }
 
-    @Override
-    public int hashCode() {
-      return EqualityUtils.hashCodeOf(_column.hashCode(), _dataType.hashCode());
-    }
+  private <T> T getValues(@Nonnull FieldSpec.DataType dataType, @Nonnull String column) {

Review comment:
       (minor) We don't usually annotate `Nonnull` but only annotate `Nullable` and assume all un-annotated parameters are non-null

##########
File path: pinot-core/src/main/java/org/apache/pinot/core/common/DataBlockCache.java
##########
@@ -67,7 +67,9 @@ public void initNewBlock(int[] docIds, int length) {
     _length = length;
 
     _columnDictIdLoaded.clear();
-    _columnValueLoaded.clear();
+    for (Set<String> column : _columnValueLoaded.values()) {

Review comment:
       (minor) 
   ```suggestion
       for (Set<String> columns : _columnValueLoaded.values()) {
   ```




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