-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend (legacy)meta server configuration. #1563
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1563 +/- ##
============================================
+ Coverage 48.62% 48.67% +0.05%
- Complexity 1895 1902 +7
============================================
Files 393 393
Lines 11495 11494 -1
Branches 1192 1194 +2
============================================
+ Hits 5589 5595 +6
+ Misses 5477 5471 -6
+ Partials 429 428 -1
Continue to review full report at Codecov.
|
Thanks! Normally, we think system properties have higher priority than system environment properties, is it ok to adjust the logic? Also, after adding system environment logic, the code looks a little complex, is it better to extract the get meta data logic as a standalone method? |
ok,I'll do some refactoring. |
domains.put(Env.PRO, getMeteServerConf(env, prop, "pro_meta", "pro.meta")); | ||
} | ||
|
||
public String getMeteServerConf(Properties env, Properties prop, String sourceName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMeteServerConf -> getMetaServerAddress
public String getMeteServerConf(Properties env, Properties prop, String sourceName, | ||
String propName) { | ||
// 1. Get from System Property. | ||
String metaAddress = env.getProperty(sourceName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about System.getProperty(sourceName)?
String metaAddress = env.getProperty(sourceName); | ||
if (Strings.isNullOrEmpty(metaAddress)) { | ||
// 2. Get from OS environment variable, which could not contain dot and is normally in UPPER case,like DEV_META. | ||
metaAddress = getenv(sourceName.toUpperCase()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.getenv might be more clear :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tks,😄
Looks good to me, would you please stash the commits to one commit? |
Support to override meta server URL through environment variables.