Backported Configuration method from accumulo 4#6336
Open
ddanielr wants to merge 3 commits intoapache:2.1from
Open
Backported Configuration method from accumulo 4#6336ddanielr wants to merge 3 commits intoapache:2.1from
ddanielr wants to merge 3 commits intoapache:2.1from
Conversation
Backported the `Configuration.from` method from accumulo 4 to allow clients the ability to generate a Configuration without needing to fully create a separate Configuration wrapper implementation.
|
|
||
| Configuration config = Configuration.from(props, true); | ||
| assertEquals("bar", config.get("table.custom.foo")); | ||
| assertEquals(TABLE_MAJC_RATIO.getDefaultValue(), config.get(TABLE_MAJC_RATIO.getKey())); |
Contributor
There was a problem hiding this comment.
Suggested change
| assertEquals(TABLE_MAJC_RATIO.getDefaultValue(), config.get(TABLE_MAJC_RATIO.getKey())); | |
| assertEquals(TABLE_MAJC_RATIO.getDefaultValue(), config.get(TABLE_MAJC_RATIO.getKey())); | |
| assertTrue(config.isSet("table.custom.foo")); | |
| assertFalse(config.isSet(TABLE_MAJC_RATIO.getKey())); |
I think this test would fail, so the behavior is not as realistic. This is an existing problem w/ the 4.0 code. Maybe we can add a new constructor like the following to support this. Where isSet() would only return true if a prop is in copy or parent.isSet is true. We can pass in the DefaultConfiguration object which always returns false for isSet(). We would need to make the get methods on ConfigurationCopy read from copy then parent.
public ConfigurationCopy(AccumuloConfiguration parent, Map<String,String> config) {
this.parent = parent;
copy.putAll(config);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backported the
Configuration.frommethod from accumulo 4 to allow clients the ability to generate a Configuration without needing to fully create a separate Configuration wrapper implementation.Added some test cases as well.