void assignToNew ( String fileName , PageFormatter fmtr ) { internalLock . writeLock ( ) . lock ( ) ; try { flush ( ) ; fmtr . format ( this ) ; blk = contents . append ( fileName ) ; pins = 0 ; isNew = true ; lastLsn = LogSeqNum . DEFAULT_VALUE ; } finally { internalLock . writeLock ( ) . unlock ( ) ; } }
Initializes the buffer s page according to the specified formatter and appends the page to the specified file . If the buffer was dirty then the contents of the previous page are first written to disk .