Jackie-Jiang commented on code in PR #9802:
URL: https://github.com/apache/pinot/pull/9802#discussion_r1028546083


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/offline/DimensionTable.java:
##########
@@ -18,44 +18,21 @@
  */
 package org.apache.pinot.core.data.manager.offline;
 
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import org.apache.pinot.spi.data.FieldSpec;
-import org.apache.pinot.spi.data.Schema;
 import org.apache.pinot.spi.data.readers.GenericRow;
 import org.apache.pinot.spi.data.readers.PrimaryKey;
 
 
-class DimensionTable {
+public interface DimensionTable<T> {
 
-  private final Map<PrimaryKey, GenericRow> _lookupTable;
-  private final Schema _tableSchema;
-  private final List<String> _primaryKeyColumns;
+  List<String> getPrimaryKeyColumns();
 
-  DimensionTable(Schema tableSchema, List<String> primaryKeyColumns) {
-    this(tableSchema, primaryKeyColumns, new HashMap<>());
-  }
+  GenericRow get(PrimaryKey pk);
 
-  DimensionTable(Schema tableSchema, List<String> primaryKeyColumns, 
Map<PrimaryKey, GenericRow> lookupTable) {
-    _lookupTable = lookupTable;
-    _tableSchema = tableSchema;
-    _primaryKeyColumns = primaryKeyColumns;
-  }
+  boolean put(PrimaryKey pk, T value);

Review Comment:
   It should be immutable. Let's remove this method, and we can also remove the 
generic type `T`



##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/offline/DimensionTableDataManager.java:
##########
@@ -78,16 +80,31 @@ public static DimensionTableDataManager 
getInstanceByTableName(String tableNameW
       AtomicReferenceFieldUpdater.newUpdater(DimensionTableDataManager.class, 
DimensionTable.class, "_dimensionTable");
 
   private volatile DimensionTable _dimensionTable;
+  private boolean _isMemoryOptimized = true;

Review Comment:
   Let's call it `_disablePreload` and default to `false` (for backward 
compatible)



-- 
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-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to