public class RecoveryMgr extends Object implements TransactionLifecycleListener
Constructor and Description |
---|
RecoveryMgr(long txNum,
boolean isReadOnly)
Creates a recovery manager for the specified transaction.
|
Modifier and Type | Method and Description |
---|---|
LogSeqNum |
checkpoint(List<Long> txNums)
Writes a checkpoint record to the log.
|
static void |
enableLogging(boolean log) |
static void |
initializeSystem(Transaction tx)
Goes through the log, rolling back all uncompleted transactions.
|
LogSeqNum |
logIndexDeletionEnd(String indexName,
SearchKey searchKey,
long recordBlockNum,
int recordSlotId) |
LogSeqNum |
logIndexInsertionEnd(String indexName,
SearchKey searchKey,
long recordBlockNum,
int recordSlotId) |
LogSeqNum |
logIndexPageDeletion(BlockId indexBlkId,
boolean isDirPage,
SearchKeyType keyType,
int slotId) |
LogSeqNum |
logIndexPageDeletionClr(long compTxNum,
BlockId indexBlkId,
boolean isDirPage,
SearchKeyType keyType,
int slotId,
LogSeqNum undoNextLSN) |
LogSeqNum |
logIndexPageInsertion(BlockId indexBlkId,
boolean isDirPage,
SearchKeyType keyType,
int slotId) |
LogSeqNum |
logIndexPageInsertionClr(long compTxNum,
BlockId indexBlkId,
boolean isDirPage,
SearchKeyType keyType,
int slotId,
LogSeqNum undoNextLSN) |
LogSeqNum |
logLogicalAbort(long txNum,
LogSeqNum undoNextLSN)
Writes a logical abort record into the log.
|
LogSeqNum |
logLogicalStart() |
LogSeqNum |
logRecordFileDeletionEnd(String tblName,
long blkNum,
int slotId) |
LogSeqNum |
logRecordFileInsertionEnd(String tblName,
long blkNum,
int slotId) |
LogSeqNum |
logSetVal(Buffer buff,
int offset,
Constant newVal)
Writes a set value record to the log.
|
LogSeqNum |
logSetValClr(long compTxNum,
Buffer buff,
int offset,
Constant newVal,
LogSeqNum undoNextLSN) |
void |
onTxCommit(Transaction tx)
Writes a commit record to the log, and then flushes the log record to
disk.
|
void |
onTxEndStatement(Transaction tx) |
void |
onTxRollback(Transaction tx)
Does the roll back process, writes a rollback record to the log, and
flushes the log record to disk.
|
public RecoveryMgr(long txNum, boolean isReadOnly)
txNum
- the ID of the specified transactionisReadOnly
- is the transaction read-onlypublic static void enableLogging(boolean log)
public static void initializeSystem(Transaction tx)
tx
- the context of executing transactionpublic void onTxCommit(Transaction tx)
onTxCommit
in interface TransactionLifecycleListener
tx
- the context of committing transactionpublic void onTxRollback(Transaction tx)
onTxRollback
in interface TransactionLifecycleListener
public void onTxEndStatement(Transaction tx)
onTxEndStatement
in interface TransactionLifecycleListener
public LogSeqNum checkpoint(List<Long> txNums)
txNums
- the transactions that are being executed when writing the
checkpoint.public LogSeqNum logSetVal(Buffer buff, int offset, Constant newVal)
buff
- the buffer containing the pageoffset
- the offset of the value in the pagenewVal
- the value to be writtenpublic LogSeqNum logLogicalStart()
public LogSeqNum logLogicalAbort(long txNum, LogSeqNum undoNextLSN)
txNum
- the number of aborted transactionundoNextLSN
- the LSN which the redo the Abort record should jump topublic LogSeqNum logRecordFileInsertionEnd(String tblName, long blkNum, int slotId)
public LogSeqNum logRecordFileDeletionEnd(String tblName, long blkNum, int slotId)
public LogSeqNum logIndexInsertionEnd(String indexName, SearchKey searchKey, long recordBlockNum, int recordSlotId)
public LogSeqNum logIndexDeletionEnd(String indexName, SearchKey searchKey, long recordBlockNum, int recordSlotId)
public LogSeqNum logIndexPageInsertion(BlockId indexBlkId, boolean isDirPage, SearchKeyType keyType, int slotId)
public LogSeqNum logIndexPageDeletion(BlockId indexBlkId, boolean isDirPage, SearchKeyType keyType, int slotId)
public LogSeqNum logIndexPageInsertionClr(long compTxNum, BlockId indexBlkId, boolean isDirPage, SearchKeyType keyType, int slotId, LogSeqNum undoNextLSN)
public LogSeqNum logIndexPageDeletionClr(long compTxNum, BlockId indexBlkId, boolean isDirPage, SearchKeyType keyType, int slotId, LogSeqNum undoNextLSN)
Copyright © 2022 VanillaDB Organization. All rights reserved.