Quadcap Embeddable Database

com.quadcap.sql.file.Log Interface Reference

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

com.quadcap.sql.file.Log0 com.quadcap.sql.file.Log1 com.quadcap.sql.file.Log3 com.quadcap.sql.file.Log2 List of all members.

Detailed Description

Interface to logging subsystem.

Author:
Stan Bailes

Definition at line 53 of file Log.java.

Public Member Functions

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

void start ()
 Start the logging subsystem.

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

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

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

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 queue 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.

long getRowMap (long rowId)
 Retrieve a row mapping.

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.

void removeRowMap (long row)
 Discard a row mapping.

boolean isLogging ()
 Are you logging?

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.

void remove () throws IOException
 Remove the log.

boolean inRecovery () throws IOException
 Are we currently performing restart log recovery?


Member Function Documentation

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

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

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.Session.beginStatement(), com.quadcap.sql.file.Datafile.commitTransaction(), com.quadcap.sql.file.Datafile.doStep(), and com.quadcap.sql.file.Datafile.makeTransaction().

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

Perform a checkpoint operation.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.Datafile.close(), and com.quadcap.sql.file.Datafile.initFileDatabase().

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

Flush and close the log file.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

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

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

Flush all log records to disk.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.Datafile.commitTransaction().

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

Return the database that we're logging for.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

long com.quadcap.sql.file.Log.getRowMap long  rowId  ) 
 

Retrieve a row mapping.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.UpdateRow.redo(), com.quadcap.sql.InsertRow.redo(), com.quadcap.sql.UpdateRow.undo(), and com.quadcap.sql.InsertRow.undo().

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

Initialize the logging subsystem.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

boolean com.quadcap.sql.file.Log.inRecovery  )  throws IOException
 

Are we currently performing restart log recovery?

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.Datafile.inRecovery().

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

Are you logging?

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

void com.quadcap.sql.file.Log.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

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.InsertRow.redo(), com.quadcap.sql.InsertBlob.redo(), and com.quadcap.sql.DeleteRow.undo().

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

XXX why public?

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

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

Remove the log.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

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

void com.quadcap.sql.file.Log.removeRowMap long  row  ) 
 

Discard a row mapping.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.InsertRow.undo().

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

Reset the "before" list to be empty.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.BlockStore.clearModified().

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

Restart from a previous state.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase().

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

Restore all the "before" images.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase().

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

Statement rollback.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

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

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

Transaction rollback.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

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

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

Save a "before" image.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.MemoryBlockStore.write(), and com.quadcap.sql.file.BlockStore.write().

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

Start the logging subsystem.

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase().

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

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

Implemented in com.quadcap.sql.file.Log0, com.quadcap.sql.file.Log1, com.quadcap.sql.file.Log2, and com.quadcap.sql.file.Log3.

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