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

Guard against possibly copying the qualifier in the ScanDeleteTracker

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None
    • Reviewed

    Description

      If the input cell is ByteBufferKeyValue, the ByteBufferKeyValue#getQualifierArray will copy the qualifier bytes.
      ScanDeleteTracker should keep the cell rather than qualifier array.

        public void add(Cell cell) {
        long timestamp = cell.getTimestamp();
        byte type = cell.getTypeByte();
        if (!hasFamilyStamp || timestamp > familyStamp) {
        if (type == KeyValue.Type.DeleteFamily.getCode()) {
        hasFamilyStamp = true;
        familyStamp = timestamp;
        return;
        } else if (type == KeyValue.Type.DeleteFamilyVersion.getCode()) {
        familyVersionStamps.add(timestamp);
        return;
        }
      
        if (deleteBuffer != null && type < deleteType) {
        // same column, so ignore less specific delete
        if (CellUtil.matchingQualifier(cell, deleteBuffer, deleteOffset, deleteLength)) {
        return;
        }
        }
        // new column, or more general delete type
        deleteBuffer = cell.getQualifierArray();
        deleteOffset = cell.getQualifierOffset();
        deleteLength = cell.getQualifierLength();
        deleteType = type;
        deleteTimestamp = timestamp;
        }
        // missing else is never called.
        }
      

      Attachments

        1. HBASE-17734.v2.patch
          11 kB
          Chia-Ping Tsai
        2. HBASE-17734.v1.patch
          7 kB
          Chia-Ping Tsai
        3. HBASE-17734.v0.patch
          4 kB
          Chia-Ping Tsai

        Activity

          People

            chia7712 Chia-Ping Tsai
            chia7712 Chia-Ping Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: