simpledb.tx.recovery
Class StartRecord

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

 class StartRecord
extends java.lang.Object
implements LogRecord


Field Summary
 
Fields inherited from interface simpledb.tx.recovery.LogRecord
CHECKPOINT, COMMIT, logMgr, ROLLBACK, SETINT, SETSTRING, START
 
Constructor Summary
StartRecord(BasicLogRecord rec)
          Creates a log record by reading one other value from the log.
StartRecord(int txnum)
          Creates a new start 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 start record contains no undo information.
 int writeToLog()
          Writes a start record to the log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StartRecord

public StartRecord(int txnum)
Creates a new start log record for the specified transaction.

Parameters:
txnum - the ID of the specified transaction

StartRecord

public StartRecord(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 start record to the log. This log record contains the START 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 start 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