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

Provide an API to set min and max versions in HColumnDescriptor

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.0, 1.2.0, 2.0.0
    • Fix Version/s: 0.98.13, 1.0.2, 1.2.0, 1.1.1, 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      In org.apache.hadoop.hbase.chaos.actions.ChangeVersionsAction#perform(), it tries to update the max and min versions in a column descriptor:

           for(HColumnDescriptor descriptor:columnDescriptors) {
             descriptor.setMaxVersions(versions);
             descriptor.setMinVersions(versions);
           }
      

      If the current minimum version is greater than the new max version, an IllegalArgumentException would throw from org.apache.hadoop.hbase.HColumnDescriptor#setMaxVersions().

      Here is an example (trying to set max version to 1 while currently min version is 2):

      java.lang.IllegalArgumentException: Set MaxVersion to 1 while minVersion is 2. Maximum versions must be >= minimum versions
      at org.apache.hadoop.hbase.HColumnDescriptor.setMaxVersions(HColumnDescriptor.java:634)
      at org.apache.hadoop.hbase.chaos.actions.ChangeVersionsAction.perform(ChangeVersionsAction.java:62)
      

      One solution is to change the order of set - set min version first and then set max version (note: the current implement of org.apache.hadoop.hbase.HColumnDescriptor#setMinVersions() does not check the min version value and blindly set the version. Not sure whether this is by-design).

      Another solution is to provide an API to set both min and max version in one function call.

        Attachments

        1. HBASE-13711.patch
          2 kB
          Stephen Yuan Jiang
        2. HBASE-13711.v1-branch-1.1.patch
          1 kB
          Stephen Yuan Jiang
        3. HBASE-13711-v2.patch
          2 kB
          Stephen Yuan Jiang

          Activity

            People

            • Assignee:
              syuanjiang Stephen Yuan Jiang
              Reporter:
              syuanjiang Stephen Yuan Jiang
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: