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

Clear cachedMaxVersions when HColumnDescriptor#setValue(VERSIONS, value) is called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0, 1.3.0, 2.0.0
    • None
    • None
    • Reviewed

    Description

      HColumnDescriptor caches the value of VERSIONS in a cachedMaxVersions member variable. This member variable should be reset or cleared when setValue(HConstants.VERSIONS, value) is called, like this:

        static final bytes[] VERSIONS_BYTES = Bytes.toBytes(HConstants.VERSIONS);
        public HColumnDescriptor setValue(byte[] key, byte[] value) {
          if (Bytes.compare(HConstants.VERSIONS_BYTES, key) == 0) {
              cachedMaxVersions = UNINITIALIZED;
          }
          values.put(new ImmutableBytesWritable(key),
            new ImmutableBytesWritable(value));
          return this;
        }
      

      Otherwise, you continue getting back cachedMaxVersions instead of the updated value.

      Attachments

        1. HBASE-14737.patch
          2 kB
          Pankaj Kumar

        Activity

          People

            pankaj2461 Pankaj Kumar
            jamestaylor James R. Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: