You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ne...@apache.org on 2021/11/02 05:04:01 UTC

[pinot] branch master updated: Add table name with type to segment directory configs (#7667)

This is an automated email from the ASF dual-hosted git repository.

nehapawar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 6af5f4e  Add table name with type to segment directory configs (#7667)
6af5f4e is described below

commit 6af5f4e1f710f289c481b40b0b08e8f146f35472
Author: Neha Pawar <ne...@gmail.com>
AuthorDate: Mon Nov 1 22:03:39 2021 -0700

    Add table name with type to segment directory configs (#7667)
    
    * Add table name with type to segment directory configs
    
    * Add only if non null
    
    * Small bug
---
 .../local/indexsegment/immutable/ImmutableSegmentLoader.java       | 6 +++++-
 .../segment/local/segment/index/loader/IndexLoadingConfig.java     | 7 +++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/ImmutableSegmentLoader.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/ImmutableSegmentLoader.java
index b59af44..a7b6d04 100644
--- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/ImmutableSegmentLoader.java
+++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/ImmutableSegmentLoader.java
@@ -112,7 +112,11 @@ public class ImmutableSegmentLoader {
 
     // Load the segment again for the configured tier backend. Default is 'local'.
     PinotConfiguration tierConfigs = indexLoadingConfig.getTierConfigs();
-    PinotConfiguration segDirConfigs = new PinotConfiguration(tierConfigs.toMap());
+    Map<String, Object> segDirConfigMap = tierConfigs.toMap();
+    if (indexLoadingConfig.getTableNameWithType() != null) {
+      segDirConfigMap.put(IndexLoadingConfig.TABLE_NAME_WITH_TYPE_KEY, indexLoadingConfig.getTableNameWithType());
+    }
+    PinotConfiguration segDirConfigs = new PinotConfiguration(segDirConfigMap);
     SegmentDirectory actualSegmentDirectory =
         SegmentDirectoryLoaderRegistry.getSegmentDirectoryLoader(indexLoadingConfig.getTierBackend())
             .load(indexDir.toURI(), segDirConfigs);
diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java
index 12b73b6..c91602a 100644
--- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java
+++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java
@@ -49,7 +49,9 @@ import org.apache.pinot.spi.utils.ReadMode;
 public class IndexLoadingConfig {
   private static final int DEFAULT_REALTIME_AVG_MULTI_VALUE_COUNT = 2;
   public static final String DEFAULT_TIER_BACKEND = "local";
+  public static final String TABLE_NAME_WITH_TYPE_KEY = "tableNameWithType";
 
+  private String _tableNameWithType;
   private ReadMode _readMode = ReadMode.DEFAULT_MODE;
   private List<String> _sortedColumns = Collections.emptyList();
   private Set<String> _invertedIndexColumns = new HashSet<>();
@@ -91,6 +93,7 @@ public class IndexLoadingConfig {
   }
 
   private void extractFromTableConfig(TableConfig tableConfig) {
+    _tableNameWithType = tableConfig.getTableName();
     IndexingConfig indexingConfig = tableConfig.getIndexingConfig();
     String tableReadMode = indexingConfig.getLoadMode();
     if (tableReadMode != null) {
@@ -256,6 +259,10 @@ public class IndexLoadingConfig {
   public IndexLoadingConfig() {
   }
 
+  public String getTableNameWithType() {
+    return _tableNameWithType;
+  }
+
   public ReadMode getReadMode() {
     return _readMode;
   }

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