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

📄 startrecord.java

📁 用java语言简单实现数据库的初步功能
💻 JAVA
字号:
package simpledb.tx.recovery;import simpledb.log.BasicLogRecord;class StartRecord implements LogRecord {	private int txnum;	/**	 * Creates a new start log record for the specified transaction.	 * @param txnum the ID of the specified transaction	 */	public StartRecord(int txnum) {		this.txnum = txnum;	}		/**	 * Creates a log record by reading one other value from the log.	 * @param rec the basic log record	 */	public StartRecord(BasicLogRecord rec) {		txnum = rec.nextInt();	}	/** 	 * Writes a start record to the log.	 * This log record contains the START operator,	 * followed by the transaction id.	 * @return the LSN of the last log value	 */	public int writeToLog() {		Object[] rec = new Object[] {START, txnum};		return logMgr.append(rec);	}	public int op() {		return LogRecord.START;	}	public int txNumber() {		return txnum;	}	public void undo(int txnum) {}	public String toString() {		return "<START " + txnum + ">";	}}

⌨️ 快捷键说明

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