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

Reuse CompactionPartitionId and avoid creating MobFileName in PartitionedMobCompactor to avoid unnecessary new objects

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: mob
    • Labels:
      None

      Description

      In today's select() implementation, when it is an existing id, the new allocated object is discarded. It should be reused. fileName is created to getStartKey and getDate(), utility APIs can be created to directly get these fields from the string.

            } else if (allFiles || linkedFile.getLen() < mergeableSize) {
              // add all files if allFiles is true,
              // otherwise add the small files to the merge pool
              MobFileName fileName = MobFileName.create(linkedFile.getPath().getName());
              CompactionPartitionId id = new CompactionPartitionId(fileName.getStartKey(),
                fileName.getDate());
              CompactionPartition compactionPartition = filesToCompact.get(id);
              if (compactionPartition == null) {
                compactionPartition = new CompactionPartition(id);
                compactionPartition.addFile(file);
                filesToCompact.put(id, compactionPartition);
              } else {
                compactionPartition.addFile(file);
              }
              selectedFileCount++;
            }
          }
      

        Attachments

        1. HBASE-17243-master-addendum.patch
          1 kB
          Hua Xiang
        2. HBASE-17243-master-002.patch
          7 kB
          Hua Xiang
        3. HBASE-17243-master-001.patch
          6 kB
          Hua Xiang

          Activity

            People

            • Assignee:
              huaxiang Hua Xiang
              Reporter:
              huaxiang Hua Xiang
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: