private void mergeResults(Collection<HStoreFile> compactedFiles,
      Collection<HStoreFile> results) {
      assert this.compactedFiles == null && this.results == null;
      this.compactedFiles = compactedFiles;
      this.results = results;
      // Do logical processing.
      if (!isFlush) {
        removeCompactedFiles();
      }
      TreeMap<byte[], HStoreFile> newStripes = processResults();
      if (newStripes != null) {
        processNewCandidateStripes(newStripes);
      }
      // Create new state and update parent.
      State state = createNewState(false);
      StripeStoreFileManager.this.state = state;
      updateMetadataMaps();
    }
Non-static helper class for merging compaction or flush results. Since we want to merge them
atomically (more or less), it operates on lazy copies, then creates a new state object and puts
it in place.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java