|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjdbm.recman.RecordFile
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.
Field Summary | |
static int |
BLOCK_SIZE
The length of a single block. |
(package private) static byte[] |
cleanData
A block of clean data to wipe clean pages. |
(package private) static java.lang.String |
extension
The extension of a record file |
(package private) TransactionManager |
txnMgr
|
Constructor Summary | |
(package private) |
RecordFile(java.lang.String fileName)
Creates a new object on the indicated filename. |
Method Summary | |
(package private) void |
close()
Commits and closes file. |
(package private) void |
commit()
Commits the current transaction by flushing all dirty buffers to disk. |
(package private) void |
disableTransactions()
Disables transactions: doesn't sync and doesn't use the transaction manager. |
(package private) void |
discard(BlockIo block)
Discards a block (will not write the block even if it's dirty) |
(package private) void |
forceClose()
Force closing the file and underlying transaction manager. |
(package private) BlockIo |
get(long blockid)
Gets a block from the file. |
(package private) java.lang.String |
getFileName()
Returns the file name. |
(package private) void |
release(BlockIo block)
Releases a block. |
(package private) void |
release(long blockid,
boolean isDirty)
Releases a block. |
(package private) void |
releaseFromTransaction(BlockIo node,
boolean recycle)
Releases a node from the transaction list, if it was sitting there. |
(package private) void |
rollback()
Rollback the current transaction by discarding all dirty buffers |
(package private) void |
sync()
Synchronizes the file. |
(package private) void |
synch(BlockIo node)
Synchs a node to disk. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
final TransactionManager txnMgr
public static final int BLOCK_SIZE
static final java.lang.String extension
static final byte[] cleanData
Constructor Detail |
RecordFile(java.lang.String fileName) throws java.io.IOException
fileName
- the name of the file to open or create, without
an extension.
java.io.IOException
- whenever the creation of the underlying
RandomAccessFile throws it.Method Detail |
java.lang.String getFileName()
void disableTransactions()
BlockIo get(long blockid) throws java.io.IOException
blockid
- The record number to retrieve.
java.io.IOException
void release(long blockid, boolean isDirty) throws java.io.IOException
blockid
- The record number to release.isDirty
- If true, the block was modified since the get().
java.io.IOException
void release(BlockIo block)
block
- The block to release.void discard(BlockIo block)
block
- The block to discard.void commit() throws java.io.IOException
java.io.IOException
void rollback() throws java.io.IOException
java.io.IOException
void close() throws java.io.IOException
java.io.IOException
void forceClose() throws java.io.IOException
java.io.IOException
void synch(BlockIo node) throws java.io.IOException
java.io.IOException
void releaseFromTransaction(BlockIo node, boolean recycle) throws java.io.IOException
java.io.IOException
void sync() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |