Iterator it;
try {
it = LogInputFile.logs(logFileBase, all);
} catch (IOException e) {
final String msg = "couldn't open logs";
final InternalSpaceException ise =
new InternalSpaceException(msg, e);
logger.log(Level.SEVERE, msg , ise);
throw ise;
}
while (it.hasNext()) {
LogInputFile log = (LogInputFile)it.next();
logger.log(Level.FINE, "processing {0})", log);
if (log == null) // file already consumed
continue;
try {
String logFile = log.toString();
if (lastLog == null || !lastLog.sameAs(logFile))
log.consume(this);
lastLog = new LastLog(logFile);
ObjectOutputStream out = snapshotFile.next();
out.writeInt(SNAPSHOT_VERSION);
out.writeObject(sessionId);
out.writeObject(joinState);
out.writeObject(entries);
out.writeObject(registrations);
out.writeObject(pendingTxns);
out.writeObject(topUuid);
out.writeObject(lastLog);
snapshotFile.commit();
} catch (IOException e) {
final String msg = "error writing snapshot";
final InternalSpaceException ise =
new InternalSpaceException(msg, e);
logger.log(Level.SEVERE, msg , ise);
throw ise;
}
log.finished();
}