simpledb.tx
Class BufferList

java.lang.Object
  extended by simpledb.tx.BufferList

 class BufferList
extends java.lang.Object

Manages the transaction's currently-pinned buffers.

Author:
Edward Sciore

Constructor Summary
BufferList()
           
 
Method Summary
(package private)  Buffer getBuffer(Block blk)
          Returns the buffer pinned to the specified block.
(package private)  void pin(Block blk)
          Pins the block and keeps track of the buffer internally.
(package private)  Block pinNew(java.lang.String filename, PageFormatter fmtr)
          Appends a new block to the specified file and pins it.
(package private)  void unpin(Block blk)
          Unpins the specified block.
(package private)  void unpinAll()
          Unpins any buffers still pinned by this transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferList

BufferList()
Method Detail

getBuffer

Buffer getBuffer(Block blk)
Returns the buffer pinned to the specified block. The method returns null if the transaction has not pinned the block.

Parameters:
blk - a reference to the disk block
Returns:
the buffer pinned to that block

pin

void pin(Block blk)
Pins the block and keeps track of the buffer internally.

Parameters:
blk - a reference to the disk block

pinNew

Block pinNew(java.lang.String filename,
             PageFormatter fmtr)
Appends a new block to the specified file and pins it.

Parameters:
filename - the name of the file
fmtr - the formatter used to initialize the new page
Returns:
a reference to the newly-created block

unpin

void unpin(Block blk)
Unpins the specified block.

Parameters:
blk - a reference to the disk block

unpinAll

void unpinAll()
Unpins any buffers still pinned by this transaction.