private CompletableFuture < Void > flush ( Void ignored ) { checkRunning ( ) ; long traceId = LoggerHelpers . traceEnterWithContext ( log , this . traceObjectId , "flush" ) ; // Flush everything we can flush. val flushFutures = this . processors . values ( ) . stream ( ) . filter ( ProcessorCollection :: mustFlush ) . map ( a -> a . flush ( this . config . getFlushTimeout ( ) ) ) . collect ( Collectors . toList ( ) ) ; return Futures . allOfWithResults ( flushFutures ) . thenAcceptAsync ( flushResults -> { FlushStageResult result = new FlushStageResult ( ) ; flushResults . forEach ( result :: withFlushResult ) ; if ( result . getFlushedBytes ( ) + result . getMergedBytes ( ) + result . count > 0 ) { logStageEvent ( "Flush" , result ) ; } LoggerHelpers . traceLeave ( log , this . traceObjectId , "flush" , traceId ) ; } , this . executor ) ; }
Flushes eligible operations to Storage if necessary . Does not perform any mergers .