public synchronized void flush() throws IOException, ReplicatorException, InterruptedException {
  if (!needsFlush) {
    return;
  }
  assertWriteMode();
  if (flushIntervalMillis == 0) {
    flushPrivate();
  }
 else   if (nextFlushMillis == 0) {
    nextFlushMillis=System.currentTimeMillis() + this.flushIntervalMillis;
  }
 else   if (System.currentTimeMillis() >= nextFlushMillis) {
    flushPrivate();
  }
}

public synchronized void flush ( ) throws IOException , ReplicatorException , InterruptedException { if ( ! needsFlush ) { return ; } assertWriteMode ( ) ; if ( flushIntervalMillis == 0 ) { flushPrivate ( ) ; } else if ( nextFlushMillis == 0 ) { nextFlushMillis = System . currentTimeMillis ( ) + this . flushIntervalMillis ; } else if ( System . currentTimeMillis ( ) >= nextFlushMillis ) { flushPrivate ( ) ; } }
synchronizes file writes using flush with optional fsync . you must call this method to commit data .
