void writeTransactionIdFile ( StorageDirectory sd , long txid ) throws IOException { if ( txid < - 1 ) { // -1 is valid when formatting throw new IOException ( "Bad txid: " + txid ) ; } File txIdFile = getStorageFile ( sd , NameNodeFile . SEEN_TXID ) ; OutputStream fos = new AtomicFileOutputStream ( txIdFile ) ; try { fos . write ( String . valueOf ( txid ) . getBytes ( ) ) ; fos . write ( ' ' ) ; fos . close ( ) ; fos = null ; } finally { IOUtils . cleanup ( LOG , fos ) ; } }
Write last checkpoint time into a separate file .