private void flush() {
    long max = Long.MIN_VALUE;
    HRegion toFlush = null;
    for (HRegion region : rsServices.getRegions()) {
      Optional<RegionReplicationSink> sink = region.getRegionReplicationSink();
      if (sink.isPresent()) {
        RegionReplicationSink s = sink.get();
        long p = s.pendingSize();
        if (p > max) {
          max = p;
          toFlush = region;
        }
      }
    }
    if (toFlush != null) {
      // here we need to write flush marker out, so we can drop all the pending edits in the region
      // replication sink.
      try {
        LOG.info("Going to flush {} with {} pending entry size", toFlush.getRegionInfo(),
          StringUtils.TraditionalBinaryPrefix.long2String(max, "", 1));
        FlushResult result = toFlush.flushcache(true, true, FlushLifeCycleTracker.DUMMY);
        if (!result.isFlushSucceeded()) {
          LOG.warn("Failed to flush {}, the result is {}", toFlush.getRegionInfo(),
            result.getResult());
        }
      } catch (IOException e) {
        LOG.warn("Failed to flush {}", toFlush.getRegionInfo(), e);
      }
    } else {
      // usually this should not happen but since the flush operation is async, theoretically it
      // could happen. Let's log it, no real harm.
      LOG.warn("Can not find a region to flush");
    }
  }
This is the total size of pending entries for all the sinks.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/regionreplication/RegionReplicationBufferManager.java