Quadcap Embeddable Database

com.quadcap.sql.file.Log1 Class Reference

Inheritance diagram for com.quadcap.sql.file.Log1:

com.quadcap.sql.file.Log com.quadcap.sql.file.Log2 List of all members.

Detailed Description

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

Definition at line 71 of file Log1.java.

Public Member Functions

 Log1 ()
 Constructor for transaction log.

void init (Datafile db, boolean create, Properties props) throws IOException
 Initialize the log.

void start ()
 Start the logging subsystem.

void remove () throws IOException
 Remove the log.

Datafile getDatafile ()
 Return the database that we're logging for.

File getDbRootDir ()
 Return the database root directory.

void addEntry (LogEntry entry) throws IOException
 Add a transaction's log record to the end of the open log file.

void close () throws IOException
 Flush and close the log file.

void flushLog () throws IOException
 Flush all log records to disk.

void checkpoint () throws IOException
 Perform a checkpoint operation.

void sync () throws IOException
 Wait for all queued ops to be processed by the log sync thread.

void rollbackTransaction (Transaction trans) throws IOException
 Transaction rollback.

void rollbackStatement (Transaction trans, int stmtId) throws IOException
 Statement rollback.

void restart () throws Exception
 Restart from a previous state.

final long getRowMap (long rowId)
 Retrieve a row mapping.

final void putRowMap (long logRow, long fileRow)
 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.

final void removeRowMap (long row)
 Discard a row mapping.

void reallyAddEntry (LogEntry entry) throws IOException
 XXX why public?

void put (LogEntry h) throws IOException
 XXXX Problem: If you have "the lock" and you call this when the channel is full, you may block.

boolean isLogging ()
 Are you logging?

boolean inRecovery ()
 Are we currently performing recovery?

void saveBlock (long b) throws IOException
 Save a "before" image.

void restoreBlocks () throws IOException
 Restore all the "before" images.

void resetBlocks () throws IOException
 Reset the "before" list to be empty.

String toString ()

Protected Member Functions

boolean checksync (int x)

Package Functions

void reallyFlush () throws IOException
void reallyClose () throws IOException
void reallyRollbackTransaction (Transaction tr) throws Exception
void reallyRollbackStatement (Transaction tr, int s) throws Exception
LogEntry scanLog (LongMap t) throws IOException
void reallyRestart () throws Exception
void maybeCheckpoint () throws IOException
void reallyCheckpoint () throws IOException

Package Attributes

Logger logger
 Log writer/reader.

LogSync logSync
 log sync thread

Latch closeLatch = new Latch()
 log sync thread done, close interlock

 producer/consumer conduit

Object fileLock
 our datatbase's file lock

LongMap rowIdMap = new LongMap(256)
 Map rows during recovery, null otherwise.

FileOutputStream bfo
 "before-images" file

boolean bfoActive = false
boolean recovering = false
int blockSize
long minSyncInterval = ConfigNumber.find("qed.minSyncInterval", "15000").longValue()
long maxSyncInterval = ConfigNumber.find("qed.maxSyncInterval", "60000").longValue()
int syncMap
String[] syncStrs
int[] syncCnts = new int[syncStrs.length]
int pendingBegins = 0
 Add a transaction's log record to the end of the open log file.

long lastCheckpoint = System.currentTimeMillis()
int entryCount = 0
int filepos = 0
byte[] sav = null
 Save a "before" image.


Static Package Attributes

Flush opFlush = new Flush()
 A single static instance of this op is all we need.

Checkpoint opCheckpoint = new Checkpoint()
Close opClose = new Close()
 A single static instance of this op is all we need.


Private Member Functions

void sortEntry (long tId, List save, List discard, LogEntry e)
final void abortOldestTransaction (LogEntry entry) throws IOException

Private Attributes

Datafile db
 the database we're logging for

BlockFile dbFile
 the database file we're logging for

File dbRootDir
 log file directory


Constructor & Destructor Documentation

com.quadcap.sql.file.Log1.Log1  ) 
 

Constructor for transaction log.

Definition at line 168 of file Log1.java.


Member Function Documentation

final void com.quadcap.sql.file.Log1.abortOldestTransaction LogEntry  entry  )  throws IOException [private]
 

