simpledb.tx.recovery
Class CheckpointRecord

java.lang.Object
  extended by simpledb.tx.recovery.CheckpointRecord
All Implemented Interfaces:
LogRecord

 class CheckpointRecord
extends java.lang.Object
implements LogRecord

The CHECKPOINT log record.

Author:
Edward Sciore

Field Summary
 
Fields inherited from interface simpledb.tx.recovery.LogRecord
CHECKPOINT, COMMIT, logMgr, ROLLBACK, SETINT, SETSTRING, START
 
Constructor Summary
CheckpointRecord()
          Creates a quiescent checkpoint record.
CheckpointRecord(BasicLogRecord rec)
          Creates a log record by reading no other values from the basic log record.
 
Method Summary
 int op()
          Returns the log record's type.
 java.lang.String toString()
           
 int txNumber()
          Checkpoint records have no associated transaction, and so the method returns a "dummy", negative txid.
 void undo(int txnum)
          Does nothing, because a checkpoint record contains no undo information.
 int writeToLog()
          Writes a checkpoint record to the log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CheckpointRecord

public CheckpointRecord()
Creates a quiescent checkpoint record.


CheckpointRecord

public CheckpointRecord(BasicLogRecord rec)
Creates a log record by reading no other values from the basic log record.

Parameters:
rec - the basic log record
Method Detail

writeToLog

public int writeToLog()
Writes a checkpoint record to the log. This log record contains the CHECKPOINT operator, and nothing else.

Specified by:
writeToLog in interface LogRecord
Returns:
the LSN of the last log value

op

public int op()
Description copied from interface: LogRecord
Returns the log record's type.

Specified by:
op in interface LogRecord
Returns:
the log record's type

txNumber

public int txNumber()
Checkpoint records have no associated transaction, and so the method returns a "dummy", negative txid.

Specified by:
txNumber in interface LogRecord
Returns:
the log record's transaction id

undo

public void undo(int txnum)
Does nothing, because a checkpoint record contains no undo information.

Specified by:
undo in interface LogRecord
Parameters:
txnum - the id of the transaction that is performing the undo.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object