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/11/16 19:27:12 UTC

[incubator-pinot] branch add-profiles-to-config-include-path created (now 6e10b47)

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

jfim pushed a change to branch add-profiles-to-config-include-path
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at 6e10b47  Config loader includes also look in profiles

This branch includes the following new commits:

     new 6e10b47  Config loader includes also look in profiles

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-pinot] 01/01: Config loader includes also look in profiles

Posted by jf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jfim pushed a commit to branch add-profiles-to-config-include-path
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 6e10b47c44438d8de53cff666d94392c9b7ae09d
Author: Jean-Francois Im <je...@gmail.com>
AuthorDate: Thu Nov 15 12:47:03 2018 -0800

    Config loader includes also look in profiles
    
    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 4c87b8d..343f899 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
@@ -42,7 +42,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