Definition at line 656 of file Log1.java.

References com.quadcap.sql.lock.TransactionObserver.abort(), com.quadcap.sql.file.Log1.abortOldestTransaction(), com.quadcap.sql.file.Log1.channel, com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.Datafile.findTransaction(), com.quadcap.sql.lock.Transaction.getObserver(), com.quadcap.sql.file.Logger.getOldestTransaction(), com.quadcap.sql.file.LogEntry.handle(), com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Log1.reallyCheckpoint(), com.quadcap.sql.file.Logger.reset(), and com.quadcap.sql.file.LogEntry.undo().

Referenced by com.quadcap.sql.file.Log1.abortOldestTransaction(), and com.quadcap.sql.file.Log1.reallyAddEntry().

void com.quadcap.sql.file.Log1.addEntry LogEntry  entry  )  throws IOException
 

Add a transaction's log record to the end of the open log file.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 259 of file Log1.java.

References com.quadcap.sql.file.Log1.addEntry(), com.quadcap.sql.file.Log1.pendingBegins, and com.quadcap.sql.file.Log1.put().

Referenced by com.quadcap.sql.file.Log1.addEntry().

void com.quadcap.sql.file.Log1.checkpoint  )  throws IOException
 

Perform a checkpoint operation.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 290 of file Log1.java.

References com.quadcap.sql.file.Log1.opCheckpoint, and com.quadcap.sql.file.Log1.put().

Referenced by com.quadcap.sql.file.Log1.reallyRestart().

boolean com.quadcap.sql.file.Log1.checksync int  x  )  [protected]
 

Definition at line 155 of file Log1.java.

References com.quadcap.sql.file.Log1.checksync(), com.quadcap.sql.file.Log1.syncCnts, and com.quadcap.sql.file.Log1.syncMap.

Referenced by com.quadcap.sql.file.Log1.checksync().

void com.quadcap.sql.file.Log1.close  )  throws IOException
 

Flush and close the log file.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 271 of file Log1.java.

References com.quadcap.sql.file.Log1.closeLatch, com.quadcap.sql.file.Log1.opClose, and com.quadcap.sql.file.Log1.put().

Referenced by com.quadcap.sql.file.Log1.LogSync.run().

void com.quadcap.sql.file.Log1.flushLog  )  throws IOException
 

Flush all log records to disk.

Action not performed on this thread, we're in a hurry....

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 283 of file Log1.java.

References com.quadcap.sql.file.Log1.opFlush, and com.quadcap.sql.file.Log1.put().

Datafile com.quadcap.sql.file.Log1.getDatafile  ) 
 

Return the database that we're logging for.

Implements com.quadcap.sql.file.Log.

Definition at line 248 of file Log1.java.

References com.quadcap.sql.file.Log1.db.

File com.quadcap.sql.file.Log1.getDbRootDir  ) 
 

Return the database root directory.

Definition at line 253 of file Log1.java.

References com.quadcap.sql.file.Log1.dbRootDir.

final long com.quadcap.sql.file.Log1.getRowMap long  rowId  ) 
 

Retrieve a row mapping.

Implements com.quadcap.sql.file.Log.

Definition at line 338 of file Log1.java.

References com.quadcap.sql.file.Log1.getRowMap(), and com.quadcap.sql.file.Log1.rowIdMap.

Referenced by com.quadcap.sql.file.Log1.getRowMap().

void com.quadcap.sql.file.Log1.init Datafile  db,
boolean  create,
Properties  props
throws IOException
 

Initialize the log.

Parameters:
db the underlying database that we're logging for.
create true if we're creating this database from scratch, in which case we can skip any recovery-related activity

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 177 of file Log1.java.

References com.quadcap.sql.file.BlockFile.blockSize, com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.Log1.dbFile, com.quadcap.sql.file.Datafile.dbRootDir, com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.BlockFile.getBlockSize(), com.quadcap.sql.file.Datafile.getFileLock(), com.quadcap.sql.file.Logger.init(), com.quadcap.sql.file.Log1.init(), com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Log1.maxSyncInterval, and com.quadcap.sql.file.Log1.minSyncInterval.

Referenced by com.quadcap.sql.file.Log1.init().

