public synchronized void create(long seqno) throws ReplicatorException, InterruptedException {
  if (file.exists()) {
    throw new THLException("Cannot create new log file; file already exists: " + file.getName());
  }
  try {
    dataOutput=new BufferedFileDataOutput(file,bufferSize);
  }
 catch (  IOException e) {
    throw new THLException("Failed to open new file for writing: " + file.getName(),e);
  }
  mode=AccessMode.write;
  try {
    write(MAGIC_NUMBER);
    write(MAJOR_VERSION);
    write(MINOR_VERSION);
    write(seqno);
    flush();
  }
 catch (  IOException e) {
    throw new THLException("Unable to write file header: " + file.getName(),e);
  }
  baseSeqno=seqno;
  if (logFlushTask != null)   logFlushTask.addLogFile(this);
}

public synchronized void create ( long seqno ) throws ReplicatorException , InterruptedException { if ( file . exists ( ) ) { throw new THLException ( "Cannot create new log file; file already exists: " + file . getName ( ) ) ; } try { dataOutput = new BufferedFileDataOutput ( file , bufferSize ) ; } catch ( IOException e ) { throw new THLException ( "Failed to open new file for writing: " + file . getName ( ) , e ) ; } mode = AccessMode . write ; try { write ( MAGIC_NUMBER ) ; write ( MAJOR_VERSION ) ; write ( MINOR_VERSION ) ; write ( seqno ) ; flush ( ) ; } catch ( IOException e ) { throw new THLException ( "Unable to write file header: " + file . getName ( ) , e ) ; } baseSeqno = seqno ; if ( logFlushTask != null ) logFlushTask . addLogFile ( this ) ; }
create a new log file . we must write a header with a base sequence number . note : the file offset is positioned after the header .
