📄 rollbackrecord.java
字号:
package simpledb.tx.recovery;import simpledb.log.BasicLogRecord;/** * The ROLLBACK log record. * @author Edward Sciore */class RollbackRecord implements LogRecord { private int txnum; /** * Creates a new rollback log record for the specified transaction. * @param txnum the ID of the specified transaction */ public RollbackRecord(int txnum) { this.txnum = txnum; } /** * Creates a log record by reading one other value from the log. * @param rec the basic log record */ public RollbackRecord(BasicLogRecord rec) { txnum = rec.nextInt(); } /** * Writes a rollback record to the log. * This log record contains the ROLLBACK operator, * followed by the transaction id. * @return the LSN of the last log value */ public int writeToLog() { Object[] rec = new Object[] {ROLLBACK, txnum}; return logMgr.append(rec); } public int op() { return LogRecord.ROLLBACK; } public int txNumber() { return txnum; } public void undo(int txnum) {} public String toString() { return "<ROLLBACK " + txnum + ">"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -