code: private Future<?> flushDataFrom(List<CommitLogSegment> segments, boolean force)
      {
          if (segments.isEmpty())
              return Futures.immediateFuture(null);
          final ReplayPosition maxReplayPosition = segments.get(segments.size() - 1).getContext();
  
          // a map of CfId -> forceFlush() to ensure we only queue one flush per cf
          final Map<UUID, ListenableFuture<?>> flushes = new LinkedHashMap<>();
  
          for (CommitLogSegment segment : segments)
          {
              for (UUID dirtyCFId : segment.getDirtyCFIDs())
              {
                  Pair<String,String> pair = Schema.instance.getCF(dirtyCFId);
                  if (pair == null)
                  {
                      // even though we remove the schema entry before a final flush when dropping a CF,
                      // it's still possible for a writer to race and finish his append after the flush.
                      logger.debug("Marking clean CF {} that doesn't exist anymore", dirtyCFId);
                      segment.markClean(dirtyCFId, segment.getContext());
                  }
                  else if (!flushes.containsKey(dirtyCFId))
                  {
                      String keyspace = pair.left;
                      final ColumnFamilyStore cfs = Keyspace.open(keyspace).getColumnFamilyStore(dirtyCFId);
                      // can safely call forceFlush here as we will only ever block (briefly) for other attempts to flush,
                      // no deadlock possibility since switchLock removal
                      flushes.put(dirtyCFId, force ? cfs.forceFlush() : cfs.forceFlush(maxReplayPosition));
                  }
              }
          }
  
          return Futures.allAsList(flushes.values());
      }
docs: Force a flush on all CFs that are still dirty in @param segments.
  
  @return a Future that will finish when all the flushes are complete.