public void addStoreFiles(Collection<HStoreFile> storeFiles,
    IOExceptionRunnable actionAfterAdding) throws IOException {
    storeFileTracker.add(StoreUtils.toStoreFileInfo(storeFiles));
    writeLock();
    try {
      storeFileManager.insertNewFiles(storeFiles);
      actionAfterAdding.run();
    } finally {
      // We need the lock, as long as we are updating the storeFiles
      // or changing the memstore. Let us release it before calling
      // notifyChangeReadersObservers. See HBASE-4485 for a possible
      // deadlock scenario that could have happened if continue to hold
      // the lock.
      writeUnlock();
    }
  }
Add the store files to store file manager, and also record it in the store file tracker.
<p/>
The {@code actionAfterAdding} will be executed after the insertion to store file manager, under
the lock protection. Usually this is for clear the memstore snapshot.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreEngine.java