boolean com.quadcap.sql.file.Log1.inRecovery  ) 
 

Are we currently performing recovery?

Implements com.quadcap.sql.file.Log.

Definition at line 889 of file Log1.java.

References com.quadcap.sql.file.Log1.recovering.

boolean com.quadcap.sql.file.Log1.isLogging  ) 
 

Are you logging?

Oh yes.

Implements com.quadcap.sql.file.Log.

Definition at line 884 of file Log1.java.

void com.quadcap.sql.file.Log1.maybeCheckpoint  )  throws IOException [package]
 

Definition at line 557 of file Log1.java.

References com.quadcap.sql.file.Log1.entryCount, com.quadcap.sql.file.Logger.getActiveTransactionCount(), com.quadcap.sql.file.Log1.lastCheckpoint, com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Log1.maxSyncInterval, com.quadcap.sql.file.Log1.minSyncInterval, com.quadcap.sql.file.Log1.reallyCheckpoint(), and com.quadcap.sql.file.Log1.rowIdMap.

Referenced by com.quadcap.sql.file.Log2.flushLog(), and com.quadcap.sql.file.Log1.LogSync.run().

void com.quadcap.sql.file.Log1.put LogEntry  h  )  throws IOException
 

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

Definition at line 726 of file Log1.java.

References com.quadcap.sql.file.Log1.channel, and com.quadcap.sql.file.Log1.put().

Referenced by com.quadcap.sql.file.Log1.addEntry(), com.quadcap.sql.file.Log1.checkpoint(), com.quadcap.sql.file.Log1.close(), com.quadcap.sql.file.Log1.flushLog(), com.quadcap.sql.file.Log1.put(), com.quadcap.sql.file.Log1.rollbackStatement(), com.quadcap.sql.file.Log1.rollbackTransaction(), and com.quadcap.sql.file.Log1.sync().

final void com.quadcap.sql.file.Log1.putRowMap long  logRow,
long  fileRow
 

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
fileRow the "new" row

Implements com.quadcap.sql.file.Log.

Definition at line 355 of file Log1.java.

References com.quadcap.sql.file.Log1.putRowMap(), and com.quadcap.sql.file.Log1.rowIdMap.

Referenced by com.quadcap.sql.file.Log1.putRowMap().

void com.quadcap.sql.file.Log1.reallyAddEntry LogEntry  entry  )  throws IOException
 

XXX why public?

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 626 of file Log1.java.

References com.quadcap.sql.file.Log1.abortOldestTransaction(), com.quadcap.sql.file.Log1.entryCount, com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Log1.pendingBegins, com.quadcap.sql.file.Logger.put(), com.quadcap.sql.file.Log1.reallyAddEntry(), and com.quadcap.sql.file.Log1.toString().

Referenced by com.quadcap.sql.file.Log1.reallyAddEntry().

void com.quadcap.sql.file.Log1.reallyCheckpoint  )  throws IOException [package]
 

Definition at line 582 of file Log1.java.

References com.quadcap.sql.file.Datafile.checkpoint(), com.quadcap.sql.file.Logger.checkpoint(), com.quadcap.sql.file.Datafile.checkpointHandler(), com.quadcap.sql.file.BlockFile.clearModified(), com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.Log1.dbFile, com.quadcap.sql.file.Cacheable.decrRefCount(), com.quadcap.sql.file.BlockFile.flush(), com.quadcap.sql.file.Datafile.flushRoot(), com.quadcap.sql.file.Logger.getActiveTransactionCount(), com.quadcap.sql.file.Logger.getActiveTransactions(), com.quadcap.sql.file.BlockFile.getBlock(), com.quadcap.sql.file.BlockFile.getBlockSize(), com.quadcap.sql.file.BlockFile.getSize(), com.quadcap.sql.file.Log1.lastCheckpoint, com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Log1.pendingBegins, com.quadcap.sql.file.Block.readLong(), com.quadcap.sql.file.Logger.reset(), com.quadcap.sql.file.Log1.rowIdMap, and com.quadcap.sql.file.Logger.sync().

Referenced by com.quadcap.sql.file.Log1.abortOldestTransaction(), com.quadcap.sql.file.Log2.checkpoint(), and com.quadcap.sql.file.Log1.maybeCheckpoint().

