Uses of Class
edu.caltech.nanodb.storage.writeahead.LogSequenceNumber
-
Packages that use LogSequenceNumber Package Description edu.caltech.nanodb.storage This package contains the classes for the Storage Manager, which is responsible for how data is stored in and retrieved from database files.edu.caltech.nanodb.storage.writeahead This package contains the implementation for the write-ahead log, which allows us to provide transaction atomicity, consistency and durability.edu.caltech.nanodb.transactions This package contains classes for managing transactions at the logical level, such as concurrency control and isolation, deadlock detection and aborting transactions. -
-
Uses of LogSequenceNumber in edu.caltech.nanodb.storage
Fields in edu.caltech.nanodb.storage declared as LogSequenceNumber Modifier and Type Field Description private LogSequenceNumber
DBPage. pageLSN
For dirty pages, this field is set to the Log Sequence Number of the write-ahead log record corresponding to the most recent write to the page.Methods in edu.caltech.nanodb.storage that return LogSequenceNumber Modifier and Type Method Description LogSequenceNumber
DBPage. getPageLSN()
Methods in edu.caltech.nanodb.storage with parameters of type LogSequenceNumber Modifier and Type Method Description void
DBPage. setPageLSN(LogSequenceNumber lsn)
-
Uses of LogSequenceNumber in edu.caltech.nanodb.storage.writeahead
Fields in edu.caltech.nanodb.storage.writeahead declared as LogSequenceNumber Modifier and Type Field Description LogSequenceNumber
RecoveryInfo. firstLSN
This is the log sequence number to start recovery processing from.private LogSequenceNumber
WALManager. firstLSN
This object holds the log sequence number of the first write-ahead log record where recovery would need to start from.LogSequenceNumber
RecoveryInfo. nextLSN
This is the "next LSN", one past the last valid log sequence number found in the write-ahead logs.private LogSequenceNumber
WALManager. nextLSN
This object holds the log sequence number where the next write-ahead log record will be written.Fields in edu.caltech.nanodb.storage.writeahead with type parameters of type LogSequenceNumber Modifier and Type Field Description java.util.HashMap<java.lang.Integer,LogSequenceNumber>
RecoveryInfo. incompleteTxns
This is the set of incomplete transactions found during recovery processing, along with the last log sequence number seen for each transaction.Methods in edu.caltech.nanodb.storage.writeahead that return LogSequenceNumber Modifier and Type Method Description LogSequenceNumber
LogSequenceNumber. clone()
static LogSequenceNumber
WALManager. computeNextLSN(int fileNo, int fileOffset)
This static helper function takes the file number of a WAL file, and the offset in the WAL file where the next write-ahead log record would go if the WAL file can hold more data, and then creates a newLogSequenceNumber
object, wrapping to the next file if necessary.LogSequenceNumber
WALManager. getFirstLSN()
LogSequenceNumber
RecoveryInfo. getLastLSN(int transactionID)
This helper method returns the last log sequence number seen for the specified transaction.LogSequenceNumber
WALManager. getNextLSN()
private LogSequenceNumber
WALManager. writeRedoOnlyUpdatePageRecord(int transactionID, LogSequenceNumber prevLSN, DBPage dbPage, int numSegments, byte[] changes)
This method writes a redo-only update-page record to the write-ahead log, including only redo details.private LogSequenceNumber
WALManager. writeRedoOnlyUpdatePageRecord(DBPage dbPage, int numSegments, byte[] changes)
This method writes a redo-only update-page record to the write-ahead log, including only redo details.LogSequenceNumber
WALManager. writeTxnRecord(WALRecordType type)
This function writes a transaction demarcation record (WALRecordType.START_TXN
,WALRecordType.COMMIT_TXN
, orWALRecordType.ABORT_TXN
) to the write-ahead log.private LogSequenceNumber
WALManager. writeTxnRecord(WALRecordType type, int transactionID, LogSequenceNumber prevLSN)
This function writes a transaction demarcation record (WALRecordType.START_TXN
,WALRecordType.COMMIT_TXN
, orWALRecordType.ABORT_TXN
) to the write-ahead log.Methods in edu.caltech.nanodb.storage.writeahead with parameters of type LogSequenceNumber Modifier and Type Method Description int
LogSequenceNumber. compareTo(LogSequenceNumber lsn)
RecoveryInfo
WALManager. doRecovery(LogSequenceNumber storedFirstLSN, LogSequenceNumber storedNextLSN)
Performs recovery processing starting at the specified log sequence number, and returns the LSN where the next recovery process should start from.private DBFileReader
WALManager. getWALFileReader(LogSequenceNumber lsn, DBFileReader reader)
This method opens the WAL file specified in the passed-in Log Sequence Number, wraps it with aDBFileReader
so that it can be read from, and then seeks to the specified file offset.private DBFileWriter
WALManager. getWALFileWriter(LogSequenceNumber lsn)
This method opens the WAL file specified in the passed-in Log Sequence Number, wraps it with aDBFileWriter
so that it can be read and written, and then seeks to the specified file offset.void
RecoveryInfo. updateInfo(int transactionID, LogSequenceNumber lsn)
This helper method updates the recovery information with the specified transaction ID and log sequence number.private LogSequenceNumber
WALManager. writeRedoOnlyUpdatePageRecord(int transactionID, LogSequenceNumber prevLSN, DBPage dbPage, int numSegments, byte[] changes)
This method writes a redo-only update-page record to the write-ahead log, including only redo details.private LogSequenceNumber
WALManager. writeTxnRecord(WALRecordType type, int transactionID, LogSequenceNumber prevLSN)
This function writes a transaction demarcation record (WALRecordType.START_TXN
,WALRecordType.COMMIT_TXN
, orWALRecordType.ABORT_TXN
) to the write-ahead log.Constructors in edu.caltech.nanodb.storage.writeahead with parameters of type LogSequenceNumber Constructor Description LogSequenceNumber(LogSequenceNumber lsn, int recordSize)
RecoveryInfo(LogSequenceNumber firstLSN, LogSequenceNumber nextLSN)
-
Uses of LogSequenceNumber in edu.caltech.nanodb.transactions
Fields in edu.caltech.nanodb.transactions declared as LogSequenceNumber Modifier and Type Field Description private LogSequenceNumber
TransactionState. lastLSN
private LogSequenceNumber
TransactionManager. txnStateNextLSN
This is the last value of nextLSN saved to the transaction-state file.Methods in edu.caltech.nanodb.transactions that return LogSequenceNumber Modifier and Type Method Description LogSequenceNumber
TransactionStatePage. getFirstLSN()
LogSequenceNumber
TransactionState. getLastLSN()
LogSequenceNumber
TransactionStatePage. getNextLSN()
Methods in edu.caltech.nanodb.transactions with parameters of type LogSequenceNumber Modifier and Type Method Description void
TransactionManager. forceWAL(LogSequenceNumber lsn)
This method forces the write-ahead log out to at least the specified log sequence number, syncing the log to ensure that all essential records have reached the disk itself.void
TransactionStatePage. setFirstLSN(LogSequenceNumber firstLSN)
void
TransactionState. setLastLSN(LogSequenceNumber lsn)
void
TransactionStatePage. setNextLSN(LogSequenceNumber nextLSN)
-