private synchronized void refreshCachedData ( ) throws IOException { IOUtils . closeStream ( committedTxnId ) ; File currentDir = journalStorage . getSingularStorageDir ( ) . getCurrentDir ( ) ; this . lastPromisedEpoch = new PersistentLongFile ( new File ( currentDir , LAST_PROMISED_FILENAME ) , 0 ) ; this . lastWriterEpoch = new PersistentLongFile ( new File ( currentDir , LAST_WRITER_EPOCH ) , 0 ) ; this . committedTxnId = new BestEffortLongFile ( new File ( currentDir , COMMITTED_TXID_FILENAME ) , HdfsConstants . INVALID_TXID ) ; metrics . lastWriterEpoch . set ( lastWriterEpoch . get ( ) ) ; }
Reload any data that may have been cached . This is necessary when we first load the Journal but also after any formatting operation since the cached data is no longer relevant .