void com.quadcap.sql.file.Log1.reallyClose  )  throws IOException [package]
 

Definition at line 376 of file Log1.java.

References com.quadcap.sql.file.Log1.bfo, com.quadcap.sql.file.Log1.LogSync.close(), and com.quadcap.sql.file.Log1.logSync.

Referenced by com.quadcap.sql.file.Log2.close().

void com.quadcap.sql.file.Log1.reallyFlush  )  throws IOException [package]
 

Definition at line 364 of file Log1.java.

References com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.BlockFile.flush(), com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Logger.sync(), and com.quadcap.sql.file.Datafile.tempFile.

Referenced by com.quadcap.sql.file.Log2.flushLog().

void com.quadcap.sql.file.Log1.reallyRestart  )  throws Exception [package]
 

Definition at line 482 of file Log1.java.

References com.quadcap.sql.file.Log1.checkpoint(), com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.Logger.getCheckpoint(), com.quadcap.sql.file.LogEntry.getCode(), com.quadcap.sql.file.Logger.getEnd(), com.quadcap.sql.file.Logger.getFirstOp(), com.quadcap.sql.file.Logger.getNextOp(), com.quadcap.sql.file.LogEntry.getPosition(), com.quadcap.sql.file.Logger.getPrevOp(), com.quadcap.sql.file.LogEntry.getRedoState(), com.quadcap.sql.file.Datafile.getTempFile(), com.quadcap.sql.file.LogEntry.getTransactionId(), com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Datafile.makeTransaction(), com.quadcap.sql.file.Log1.recovering, com.quadcap.sql.file.LogEntry.redo(), com.quadcap.sql.file.Logger.reset(), com.quadcap.sql.file.Log1.rowIdMap, com.quadcap.sql.file.Logger.sync(), com.quadcap.sql.file.Log1.toString(), and com.quadcap.sql.file.LogEntry.undo().

Referenced by com.quadcap.sql.file.Log2.restart(), and com.quadcap.sql.file.Log1.restart().

void com.quadcap.sql.file.Log1.reallyRollbackStatement Transaction  tr,
int  s
throws Exception [package]
 

Definition at line 433 of file Log1.java.

References com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.LogEntry.getCode(), com.quadcap.sql.file.Logger.getLastOp(), com.quadcap.sql.file.Logger.getPrevOp(), com.quadcap.sql.file.LogEntry.getRedoState(), com.quadcap.sql.file.LogEntry.getStatementId(), com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Log1.reallyRollbackStatement(), com.quadcap.sql.file.Log1.rowIdMap, com.quadcap.sql.file.Logger.setRedoState(), com.quadcap.sql.file.LogEntry.undo(), and com.quadcap.sql.file.LogEntry.UNDONE.

Referenced by com.quadcap.sql.file.Log1.reallyRollbackStatement().

void com.quadcap.sql.file.Log1.reallyRollbackTransaction Transaction  tr  )  throws Exception [package]
 

Definition at line 393 of file Log1.java.

References com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.LogEntry.getCode(), com.quadcap.sql.file.Logger.getLastOp(), com.quadcap.sql.file.LogEntry.getPrev(), com.quadcap.sql.file.Logger.getPrevOp(), com.quadcap.sql.file.LogEntry.getRedoState(), com.quadcap.sql.file.LogEntry.getTransactionId(), com.quadcap.sql.file.Log1.logger, com.quadcap.sql.file.Log1.reallyRollbackTransaction(), com.quadcap.sql.file.Log1.rowIdMap, com.quadcap.sql.file.Logger.setRedoState(), com.quadcap.sql.file.LogEntry.undo(), and com.quadcap.sql.file.LogEntry.UNDONE.

Referenced by com.quadcap.sql.file.Log1.reallyRollbackTransaction().

void com.quadcap.sql.file.Log1.remove  )  throws IOException
 

Remove the log.

Implements com.quadcap.sql.file.Log.

Definition at line 241 of file Log1.java.

References com.quadcap.sql.file.Log1.dbRootDir.

final void com.quadcap.sql.file.Log1.removeRowMap long  row  ) 
 

