public synchronized void snapshot(Object value) throws IOException {
  int oldVersion=version;
  incrVersion();
  String fname=versionName(snapshotPrefix);
  File snapshotFile=new File(fname);
  FileOutputStream out=new FileOutputStream(snapshotFile);
  try {
    try {
      handler.snapshot(out,value);
    }
 catch (    IOException e) {
      throw e;
    }
catch (    Exception e) {
      throw new IOException("snapshot failed",e);
    }
    lastSnapshot=System.currentTimeMillis();
  }
  finally {
    out.close();
    snapshotBytes=snapshotFile.length();
  }
  openLogFile(true);
  writeVersionFile(true);
  commitToNewVersion();
  deleteSnapshot(oldVersion);
  deleteLogFile(oldVersion);
}

public synchronized void snapshot ( Object value ) throws IOException { int oldVersion = version ; incrVersion ( ) ; String fname = versionName ( snapshotPrefix ) ; File snapshotFile = new File ( fname ) ; FileOutputStream out = new FileOutputStream ( snapshotFile ) ; try { try { handler . snapshot ( out , value ) ; } catch ( IOException e ) { throw e ; } catch ( Exception e ) { throw new IOException ( "snapshot failed" , e ) ; } lastSnapshot = System . currentTimeMillis ( ) ; } finally { out . close ( ) ; snapshotBytes = snapshotFile . length ( ) ; } openLogFile ( true ) ; writeVersionFile ( true ) ; commitToNewVersion ( ) ; deleteSnapshot ( oldVersion ) ; deleteLogFile ( oldVersion ) ; }
records this value as the current snapshot by invoking the client supplied " snapshot " callback and then empties the log .
