Fennel: LogicalRecoveryLog Class Reference (original) (raw)

LogicalRecoveryLog is the recovery-time counterpart to the online LogicalTxnLog. More...

#include <[LogicalRecoveryLog.h](LogicalRecoveryLog%5F8h-source.html)>

List of all members.

Public Member Functions
virtual ~LogicalRecoveryLog ()
void recover (LogicalTxnLogCheckpointMemento const &memento)
Static Public Member Functions
static SharedLogicalRecoveryLog newLogicalRecoveryLog (LogicalTxnParticipantFactory &participantFactory, SegmentAccessor const &logSegmentAccessor, PseudoUuid const &onlineUuid, SharedSegmentFactory pSegmentFactory)
Opens a LogicalRecoveryLog stored in the given segment.
static std::string getLongLogFileName (TxnId txnId)
Gets the relative filename for a long transaction log.
Private Types
typedef std::hash_map< TxnId, LogicalTxnEventMemento > TxnMap
typedef TxnMap::iterator TxnMapIter
Private Member Functions
LogicalRecoveryLog (LogicalTxnParticipantFactory &participantFactory, SegmentAccessor const &logSegmentAccessor, PseudoUuid const &onlineUuid, SharedSegmentFactory pSegmentFactory)
void redoTxn (LogicalTxnEventMemento const &commitMemento, LogicalTxnEventMemento const *pCheckpointMemento, SharedSegInputStream pTxnInputStream)
void undoTxn (LogicalTxnEventMemento const &checkpointMemento, SharedSegInputStream pTxnInputStream)
SharedSegInputStream openLongLogStream (TxnId txnId)
Private Attributes
TxnMap checkpointTxnMap
LogicalTxnParticipantFactory & participantFactory
SharedSegmentFactory pSegmentFactory
SegmentAccessor logSegmentAccessor
SharedSegInputStream pInputStream

Detailed Description

LogicalRecoveryLog is the recovery-time counterpart to the online LogicalTxnLog.

Definition at line 42 of file LogicalRecoveryLog.h.


Member Typedef Documentation


Constructor & Destructor Documentation

| LogicalRecoveryLog::~LogicalRecoveryLog | ( | | ) | [virtual] | | ---------------------------------------- | - | | - | ----------- |


Member Function Documentation

Definition at line 138 of file LogicalRecoveryLog.cpp.

References LogicalTxnEventMemento::cbActionLast, LogicalTxnSavepoint::cbActionPrev, LogicalTxnSavepoint::cbLogged, SegStreamPosition::cbOffset, LogicalTxnEventMemento::logPosition, LogicalTxnEventMemento::nParticipants, participantFactory, LogicalRecoveryTxn::redoActions(), and LogicalRecoveryTxn::undoActions().

Referenced by recover().

00142 { 00143 LogicalRecoveryTxn recoveryTxn( 00144 pTxnInputStream, 00145 &participantFactory); 00146 FileSize cbRedo; 00147 if (pCheckpointMemento) { 00148 pTxnInputStream->seekSegPos(pCheckpointMemento->logPosition); 00149
00150 LogicalTxnSavepoint svpt; 00151 svpt.cbActionPrev = pCheckpointMemento->cbActionLast; 00152 svpt.cbLogged = pCheckpointMemento->logPosition.cbOffset; 00153 recoveryTxn.undoActions( 00154 svpt, 00155 pCheckpointMemento->nParticipants); 00156
00157 cbRedo = commitMemento.logPosition.cbOffset 00158 - pCheckpointMemento->logPosition.cbOffset; 00159 pTxnInputStream->seekSegPos(pCheckpointMemento->logPosition); 00160 } else { 00161 cbRedo = commitMemento.logPosition.cbOffset; 00162 } 00163 recoveryTxn.redoActions(cbRedo); 00164 }

std::string LogicalRecoveryLog::getLongLogFileName ( TxnId txnId ) [static]

Gets the relative filename for a long transaction log.

This is deterministic based on the TxnId.

Parameters:

txnId the TxnId of the transaction

Definition at line 180 of file LogicalRecoveryLog.cpp.

Referenced by LogicalTxn::LogicalTxn(), and openLongLogStream().

00181 { 00182 std::ostringstream oss; 00183 oss << "txn"; 00184 oss << txnId; 00185 oss << ".dat"; 00186 return oss.str(); 00187 }


Member Data Documentation


The documentation for this class was generated from the following files:


Generated on Mon Jun 22 04:00:39 2009 for Fennel by doxygen 1.5.1