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/09/22 17:22:26 UTC

[GitHub] [pinot] jackjlli commented on a diff in pull request #9442: add table config and schema API in TableDataManager

jackjlli commented on code in PR #9442:
URL: https://github.com/apache/pinot/pull/9442#discussion_r977912171


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java:
##########
@@ -212,10 +214,23 @@ public void addSegment(ImmutableSegment immutableSegment) {
   @Override
   public void addSegment(File indexDir, IndexLoadingConfig indexLoadingConfig)
       throws Exception {
-    Schema schema = ZKMetadataProvider.getTableSchema(_propertyStore, _tableNameWithType);
+    Schema schema = getAndPersistTableSchema();
     addSegment(ImmutableSegmentLoader.load(indexDir, indexLoadingConfig, schema));
   }
 
+  protected TableConfig getAndPersistTableConfig(IndexLoadingConfig indexLoadingConfig) {
+    _tableConfig = indexLoadingConfig.getTableConfig();
+    return _tableConfig;
+  }
+
+  protected Schema getAndPersistTableSchema() {
+    Schema tableSchema = ZKMetadataProvider.getTableSchema(_propertyStore, _tableNameWithType);
+    if (tableSchema != null) {

Review Comment:
   The copy cached in the BaseTableDataManager can be stale if we don't override the latest one to it.



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