Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-8240

CompoundConfiguration should implement Iterable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.98.0, 0.95.1
    • None
    • None
    • Reviewed

    Description

      Here is from hadoop Configuration class:

      public class Configuration implements Iterable<Map.Entry<String,String>>,
      

      There're 3 addXX() methods for CompoundConfiguration:

        public CompoundConfiguration add(final Configuration conf) {
      
        public CompoundConfiguration addWritableMap(
            final Map<ImmutableBytesWritable, ImmutableBytesWritable> map) {
      
        public CompoundConfiguration addStringMap(final Map<String, String> map) {
      

      Parameters to these methods all support iteration.

      We can enhance ImmutableConfigMap with the following new method:

        public abstract java.util.Iterator iterator();
      

      Then the following method of CompoundConfiguration can be implemented:

        public Iterator<Map.Entry<String, String>> iterator() {
      

      This enhancement would be useful in scenario where a mutable Configuration is required.

      Attachments

        1. 8240-v7.txt
          7 kB
          Ted Yu
        2. 8240-v6.txt
          7 kB
          Ted Yu
        3. 8240-v4.txt
          7 kB
          Ted Yu
        4. 8240-v3.txt
          3 kB
          Ted Yu
        5. 8240-v2.txt
          5 kB
          Ted Yu

        Activity

          People

            yuzhihong@gmail.com Ted Yu
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: