@Override
    protected void doAdd(MutableSegment currentActive, ExtendedCell cell,
      MemStoreSizing memstoreSizing) {
      if (Thread.currentThread().getName().equals(SMALL_CELL_THREAD_NAME)) {
        try {
          /**
           * After largeCellThread finished flushInMemory method, smallCellThread can add cell to
           * currentActive . That is to say when largeCellThread called flushInMemory method,
           * currentActive has no cell.
           */
          postCyclicBarrier.await();
        } catch (Throwable e) {
          throw new RuntimeException(e);
        }
      }
      super.doAdd(currentActive, cell, memstoreSizing);
    }
smallCellThread enters CompactingMemStore.checkAndAddToActiveSize first, then
largeCellThread enters CompactingMemStore.checkAndAddToActiveSize, and then
largeCellThread invokes flushInMemory.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java