public void writeTransactionIdFileToStorage ( long txid , FSImage image ) throws IOException { // Write txid marker in all storage directories List < StorageDirectory > badSDs = new ArrayList < StorageDirectory > ( ) ; for ( StorageDirectory sd : storageDirs ) { try { writeTransactionIdFile ( sd , txid ) ; } catch ( IOException e ) { // Close any edits stream associated with this dir and remove directory LOG . warn ( "writeTransactionIdToStorage failed on " + sd , e ) ; badSDs . add ( sd ) ; } } reportErrorsOnDirectories ( badSDs , image ) ; if ( image != null ) { } }
Write a small file in all available storage directories that indicates that the namespace has reached some given transaction ID .