You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jf...@apache.org on 2018/12/04 20:40:50 UTC

[incubator-pinot] branch master updated: Config loader includes also look in profiles (#3507)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new ed88fb4  Config loader includes also look in profiles (#3507)
ed88fb4 is described below

commit ed88fb4e3824808701a0106b54193c124bfe6ea8
Author: Jean-François Im <je...@gmail.com>
AuthorDate: Tue Dec 4 12:40:45 2018 -0800

    Config loader includes also look in profiles (#3507)
    
    When including configuration files from a table configuration or another
    configuration file, look in both the current directory and the profiles
    directory for the file to include.
---
 .../com/linkedin/pinot/common/config/CombinedConfigLoader.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pinot-common/src/main/java/com/linkedin/pinot/common/config/CombinedConfigLoader.java b/pinot-common/src/main/java/com/linkedin/pinot/common/config/CombinedConfigLoader.java
index 45cbcf3..de887a1 100644
--- a/pinot-common/src/main/java/com/linkedin/pinot/common/config/CombinedConfigLoader.java
+++ b/pinot-common/src/main/java/com/linkedin/pinot/common/config/CombinedConfigLoader.java
@@ -44,7 +44,14 @@ public class CombinedConfigLoader {
       private ConfigIncluder parent = null;
 
       public ConfigObject include(ConfigIncludeContext context, String what) {
-        return ConfigFactory.parseFileAnySyntax(new File(what)).root();
+        File file = new File(what);
+
+        // Attempt to locate the file
+        if (!file.exists()) {
+          file = new File("profiles", what);
+        }
+
+        return ConfigFactory.parseFileAnySyntax(file).root();
       }
 
       public ConfigIncluder withFallback(ConfigIncluder fallback) {


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