[
https://issues.apache.org/jira/browse/HBASE-8240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13620330#comment-13620330
]
Nicolas Spiegelberg commented on HBASE-8240:
--------------------------------------------
looks good & sensible. this should be a simple n-way merge and all the
existing ImmutableConfigMap types should have their own iterator, so this
should be trivial. Note that the current implementation of
CompoundConfiguration is not threadsafe, so you may need some extra work there
depending upon how you are using this.
> CompoundConfiguration should implement Iterable
> -----------------------------------------------
>
> Key: HBASE-8240
> URL: https://issues.apache.org/jira/browse/HBASE-8240
> Project: HBase
> Issue Type: Improvement
> Reporter: Ted Yu
>
> Here is from hadoop Configuration class:
> {code}
> public class Configuration implements Iterable<Map.Entry<String,String>>,
> {code}
> There're 3 addXX() methods for CompoundConfiguration:
> {code}
> public CompoundConfiguration add(final Configuration conf) {
> public CompoundConfiguration addWritableMap(
> final Map<ImmutableBytesWritable, ImmutableBytesWritable> map) {
> public CompoundConfiguration addStringMap(final Map<String, String> map) {
> {code}
> Parameters to these methods all support iteration.
> We can enhance ImmutableConfigMap with the following new method:
> {code}
> public abstract java.util.Iterator iterator();
> {code}
> Then the following method of CompoundConfiguration can be implemented:
> {code}
> public Iterator<Map.Entry<String, String>> iterator() {
> {code}
> This enhancement would be useful in scenario where a mutable Configuration is
> required.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira