[ 
https://issues.apache.org/jira/browse/SOLR-7871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152828#comment-16152828
 ] 

Jason Gerlowski edited comment on SOLR-7871 at 9/4/17 5:43 PM:
---------------------------------------------------------------

Trivially updated patch resolves a few conflicts on master. 

bq. Welcoming feedback from others about the overall approach taken here, or if 
there is a better path
 
Happy to chime in on a few specific aspects:

- +1 for keeping property file format, at least for now. 
- +1 for keeping UPPERCASE_UNDERSCORE_DELIMITED key values 
- +1 for having env vars take precedence/override solr.conf values 
- +1 for exiting-in-error for unknown keys: less trappy for users.  This change 
would stand alone pretty well as its own JIRA though. 

bq. The solr.conf file is currently parsed by same code as solr.in.sh, could 
perhaps look into using some standard properties / config parser from some lib 

The Java 
[Properties|https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html]
 class looks like it'd get us pretty far on its own.  It's got parsing, getters 
for props, etc.  [Archaius|https://github.com/Netflix/archaius] offers built in 
support for "cascading" configuration sources (e.g. use ENV-VARS if present, if 
not use config-file values, if those aren't present, ... ) Though that might 
bring in a little more than we're looking for.  That said, neither of those 
libraries are well-equipped to parse the sorts of entries we've got in 
bin/solr.in.cmd, so until we drop support for the old format
s, we're going to see limited value from a library.  At least as I see things; 
could be missing something. 
 
I've got some free time in the next two weeks, so I'd like to take this forward 
if there's enough consensus on what the next steps look like.  As I understand 
it, the next few things are:
- add more tests
- Port the {{bin/solr}} changes over to {{bin/solr.cmd}}
- Switch the precedence/override-order on environment-variables/config-file 
values. 

Does that cover most of the consensus reached so far?  Is there anything that 
you'd prefer to be handled in a sub-issue [~janhoy]?


was (Author: gerlowskija):
Trivially updated patch resolves a few conflicts on master. 

bq. Welcoming feedback from others about the overall approach taken here, or if 
there is a better path
 
Happy to chime in on a few specific aspects:

- +1 for keeping property file format, at least for now. 
- +1 for keeping UPPERCASE_UNDERSCORE_DELIMITED key values 
- +1 for having env vars take precedence/override solr.conf values 
- +1 for exiting-in-error for unknown keys: less trappy for users.  This change 
would stand alone pretty well as its own JIRA though. 

bq. The solr.conf file is currently parsed by same code as solr.in.sh, could 
perhaps look into using some standard properties / config parser from some lib 

The Java 
[Properties|https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html]
 class looks like it'd get us pretty far on its own.  It's got parsing, getters 
for props, etc.  [Archaius|https://github.com/Netflix/archaius] offers built in 
support for "cascading" configuration sources (e.g. use ENV-VARS if present, if 
not use config-file values, if those aren't present, ...  Though that might 
bring in a little more than we're looking for.  That said, neither of those 
libraries are well-equipped to parse the sorts of entries we've got in 
bin/solr.in.cmd, so until we drop support for the old format
s, we're going to see limited value from a library.  At least as I see things; 
could be missing something. 
 
I've got some free time in the next two weeks, so I'd like to take this forward 
if there's enough consensus on what the next steps look like.  As I understand 
it, the next few things are:
- add more tests
- Port the {{bin/solr}} changes over to {{bin/solr.cmd}}
- Switch the precedence/override-order on environment-variables/config-file 
values. 

Does that cover most of the consensus reached so far?  Is there anything that 
you'd prefer to be handled in a sub-issue [~janhoy]?

> Platform independent config file instead of solr.in.sh and solr.in.cmd
> ----------------------------------------------------------------------
>
>                 Key: SOLR-7871
>                 URL: https://issues.apache.org/jira/browse/SOLR-7871
>             Project: Solr
>          Issue Type: Improvement
>          Components: scripts and tools
>    Affects Versions: 5.2.1
>            Reporter: Jan Høydahl
>            Assignee: Jan Høydahl
>              Labels: bin/solr
>         Attachments: SOLR-7871.patch, SOLR-7871.patch, SOLR-7871.patch
>
>
> Spinoff from SOLR-7043
> The config files {{solr.in.sh}} and {{solr.in.cmd}} are currently executable 
> batch files, but all they do is to set environment variables for the start 
> scripts on the format {{key=value}}
> Suggest to instead have one central platform independent config file e.g. 
> {{bin/solr.yml}} or {{bin/solrstart.properties}} which is parsed by 
> {{SolrCLI.java}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to