int numEdits = 0;
File jSpoolFile = getJSpoolFile(sdEdits);
long startTime = now();
if(jSpoolFile.exists()) {
// load edits.new
EditLogFileInputStream edits = new EditLogFileInputStream(jSpoolFile);
DataInputStream in = edits.getDataInputStream();
FSEditLogLoader logLoader = new FSEditLogLoader(namesystem);
numEdits += logLoader.loadFSEdits(in, false);
// first time reached the end of spool
jsState = JSpoolState.WAIT;
numEdits += logLoader.loadEditRecords(getLayoutVersion(), in, true);
getFSNamesystem().dir.updateCountForINodeWithQuota();
edits.close();
}
FSImage.LOG.info("Edits file " + jSpoolFile.getCanonicalPath()
+ " of size " + jSpoolFile.length() + " edits # " + numEdits
+ " loaded in " + (now()-startTime)/1000 + " seconds.");