@Override
    public void flushCache(MonitoredTask status) throws IOException {
      RegionServerServices rsService = region.getRegionServerServices();
      ThroughputController throughputController =
        rsService == null ? null : rsService.getFlushThroughputController();
      // it could be null if we do not need to track the creation of store file writer due to
      // different SFT implementation.
      if (writerCreationTracker != null) {
        HStore.this.storeFileWriterCreationTrackers.add(writerCreationTracker);
      }
      tempFiles = HStore.this.flushCache(cacheFlushSeqNum, snapshot, status, throughputController,
        tracker, writerCreationTracker);
    }
This is not thread safe. The caller should have a lock on the region or the store. If
necessary, the lock can be added with the patch provided in HBASE-10087
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java