| java.lang.Object com.quadcap.sql.file.Log1
All known Subclasses: com.quadcap.sql.file.Log2,
Log1 | public class Log1 implements Log(Code) | | Rolling write-ahead log implementation. Checkpoints plus physical logging
of block writes is coupled with logical logging to support transactions
rollback and recovery.
author: Stan Bailes |
Inner Class :public static class Flush extends LogEntry | |
Inner Class :public static class Checkpoint extends LogEntry | |
Inner Class :public static class Close extends LogEntry | |
Inner Class :public class Rollback extends LogEntry | |
Inner Class :public class Sync extends LogEntry | |
Inner Class :class LogSync extends Thread | |
Constructor Summary | |
public | Log1() |
bfoActive | boolean bfoActive(Code) | | |
closeLatch | Latch closeLatch(Code) | | log sync thread done, close interlock
|
entryCount | int entryCount(Code) | | |
lastCheckpoint | long lastCheckpoint(Code) | | |
logSync | LogSync logSync(Code) | | log sync thread
|
maxSyncInterval | long maxSyncInterval(Code) | | |
minSyncInterval | long minSyncInterval(Code) | | |
opCheckpoint | static Checkpoint opCheckpoint(Code) | | |
opClose | static Close opClose(Code) | | A single static instance of this op is all we need.
|
opFlush | static Flush opFlush(Code) | | A single static instance of this op is all we need.
|
pendingBegins | int pendingBegins(Code) | | Add a transaction's log record to the end of the open log file
|
recovering | boolean recovering(Code) | | |
rowIdMap | LongMap rowIdMap(Code) | | Map rows during recovery, null otherwise.
|
sav | byte[] sav(Code) | | Save a "before" image
|
Log1 | public Log1()(Code) | | Constructor for transaction log
|
checkpoint | public void checkpoint() throws IOException(Code) | | Perform a checkpoint operation.
|
checksync | protected boolean checksync(int x)(Code) | | |
flushLog | public void flushLog() throws IOException(Code) | | Flush all log records to disk. Action not performed on this
thread, we're in a hurry....
|
getDatafile | public Datafile getDatafile()(Code) | | Return the database that we're logging for
|
getDbRootDir | public File getDbRootDir()(Code) | | Return the database root directory
|
getRowMap | final public long getRowMap(long rowId)(Code) | | Retrieve a row mapping.
|
inRecovery | public boolean inRecovery()(Code) | | Are we currently performing recovery?
|
init | public void init(Datafile db, boolean create, Properties props) throws IOException(Code) | | Initialize the log
Parameters: db - the underlying database that we're logging for. Parameters: create - true if we're creating this database from scratch,in which case we can skip any recovery-related activity |
isLogging | public boolean isLogging()(Code) | | Are you logging?
Oh yes.
|
put | public void put(LogEntry h) throws IOException(Code) | | XXXX Problem: If you have "the lock" and you call this when the channel
is full, you may block. This would be bad, because it might block
the log thread trying to get the lock, leading to deadlock
|
putRowMap | final public void putRowMap(long logRow, long fileRow)(Code) | | Remember a row mapping {old,new} The old row (logRow) is now stored
in a new place (fileRow), so any stored log entries that refer to
the old row need to be translated to use the new row.
Parameters: logRow - the "old" row Parameters: fileRow - the "new" row |
removeRowMap | final public void removeRowMap(long row)(Code) | | |
resetBlocks | public void resetBlocks() throws IOException(Code) | | Reset the "before" list to be empty
|
restart | public void restart() throws Exception(Code) | | Restart from a previous state
|
restoreBlocks | public void restoreBlocks() throws IOException(Code) | | Restore all the "before" images
|
start | public void start()(Code) | | |
sync | public void sync() throws IOException(Code) | | Wait for all queued ops to be processed by the log sync thread
|
|
|