Discard a row mapping.

Implements com.quadcap.sql.file.Log.

Definition at line 360 of file Log1.java.

References com.quadcap.sql.file.Log1.removeRowMap(), and com.quadcap.sql.file.Log1.rowIdMap.

Referenced by com.quadcap.sql.file.Log1.removeRowMap().

void com.quadcap.sql.file.Log1.resetBlocks  )  throws IOException
 

Reset the "before" list to be empty.

Implements com.quadcap.sql.file.Log.

Definition at line 981 of file Log1.java.

References com.quadcap.sql.file.Log1.bfo, com.quadcap.sql.file.Log1.bfoActive, com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.Log1.dbFile, com.quadcap.sql.file.Log1.filepos, com.quadcap.sql.file.Datafile.getScratchDir(), com.quadcap.sql.file.BlockFile.getSize(), and com.quadcap.sql.file.Datafile.toString().

Referenced by com.quadcap.sql.file.Log1.saveBlock().

void com.quadcap.sql.file.Log1.restart  )  throws Exception
 

Restart from a previous state.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 329 of file Log1.java.

References com.quadcap.sql.file.Log1.reallyRestart().

void com.quadcap.sql.file.Log1.restoreBlocks  )  throws IOException
 

Restore all the "before" images.

Implements com.quadcap.sql.file.Log.

Definition at line 927 of file Log1.java.

References com.quadcap.sql.file.Log1.blockSize, com.quadcap.sql.file.Log1.db, com.quadcap.sql.file.Log1.dbFile, com.quadcap.sql.file.Cacheable.decrRefCount(), com.quadcap.sql.file.BlockFile.getBlock(), com.quadcap.sql.file.BlockFile.getBlockSize(), com.quadcap.sql.file.Datafile.getScratchDir(), com.quadcap.sql.file.BlockFile.getSize(), com.quadcap.sql.file.Block.readLong(), com.quadcap.sql.file.BlockFile.restoreBlock(), and com.quadcap.sql.file.Datafile.toString().

void com.quadcap.sql.file.Log1.rollbackStatement Transaction  trans,
int  stmtId
throws IOException
 

Statement rollback.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 319 of file Log1.java.

References com.quadcap.sql.file.Log1.put(), com.quadcap.sql.file.Log1.rollbackStatement(), and com.quadcap.sql.file.Log1.sync().

Referenced by com.quadcap.sql.file.Log1.rollbackStatement().

void com.quadcap.sql.file.Log1.rollbackTransaction Transaction  trans  )  throws IOException
 

Transaction rollback.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 309 of file Log1.java.

References com.quadcap.sql.file.Log1.put(), com.quadcap.sql.file.Log1.rollbackTransaction(), and com.quadcap.sql.file.Log1.sync().

Referenced by com.quadcap.sql.file.Log1.rollbackTransaction().

void com.quadcap.sql.file.Log1.saveBlock long  b  )  throws IOException
 

Save a "before" image.

Implements com.quadcap.sql.file.Log.

Definition at line 901 of file Log1.java.

References com.quadcap.sql.file.Log1.bfo, com.quadcap.sql.file.Log1.bfoActive, com.quadcap.sql.file.Log1.blockSize, com.quadcap.sql.file.Log1.dbFile, com.quadcap.sql.file.Log1.filepos, com.quadcap.sql.file.BlockStore.read(), com.quadcap.sql.file.Log1.resetBlocks(), com.quadcap.sql.file.Log1.sav, com.quadcap.sql.file.Log1.saveBlock(), and com.quadcap.sql.file.BlockFile.store.

Referenced by com.quadcap.sql.file.Log1.saveBlock().

LogEntry com.quadcap.sql.file.Log1.scanLog LongMap  t  )  throws IOException [package]
 

Definition at line 469 of file Log1.java.

References com.quadcap.sql.file.LogEntry.getCode(), com.quadcap.sql.file.Logger.getFirstOp(), com.quadcap.sql.file.Logger.getNextOp(), com.quadcap.sql.file.LogEntry.getTransactionId(), com.quadcap.sql.file.Log1.logger, and com.quadcap.sql.file.Log1.scanLog().

