protected long loadEdits ( Iterable < EditLogInputStream > editStreams ) throws IOException { long lastAppliedTxId = storage . getMostRecentCheckpointTxId ( ) ; int numLoaded = 0 ; FSEditLogLoader loader = new FSEditLogLoader ( namesystem ) ; // Load latest edits for ( EditLogInputStream editIn : editStreams ) { FLOG . info ( "Load Image: Reading edits: " + editIn + " last applied txid#: " + lastAppliedTxId ) ; numLoaded += loader . loadFSEdits ( editIn , lastAppliedTxId ) ; lastAppliedTxId = loader . getLastAppliedTxId ( ) ; } editLog . setLastWrittenTxId ( lastAppliedTxId ) ; FLOG . info ( "Load Image: Number of edit transactions loaded: " + numLoaded + " last applied txid: " + lastAppliedTxId ) ; // update the counts namesystem . dir . updateCountForINodeWithQuota ( ) ; return numLoaded ; }
Load the specified list of edit files into the image .