| java.lang.Object jdbm.recman.RecordFile
RecordFile | final public class RecordFile (Code) | | This class represents a random access file as a set of fixed size
records. Each record has a physical record number, and records are
cached in order to improve access.
The set of dirty records on the in-use list constitutes a transaction.
Later on, we will send these records to some recovery thingy.
|
Constructor Summary | |
| RecordFile(String fileName) Creates a new object on the indicated filename. |
BLOCK_SIZE | final public static int BLOCK_SIZE(Code) | | The length of a single block.
|
cleanData | final static byte[] cleanData(Code) | | A block of clean data to wipe clean pages.
|
extension | final static String extension(Code) | | The extension of a record file
|
RecordFile | RecordFile(String fileName) throws IOException(Code) | | Creates a new object on the indicated filename. The file is
opened in read/write mode.
Parameters: fileName - the name of the file to open or create, withoutan extension. throws: IOException - whenever the creation of the underlyingRandomAccessFile throws it. |
commit | void commit() throws IOException(Code) | | Commits the current transaction by flushing all dirty buffers
to disk.
|
disableTransactions | void disableTransactions()(Code) | | Disables transactions: doesn't sync and doesn't use the
transaction manager.
|
discard | void discard(BlockIo block)(Code) | | Discards a block (will not write the block even if it's dirty)
Parameters: block - The block to discard. |
forceClose | void forceClose() throws IOException(Code) | | Force closing the file and underlying transaction manager.
Used for testing purposed only.
|
get | BlockIo get(long blockid) throws IOException(Code) | | Gets a block from the file. The returned byte array is
the in-memory copy of the record, and thus can be written
(and subsequently released with a dirty flag in order to
write the block back).
Parameters: blockid - The record number to retrieve. |
getFileName | String getFileName()(Code) | | Returns the file name.
|
release | void release(long blockid, boolean isDirty) throws IOException(Code) | | Releases a block.
Parameters: blockid - The record number to release. Parameters: isDirty - If true, the block was modified since the get(). |
release | void release(BlockIo block)(Code) | | Releases a block.
Parameters: block - The block to release. |
releaseFromTransaction | void releaseFromTransaction(BlockIo node, boolean recycle) throws IOException(Code) | | Releases a node from the transaction list, if it was sitting
there.
Parameters: recycle - true if block data can be reused |
rollback | void rollback() throws IOException(Code) | | Rollback the current transaction by discarding all dirty buffers
|
synch | void synch(BlockIo node) throws IOException(Code) | | Synchs a node to disk. This is called by the transaction manager's
synchronization code.
|
|
|