Referenced by com.quadcap.sql.file.Log1.scanLog().

void com.quadcap.sql.file.Log1.sortEntry long  tId,
List  save,
List  discard,
LogEntry  e
[private]
 

Definition at line 648 of file Log1.java.

References com.quadcap.sql.file.LogEntry.getTransactionId(), and com.quadcap.sql.file.Log1.sortEntry().

Referenced by com.quadcap.sql.file.Log1.sortEntry().

void com.quadcap.sql.file.Log1.start  ) 
 

Start the logging subsystem.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 235 of file Log1.java.

References com.quadcap.sql.file.Log1.logSync.

void com.quadcap.sql.file.Log1.sync  )  throws IOException
 

Wait for all queued ops to be processed by the log sync thread.

Implements com.quadcap.sql.file.Log.

Reimplemented in com.quadcap.sql.file.Log2.

Definition at line 297 of file Log1.java.

References com.quadcap.sql.file.Log1.put().

Referenced by com.quadcap.sql.file.Log1.rollbackStatement(), and com.quadcap.sql.file.Log1.rollbackTransaction().

String com.quadcap.sql.file.Log1.toString  ) 
 

Definition at line 1000 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.reallyAddEntry(), and com.quadcap.sql.file.Log1.reallyRestart().


Member Data Documentation

FileOutputStream com.quadcap.sql.file.Log1.bfo [package]
 

"before-images" file

Definition at line 100 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.reallyClose(), com.quadcap.sql.file.Log1.resetBlocks(), and com.quadcap.sql.file.Log1.saveBlock().

boolean com.quadcap.sql.file.Log1.bfoActive = false [package]
 

Definition at line 101 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.resetBlocks(), and com.quadcap.sql.file.Log1.saveBlock().

int com.quadcap.sql.file.Log1.blockSize [package]
 

Definition at line 105 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.restoreBlocks(), and com.quadcap.sql.file.Log1.saveBlock().

 

producer/consumer conduit

Definition at line 91 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.abortOldestTransaction(), and com.quadcap.sql.file.Log1.put().

Latch com.quadcap.sql.file.Log1.closeLatch = new Latch() [package]
 

log sync thread done, close interlock

Definition at line 88 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.close().

Datafile com.quadcap.sql.file.Log1.db [private]
 

the database we're logging for

Definition at line 73 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.abortOldestTransaction(), com.quadcap.sql.file.Log1.getDatafile(), com.quadcap.sql.file.Log1.init(), com.quadcap.sql.file.Log1.reallyCheckpoint(), com.quadcap.sql.file.Log1.reallyFlush(), com.quadcap.sql.file.Log1.reallyRestart(), com.quadcap.sql.file.Log1.reallyRollbackStatement(), com.quadcap.sql.file.Log1.reallyRollbackTransaction(), com.quadcap.sql.file.Log1.resetBlocks(), and com.quadcap.sql.file.Log1.restoreBlocks().

BlockFile com.quadcap.sql.file.Log1.dbFile [private]
 

the database file we're logging for

Definition at line 76 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.init(), com.quadcap.sql.file.Log1.reallyCheckpoint(), com.quadcap.sql.file.Log1.resetBlocks(), com.quadcap.sql.file.Log1.restoreBlocks(), and com.quadcap.sql.file.Log1.saveBlock().

File com.quadcap.sql.file.Log1.dbRootDir [private]
 

log file directory

Definition at line 82 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.getDbRootDir(), and com.quadcap.sql.file.Log1.remove().

int com.quadcap.sql.file.Log1.entryCount = 0 [package]
 

Definition at line 623 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.maybeCheckpoint(), and com.quadcap.sql.file.Log1.reallyAddEntry().

Object com.quadcap.sql.file.Log1.fileLock [package]
 

our datatbase's file lock

Definition at line 94 of file Log1.java.

int com.quadcap.sql.file.Log1.filepos = 0 [package]
 

Definition at line 894 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.resetBlocks(), and com.quadcap.sql.file.Log1.saveBlock().

long com.quadcap.sql.file.Log1.lastCheckpoint = System.currentTimeMillis() [package]
 

Definition at line 555 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.maybeCheckpoint(), and com.quadcap.sql.file.Log1.reallyCheckpoint().

