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

Should call toUpperCase before using Enum.valueOf in some methods for ColumnFamilyDescriptor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.2.0, 2.1.3, 2.0.5
    • Client
    • None
    • Reviewed
    • Now all the Enum configs in ColumnFamilyDescriptor can accept lower case config value.

    Description

      When upgrading we faced a problem that the some regions can not be opened due to the region server can not recognize the lower case 'snappy' config. In code for branch-1, we have done this

        public Compression.Algorithm getCompression() {
          String n = getValue(COMPRESSION);
          if (n == null) {
            return Compression.Algorithm.NONE;
          }
          return Compression.Algorithm.valueOf(n.toUpperCase(Locale.ROOT));
        }
      

      But in the code of 2.0+, we just call valueOf.

      Attachments

        1. HBASE-21732.patch
          10 kB
          Duo Zhang

        Issue Links

          Activity

            People

              zhangduo Duo Zhang
              zhangduo Duo Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: