simpledb.tx.recovery
Class RollbackRecord

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

 class RollbackRecord
extends java.lang.Object
implements LogRecord

The ROLLBACK log record.

Author:
Edward Sciore

Field Summary
 
Fields inherited from interface simpledb.tx.recovery.LogRecord
CHECKPOINT, COMMIT, logMgr, ROLLBACK, SETINT, SETSTRING, START
 
Constructor Summary
RollbackRecord(BasicLogRecord rec)
          Creates a log record by reading one other value from the log.
RollbackRecord(int txnum)
          Creates a new rollback log record for the specified transaction.
 
Method Summary
 int op()
          Returns the log record's type.
 java.lang.String toString()
           
 int txNumber()
          Returns the transaction id stored with the log record.
 void undo(int txnum)
          Does nothing, because a rollback record contains no undo information.
 int writeToLog()
          Writes a rollback record to the log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RollbackRecord

public RollbackRecord(int txnum)
Creates a new rollback log record for the specified transaction.

Parameters:
txnum - the ID of the specified transaction

RollbackRecord

public RollbackRecord(BasicLogRecord rec)
Creates a log record by reading one other value from the log.

Parameters:
rec - the basic log record
Method Detail

writeToLog

public int writeToLog()
Writes a rollback record to the log. This log record contains the ROLLBACK operator, followed by the transaction id.

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()
Description copied from interface: LogRecord
Returns the transaction id stored with the log record.

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

undo

public void undo(int txnum)
Does nothing, because a rollback 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