Logger com.quadcap.sql.file.Log1.logger [package]
 

Log writer/reader.

Definition at line 79 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.abortOldestTransaction(), com.quadcap.sql.file.Log1.init(), com.quadcap.sql.file.Log1.maybeCheckpoint(), com.quadcap.sql.file.Log1.reallyAddEntry(), com.quadcap.sql.file.Log1.reallyCheckpoint(), com.quadcap.sql.file.Log1.reallyFlush(), com.quadcap.sql.file.Log1.reallyRestart(), com.quadcap.sql.file.Log1.reallyRollbackStatement(), com.quadcap.sql.file.Log1.reallyRollbackTransaction(), and com.quadcap.sql.file.Log1.scanLog().

LogSync com.quadcap.sql.file.Log1.logSync [package]
 

log sync thread

Definition at line 85 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.reallyClose(), and com.quadcap.sql.file.Log1.start().

long com.quadcap.sql.file.Log1.maxSyncInterval = ConfigNumber.find("qed.maxSyncInterval", "60000").longValue() [package]
 

Definition at line 129 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.init(), and com.quadcap.sql.file.Log1.maybeCheckpoint().

long com.quadcap.sql.file.Log1.minSyncInterval = ConfigNumber.find("qed.minSyncInterval", "15000").longValue() [package]
 

Definition at line 116 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.init(), and com.quadcap.sql.file.Log1.maybeCheckpoint().

Checkpoint com.quadcap.sql.file.Log1.opCheckpoint = new Checkpoint() [static, package]
 

Definition at line 761 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.checkpoint().

Close com.quadcap.sql.file.Log1.opClose = new Close() [static, package]
 

A single static instance of this op is all we need.

Definition at line 776 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.close().

Flush com.quadcap.sql.file.Log1.opFlush = new Flush() [static, package]
 

A single static instance of this op is all we need.

Definition at line 750 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.flushLog().

int com.quadcap.sql.file.Log1.pendingBegins = 0 [package]
 

Add a transaction's log record to the end of the open log file.

Definition at line 258 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.addEntry(), com.quadcap.sql.file.Log1.reallyAddEntry(), and com.quadcap.sql.file.Log1.reallyCheckpoint().

boolean com.quadcap.sql.file.Log1.recovering = false [package]
 

Definition at line 103 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.inRecovery(), and com.quadcap.sql.file.Log1.reallyRestart().

LongMap com.quadcap.sql.file.Log1.rowIdMap = new LongMap(256) [package]
 

Map rows during recovery, null otherwise.

Definition at line 97 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.getRowMap(), com.quadcap.sql.file.Log1.maybeCheckpoint(), com.quadcap.sql.file.Log1.putRowMap(), com.quadcap.sql.file.Log1.reallyCheckpoint(), com.quadcap.sql.file.Log1.reallyRestart(), com.quadcap.sql.file.Log1.reallyRollbackStatement(), com.quadcap.sql.file.Log1.reallyRollbackTransaction(), and com.quadcap.sql.file.Log1.removeRowMap().

byte [] com.quadcap.sql.file.Log1.sav = null [package]
 

Save a "before" image.

Definition at line 900 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.saveBlock().

int [] com.quadcap.sql.file.Log1.syncCnts = new int[syncStrs.length] [package]
 

Definition at line 153 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.checksync().

int com.quadcap.sql.file.Log1.syncMap [package]
 

Initial value:

0 + (1 << 1) + (1 << 2) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 7) + 0

Definition at line 131 of file Log1.java.

Referenced by com.quadcap.sql.file.Log1.checksync().

String [] com.quadcap.sql.file.Log1.syncStrs [package]
 

Initial value:

{ "Log1.reallyFlush from Log2.flushLog", "Log1.reallyFlush: bfo.sync()", "Log1.reallyFlush: logger.sync()", "Log1.reallyFlush: db.tempFile.flush(!)", "Log1.reallyCheckpoint: dbfile.flush(!)", "Log1.reallyCheckpoint: logger.sync()", "Log1.reallyCheckpoint: dbfile.checkpoint(!)", "Log1.saveBlock: bfo.sync" }

Definition at line 142 of file Log1.java.