public synchronized void commit ( ) throws IOException { if ( logStream != null ) { logStream . flush ( ) ; } for ( FileOutputStream log : streamsToFlush ) { log . flush ( ) ; if ( forceSync ) { log . getChannel ( ) . force ( false ) ; } } while ( streamsToFlush . size ( ) > 1 ) { streamsToFlush . removeFirst ( ) . close ( ) ; } }
commit the logs . make sure that evertyhing hits the disk