-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Apply both environment variables and system properties to user and table config #13011
Apply both environment variables and system properties to user and table config #13011
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13011 +/- ##
============================================
+ Coverage 61.75% 62.16% +0.41%
+ Complexity 207 198 -9
============================================
Files 2436 2502 +66
Lines 133233 136670 +3437
Branches 20636 21164 +528
============================================
+ Hits 82274 84963 +2689
- Misses 44911 45419 +508
- Partials 6048 6288 +240
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
public static <T extends BaseJsonConfig> T applyConfigWithEnvVariablesAndSystemProperties(T config) { | ||
Map<String, String> combinedMap = new HashMap<>(); | ||
// Add all system properties to the map | ||
System.getProperties().forEach((key, value) -> combinedMap.put(String.valueOf(key), String.valueOf(value))); |
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.
Is the overhead high to dynamically load system properties for each config read?
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.
this is not happening all the time, so the overhead is not that much.
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.
I'm thinking maybe we can periodically pull it, but we can iterate if we find this becomes blocker
@@ -85,7 +85,7 @@ public void testIndexing() { | |||
ImmutableMap.of("LOAD_MODE", "MMAP", "AWS_ACCESS_KEY", "default_aws_access_key", "AWS_SECRET_KEY", | |||
"default_aws_secret_key"); | |||
|
|||
indexingConfig = ConfigUtils.applyConfigWithEnvVariables(environment, indexingConfig); | |||
indexingConfig = ConfigUtils.applyConfigWithEnvVariablesAndSystemProperties(environment, indexingConfig); |
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.
Shall we add some value to the system properties and test out the behavior?
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.
added.
…and table configs, Environment variables take precedence over system properties
aab7de4
to
499eec2
Compare
Apply both environment variables and system properties to user and table configs.
Environment variables take precedence over system properties.