hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Shelukhin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-8240) CompoundConfiguration should implement Iterable
Date Wed, 03 Apr 2013 17:27:15 GMT

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

Sergey Shelukhin commented on HBASE-8240:
-----------------------------------------

Test could just check values by getting the keys iterator returns and checking that value
is the same from iterator and from get.
Not sure if we need to copy entire map, could make iterator of iterators; adding the comment
to say that this is an expensive operation might be enough.
Would it be better to return UnmodifiableIterator<E> (from guava) given that remove
on this iterator will have no effect on configuration?
                
> CompoundConfiguration should implement Iterable
> -----------------------------------------------
>
>                 Key: HBASE-8240
>                 URL: https://issues.apache.org/jira/browse/HBASE-8240
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Ted Yu
>         Attachments: 8240-v1.txt, 8240-v2.txt, 8240-v3.txt, 8240-v4.txt
>
>
> 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

Mime
View raw message