⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logrecord.java

📁 用java语言简单实现数据库的初步功能
💻 JAVA
字号:
package simpledb.tx.recovery;import simpledb.log.LogMgr;import simpledb.server.SimpleDB;/** * The interface implemented by each type of log record. * @author Edward Sciore */public interface LogRecord {	/**	 * The six different types of log record	 */	static final int CHECKPOINT = 0, START = 1,					 COMMIT = 2, ROLLBACK  = 3,					 SETINT = 4, SETSTRING = 5;	static final LogMgr logMgr = SimpleDB.logMgr();	/**	 * Writes the record to the log and returns its LSN.	 * @return the LSN of the record in the log	 */	int writeToLog();		/**	 * Returns the log record's type. 	 * @return the log record's type	 */	int op();		/**	 * Returns the transaction id stored with	 * the log record.	 * @return the log record's transaction id	 */	int txNumber();		/**	 * Undoes the operation encoded by this log record.	 * The only log record types for which this method	 * does anything interesting are SETINT and SETSTRING.	 * @param txnum the id of the transaction that is performing the undo.	 */	void undo(int txnum);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -