LogicalTxnTest Class Reference

Inheritance diagram for LogicalTxnTest:

SegStorageTestBase LogicalTxnParticipant LogicalTxnParticipantFactory CacheTestBase TestBase TraceTarget List of all members.

Public Member Functions

 LogicalTxnTest ()
void testCaseSetUp ()
 Equivalent to JUnit TestCase.setUp; this is called before each test case method is invoked.
void testTxn (int nActions, int iCheckpoint=-1, int iSvpt=-1)
void testActions (int nActions, int iFirst)
void testRollback (int nActions, bool checkpoint=false)
void testTxnIdSequence ()
void testRollbackEmpty ()
void testRollbackShort ()
void testRollbackLong ()
void testRollbackSavepointNoGap ()
void testRollbackSavepointGap ()
void testRollbackSavepoint (bool gap)
void testCheckpointCommitSavepoint ()
void testCommit (int nActions, bool checkpoint=false)
void testCommitEmpty ()
void testCommitShort ()
void testCommitLong ()
void testCheckpointCommitEmpty ()
void testCheckpointCommitShort ()
void testCheckpointCommitLong ()
void testCheckpointRollbackShort ()
void testCheckpointRollbackLong ()
virtual LogicalTxnClassId getParticipantClassId () const
 
Returns:
the LogicalTxnClassId for this participant; this will be used during recovery to find the correct LogicalTxnParticipantFactory

virtual void describeParticipant (ByteOutputStream &logStream)
 Called by LogicalTxn the first time an action is logged for this participant.
virtual void redoLogicalAction (LogicalActionType actionType, ByteInputStream &logStream)
 Performs redo for one logical action during recovery.
virtual void undoLogicalAction (LogicalActionType actionType, ByteInputStream &logStream)
 Performs undo for one logical action during rollback or recovery.
virtual SharedLogicalTxnParticipant loadParticipant (LogicalTxnClassId classId, ByteInputStream &logStream)
 Recovers a LogicalTxnParticipant from the log.
virtual void openStorage (DeviceMode openMode)
virtual void openSegmentStorage (DeviceMode openMode)
virtual void openRandomSegment ()
SharedSegment createLinearDeviceSegment (DeviceId deviceId, uint nPages)
void closeLinearSegment ()
void closeRandomSegment ()
void closeVersionedRandomSegment ()
void closeSnapshotRandomSegment ()
virtual void closeStorage ()
CachegetCache ()
virtual SharedCache newCache ()
SharedRandomAccessDevice openDevice (std::string devName, DeviceMode openMode, uint nDevicePages, DeviceId deviceId)
virtual void testCaseTearDown ()
 Equivalent to JUnit TestCase.tearDown; this is called after each test case method is invoked.
void closeDevice (DeviceId deviceId, SharedRandomAccessDevice &pDevice)
TestSuitereleaseTestSuite ()
void beforeTestCase (std::string testCaseName)
void afterTestCase (std::string testCaseName)
virtual void notifyTrace (std::string source, TraceLevel level, std::string message)
 Receives notification when a trace event occurs.
virtual TraceLevel getSourceTraceLevel (std::string source)
 Gets the level at which a particular source should be traced.

Static Public Member Functions

static void readParams (int argc, char **argv)
 Parses the command line.

Static Public Attributes

static ParamName paramTestSuiteName
static ParamName paramTraceFileName
static ParamName paramDictionaryFileName
static ParamName paramTraceLevel
static ParamName paramStatsFileName
static ParamName paramTraceStdout
static ParamName paramDegreeOfParallelism
static ConfigMap configMap
 Configuration parameters.

Protected Types

enum  VictimPolicy { victimTwoQ, victimLRU, victimRandom }
 The available victim policy implementations. More...

Protected Member Functions

void snooze (uint nSeconds)
LogicalTxngetLogicalTxn ()
 
Returns:
LogicalTxn being participated in, or null if no txn in progress; null is also returned during recovery

bool isLoggingEnabled () const
 
Returns:
true if actions should be logged; this is false during recovery


Protected Attributes

SharedSegmentFactory pSegmentFactory
SharedSegment pLinearSegment
 Segment supporting linear page allocation.
SharedSegment pRandomSegment
 (Optional) segment supporting random page allocation.
SharedSegment pVersionedRandomSegment
 (Optional) segment supporting versioned random page allocation.
SharedSegment pSnapshotRandomSegment
 (Optional) segment supporting snapshot random page allocation.
VictimPolicy victimPolicy
 VictimPolicy to instantiate.
CacheParams cacheParams
 Parameters for cache initialization.
SharedCache pCache
 Cache instance being tested.
SharedRandomAccessDevice pRandomAccessDevice
 The default cached device.
uint nMemPages
 Size of cache in memory pages.
uint nDiskPages
 Size of device in disk pages.
uint cbPageFull
 Disk page size.
DeviceId dataDeviceId
 Fixed ID to assign to data device.
TestSuitepTestSuite
 Boost test suite.
boost::shared_ptr< TestBasepTestObj
std::ofstream traceStream
 Output file stream for tracing.
StrictMutex traceMutex
 Protects traceStream.
std::string testName
 Name of test.
TraceLevel traceLevel
 Level at which to trace test execution.
FileStatsTarget statsTarget
 Output for stats.
StatsTimer statsTimer
 Timer for stats collection.
bool traceStdout
 Copy trace output to stdout.
bool traceFile
 Copy trace output to file.
TestCaseGroup defaultTests
TestCaseGroup extraTests

Static Protected Attributes

static bool runAll
 Run all test cases, including the extra tests.
static std::string runSingle
 Run only the test case of this name.

Private Types

typedef std::pair< int, int > ExpectedRange

Private Member Functions

void rollbackFull ()
void commit ()
void checkpointTxnLog (LogicalTxnLogCheckpointMemento &)
SharedLogicalRecoveryLog createRecoveryLog ()

Private Attributes

SharedLogicalTxnLog pTxnLog
LogicalTxnLogCheckpointMemento firstCheckpointMemento
LogicalTxnLogCheckpointMemento intermediateCheckpointMemento
LogicalTxnLogCheckpointMemento finalCheckpointMemento
SavepointId svptId
PseudoUuid onlineUuid
std::vector< ExpectedRangeexpected

Static Private Attributes

static const int participantDescription
static const LogicalActionType ACTION_TEST

Detailed Description

Definition at line 40 of file LogicalTxnTest.cpp.


Member Typedef Documentation

typedef std::pair<int,int> LogicalTxnTest::ExpectedRange [private]

Definition at line 55 of file LogicalTxnTest.cpp.


Member Enumeration Documentation

enum CacheTestBase::VictimPolicy [protected, inherited]

The available victim policy implementations.

Enumerator:
victimTwoQ 
victimLRU 
victimRandom 

Definition at line 44 of file CacheTestBase.h.

00044                       {
00045         victimTwoQ,
00046         victimLRU,
00047         victimRandom
00048     };


Constructor & Destructor Documentation

LogicalTxnTest::LogicalTxnTest (  )  [inline, explicit]

Definition at line 64 of file LogicalTxnTest.cpp.

References PseudoUuid::generateInvalid(), onlineUuid, testCheckpointCommitEmpty(), testCheckpointCommitLong(), testCheckpointCommitSavepoint(), testCheckpointCommitShort(), testCheckpointRollbackLong(), testCheckpointRollbackShort(), testCommitEmpty(), testCommitLong(), testCommitShort(), testRollbackEmpty(), testRollbackLong(), testRollbackSavepointGap(), testRollbackSavepointNoGap(), testRollbackShort(), and testTxnIdSequence().

00065     {
00066         onlineUuid.generateInvalid();
00067 
00068         // TODO jvs 26-Oct-2007:  need multi-threading tests,
00069         // e.g. for FNL-68
00070 
00071         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testTxnIdSequence);
00072         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testRollbackEmpty);
00073         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testRollbackShort);
00074         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testRollbackLong);
00075         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testRollbackSavepointNoGap);
00076         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testRollbackSavepointGap);
00077         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCheckpointCommitSavepoint);
00078         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCommitEmpty);
00079         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCommitShort);
00080         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCommitLong);
00081         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCheckpointCommitEmpty);
00082         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCheckpointCommitShort);
00083         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCheckpointCommitLong);
00084         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCheckpointRollbackShort);
00085         FENNEL_UNIT_TEST_CASE(LogicalTxnTest,testCheckpointRollbackLong);
00086     }


Member Function Documentation

void LogicalTxnTest::rollbackFull (  )  [private]

Definition at line 348 of file LogicalTxnTest.cpp.

References checkpointTxnLog(), expected, finalCheckpointMemento, LogicalTxnParticipant::getLogicalTxn(), pTxnLog, and LogicalTxn::rollback().

Referenced by testRollback(), and testRollbackSavepoint().

00349 {
00350     getLogicalTxn()->rollback();
00351     BOOST_CHECK(expected.empty());
00352     checkpointTxnLog(finalCheckpointMemento);
00353     assert(pTxnLog.unique());
00354     pTxnLog.reset();
00355 }

void LogicalTxnTest::commit (  )  [private]

Definition at line 357 of file LogicalTxnTest.cpp.

References checkpointTxnLog(), LogicalTxn::commit(), finalCheckpointMemento, LogicalTxnParticipant::getLogicalTxn(), and pTxnLog.

Referenced by testCheckpointCommitSavepoint(), testCommit(), and testTxnIdSequence().

00358 {
00359     getLogicalTxn()->commit();
00360     checkpointTxnLog(finalCheckpointMemento);
00361     assert(pTxnLog.unique());
00362     pTxnLog.reset();
00363 }

void LogicalTxnTest::checkpointTxnLog ( LogicalTxnLogCheckpointMemento  )  [private]

Definition at line 149 of file LogicalTxnTest.cpp.

References pTxnLog.

Referenced by commit(), rollbackFull(), and testTxn().

00151 {
00152     pTxnLog->checkpoint(memento);
00153     pTxnLog->deallocateCheckpointedLog(memento);
00154 }

SharedLogicalRecoveryLog LogicalTxnTest::createRecoveryLog (  )  [private]

Definition at line 249 of file LogicalTxnTest.cpp.

References LogicalRecoveryLog::newLogicalRecoveryLog(), onlineUuid, CacheTestBase::pCache, SegStorageTestBase::pLinearSegment, and SegStorageTestBase::pSegmentFactory.

Referenced by testCheckpointCommitSavepoint(), testCommit(), and testRollback().

00250 {
00251     SegmentAccessor segmentAccessor(pLinearSegment,pCache);
00252     SharedLogicalRecoveryLog pRecoveryLog =
00253         LogicalRecoveryLog::newLogicalRecoveryLog(
00254             *this,
00255             segmentAccessor,
00256             onlineUuid,
00257             pSegmentFactory);
00258     return pRecoveryLog;
00259 }

void LogicalTxnTest::testCaseSetUp (  )  [inline, virtual]

Equivalent to JUnit TestCase.setUp; this is called before each test case method is invoked.

Default is no-op.

Reimplemented from TestBase.

Definition at line 88 of file LogicalTxnTest.cpp.

References expected.

00089     {
00090         expected.clear();
00091     }

void LogicalTxnTest::testTxn ( int  nActions,
int  iCheckpoint = -1,
int  iSvpt = -1 
)

Definition at line 387 of file LogicalTxnTest.cpp.

References ACTION_TEST, checkpointTxnLog(), DeviceMode::createNew, LogicalTxn::createSavepoint(), LogicalTxn::endLogicalAction(), firstCheckpointMemento, LogicalTxnParticipant::getLogicalTxn(), intermediateCheckpointMemento, LogicalTxnLog::newLogicalTxnLog(), onlineUuid, SegStorageTestBase::openStorage(), CacheTestBase::pCache, SegStorageTestBase::pLinearSegment, SegStorageTestBase::pSegmentFactory, LogicalTxnParticipant::pTxn, pTxnLog, and svptId.

Referenced by testCheckpointCommitSavepoint(), testCommit(), testRollback(), testRollbackSavepoint(), and testTxnIdSequence().

00388 {
00389     openStorage(DeviceMode::createNew);
00390     SegmentAccessor segmentAccessor(pLinearSegment,pCache);
00391     pTxnLog = LogicalTxnLog::newLogicalTxnLog(
00392         segmentAccessor,onlineUuid,pSegmentFactory);
00393     checkpointTxnLog(firstCheckpointMemento);
00394     SharedLogicalTxn pTxn = pTxnLog->newLogicalTxn(pCache);
00395     pTxn->addParticipant(
00396         boost::dynamic_pointer_cast<LogicalTxnParticipant>(
00397             shared_from_this()));
00398     for (int i = 0; i < nActions; ++i) {
00399         ByteOutputStream &logStream =
00400             getLogicalTxn()->beginLogicalAction(*this,ACTION_TEST);
00401         logStream.writeValue(i);
00402         getLogicalTxn()->endLogicalAction();
00403         if (i == iCheckpoint) {
00404             checkpointTxnLog(intermediateCheckpointMemento);
00405         }
00406         if (i == iSvpt) {
00407             svptId = getLogicalTxn()->createSavepoint();
00408         }
00409     }
00410     if (!nActions && !iCheckpoint) {
00411         checkpointTxnLog(intermediateCheckpointMemento);
00412     }
00413 }

void LogicalTxnTest::testActions ( int  nActions,
int  iFirst 
)

Definition at line 415 of file LogicalTxnTest.cpp.

References ACTION_TEST, LogicalTxn::endLogicalAction(), and LogicalTxnParticipant::getLogicalTxn().

Referenced by testCheckpointCommitSavepoint(), and testRollbackSavepoint().

00416 {
00417     for (int i = 0; i < nActions; ++i) {
00418         ByteOutputStream &logStream =
00419             getLogicalTxn()->beginLogicalAction(*this,ACTION_TEST);
00420         int x = iFirst + i;
00421         logStream.writeValue(x);
00422         getLogicalTxn()->endLogicalAction();
00423     }
00424 }

void LogicalTxnTest::testRollback ( int  nActions,
bool  checkpoint = false 
)

Definition at line 329 of file LogicalTxnTest.cpp.

References createRecoveryLog(), expected, intermediateCheckpointMemento, rollbackFull(), and testTxn().

Referenced by testCheckpointRollbackLong(), testCheckpointRollbackShort(), testRollbackEmpty(), testRollbackLong(), and testRollbackShort().

00332 {
00333     int iCheckpoint = checkpoint ? (nActions / 2) : -1;
00334     testTxn(nActions,iCheckpoint);
00335     if (checkpoint) {
00336         SharedLogicalRecoveryLog pRecoveryLog = createRecoveryLog();
00337         expected.push_back(ExpectedRange(iCheckpoint,0));
00338         pRecoveryLog->recover(intermediateCheckpointMemento);
00339         BOOST_CHECK(expected.empty());
00340         assert(pRecoveryLog.unique());
00341     }
00342     if (nActions) {
00343         expected.push_back(ExpectedRange(nActions - 1, 0));
00344     }
00345     rollbackFull();
00346 }

void LogicalTxnTest::testTxnIdSequence (  ) 

Definition at line 190 of file LogicalTxnTest.cpp.

References commit(), LogicalTxnParticipant::getLogicalTxn(), LogicalTxn::getTxnId(), CacheTestBase::pCache, pTxnLog, and testTxn().

Referenced by LogicalTxnTest().

00191 {
00192     testTxn(1);
00193     TxnId id1 = getLogicalTxn()->getTxnId();
00194     SharedLogicalTxn pTxn2 = pTxnLog->newLogicalTxn(pCache);
00195     TxnId id2 = pTxn2->getTxnId();
00196     pTxn2->commit();
00197     pTxn2.reset();
00198     commit();
00199     // TxnId reflects start order, not commit order
00200     BOOST_CHECK(id2 > id1);
00201 }

void LogicalTxnTest::testRollbackEmpty (  ) 

Definition at line 203 of file LogicalTxnTest.cpp.

References testRollback().

Referenced by LogicalTxnTest().

00204 {
00205     testRollback(0);
00206 }

void LogicalTxnTest::testRollbackShort (  ) 

Definition at line 208 of file LogicalTxnTest.cpp.

References testRollback().

Referenced by LogicalTxnTest().

00209 {
00210     testRollback(10);
00211 }

void LogicalTxnTest::testRollbackLong (  ) 

Definition at line 213 of file LogicalTxnTest.cpp.

References testRollback().

Referenced by LogicalTxnTest().

00214 {
00215     testRollback(10000);
00216 }

void LogicalTxnTest::testRollbackSavepointNoGap (  ) 

Definition at line 218 of file LogicalTxnTest.cpp.

References testRollbackSavepoint().

Referenced by LogicalTxnTest().

00219 {
00220     testRollbackSavepoint(false);
00221 }

void LogicalTxnTest::testRollbackSavepointGap (  ) 

Definition at line 223 of file LogicalTxnTest.cpp.

References testRollbackSavepoint().

Referenced by LogicalTxnTest().

00224 {
00225     testRollbackSavepoint(true);
00226 }

void LogicalTxnTest::testRollbackSavepoint ( bool  gap  ) 

Definition at line 228 of file LogicalTxnTest.cpp.

References expected, LogicalTxnParticipant::getLogicalTxn(), LogicalTxn::rollback(), rollbackFull(), svptId, testActions(), and testTxn().

Referenced by testRollbackSavepointGap(), and testRollbackSavepointNoGap().

00229 {
00230     // log actions 0 through 99, creating a savepoint after 50
00231     testTxn(100,-1,50);
00232 
00233     // rollback 99 through 51
00234     expected.push_back(ExpectedRange(99,51));
00235     getLogicalTxn()->rollback(&svptId);
00236     BOOST_CHECK(expected.empty());
00237 
00238     if (gap) {
00239         // log 40 new actions (200 through 239)
00240         testActions(40,200);
00241         expected.push_back(ExpectedRange(239,200));
00242     }
00243 
00244     // roll everything back
00245     expected.push_back(ExpectedRange(50,0));
00246     rollbackFull();
00247 }

void LogicalTxnTest::testCheckpointCommitSavepoint (  ) 

Definition at line 261 of file LogicalTxnTest.cpp.

References commit(), createRecoveryLog(), expected, LogicalTxnParticipant::getLogicalTxn(), intermediateCheckpointMemento, LogicalTxn::rollback(), svptId, testActions(), and testTxn().

Referenced by LogicalTxnTest().

00262 {
00263     // log actions 0 through 99, checkpointing after 75 and creating a
00264     // savepoint after 50
00265     testTxn(100,75,50);
00266 
00267     // rollback 99 through 51
00268     expected.push_back(ExpectedRange(99,51));
00269     getLogicalTxn()->rollback(&svptId);
00270     BOOST_CHECK(expected.empty());
00271 
00272     // log 40 new actions (200 through 239)
00273     testActions(40,200);
00274 
00275     commit();
00276     SharedLogicalRecoveryLog pRecoveryLog = createRecoveryLog();
00277 
00278     // recovery should first see 76 through 99 (redo),
00279     // then 99 through 51 (undo),
00280     // then 200 through 239 (redo)
00281     expected.push_back(ExpectedRange(76,99));
00282     expected.push_back(ExpectedRange(99,51));
00283     expected.push_back(ExpectedRange(200,239));
00284     pRecoveryLog->recover(intermediateCheckpointMemento);
00285     BOOST_CHECK(expected.empty());
00286     assert(pRecoveryLog.unique());
00287 }

void LogicalTxnTest::testCommit ( int  nActions,
bool  checkpoint = false 
)

Definition at line 365 of file LogicalTxnTest.cpp.

References commit(), createRecoveryLog(), expected, firstCheckpointMemento, intermediateCheckpointMemento, and testTxn().

Referenced by testCheckpointCommitEmpty(), testCheckpointCommitLong(), testCheckpointCommitShort(), testCommitEmpty(), testCommitLong(), and testCommitShort().

00366 {
00367     int iCheckpoint = checkpoint ? (nActions / 2) : -1;
00368     testTxn(nActions,iCheckpoint);
00369     commit();
00370 
00371     SharedLogicalRecoveryLog pRecoveryLog = createRecoveryLog();
00372     if (checkpoint) {
00373         if (nActions) {
00374             expected.push_back(ExpectedRange(iCheckpoint + 1, nActions - 1));
00375         }
00376         pRecoveryLog->recover(intermediateCheckpointMemento);
00377     } else {
00378         if (nActions) {
00379             expected.push_back(ExpectedRange(0, nActions - 1));
00380         }
00381         pRecoveryLog->recover(firstCheckpointMemento);
00382     }
00383     BOOST_CHECK(expected.empty());
00384     assert(pRecoveryLog.unique());
00385 }

void LogicalTxnTest::testCommitEmpty (  ) 

Definition at line 299 of file LogicalTxnTest.cpp.

References testCommit().

Referenced by LogicalTxnTest().

00300 {
00301     testCommit(0);
00302 }

void LogicalTxnTest::testCommitShort (  ) 

Definition at line 304 of file LogicalTxnTest.cpp.

References testCommit().

Referenced by LogicalTxnTest().

00305 {
00306     testCommit(10);
00307 }

void LogicalTxnTest::testCommitLong (  ) 

Definition at line 309 of file LogicalTxnTest.cpp.

References testCommit().

Referenced by LogicalTxnTest().

00310 {
00311     testCommit(10000);
00312 }

void LogicalTxnTest::testCheckpointCommitEmpty (  ) 

Definition at line 314 of file LogicalTxnTest.cpp.

References testCommit().

Referenced by LogicalTxnTest().

00315 {
00316     testCommit(0,true);
00317 }

void LogicalTxnTest::testCheckpointCommitShort (  ) 

Definition at line 319 of file LogicalTxnTest.cpp.

References testCommit().

Referenced by LogicalTxnTest().

00320 {
00321     testCommit(10,true);
00322 }

void LogicalTxnTest::testCheckpointCommitLong (  ) 

Definition at line 324 of file LogicalTxnTest.cpp.

References testCommit().

Referenced by LogicalTxnTest().

00325 {
00326     testCommit(10000,true);
00327 }

void LogicalTxnTest::testCheckpointRollbackShort (  ) 

Definition at line 289 of file LogicalTxnTest.cpp.

References testRollback().

Referenced by LogicalTxnTest().

00290 {
00291     testRollback(10,true);
00292 }

void LogicalTxnTest::testCheckpointRollbackLong (  ) 

Definition at line 294 of file LogicalTxnTest.cpp.

References testRollback().

Referenced by LogicalTxnTest().

00295 {
00296     testRollback(10000,true);
00297 }

LogicalTxnClassId LogicalTxnTest::getParticipantClassId (  )  const [virtual]

Returns:
the LogicalTxnClassId for this participant; this will be used during recovery to find the correct LogicalTxnParticipantFactory

Implements LogicalTxnParticipant.

Definition at line 138 of file LogicalTxnTest.cpp.

Referenced by loadParticipant().

00139 {
00140     return LogicalTxnClassId(0x83f6b9edfe168b93LL);
00141 }

void LogicalTxnTest::describeParticipant ( ByteOutputStream logStream  )  [virtual]

Called by LogicalTxn the first time an action is logged for this participant.

The participant must implement this by writing a description of itself to the given output stream. This information must be sufficient for reconstructing the participant during recovery.

Parameters:
logStream stream to which the participant description should be written

Implements LogicalTxnParticipant.

Definition at line 143 of file LogicalTxnTest.cpp.

References participantDescription, and ByteOutputStream::writeValue().

00144 {
00145     int x = participantDescription;
00146     logStream.writeValue(x);
00147 }

void LogicalTxnTest::redoLogicalAction ( LogicalActionType  actionType,
ByteInputStream logStream 
) [virtual]

Performs redo for one logical action during recovery.

The implementation must consume ALL log data for this action, even if some of it turns out to be unneeded.

Parameters:
actionType the type of action to redo; the rest of the action parameters should be read from the LogicalTxn's input stream
logStream stream from which to read action data

Implements LogicalTxnParticipant.

Definition at line 173 of file LogicalTxnTest.cpp.

References ACTION_TEST, expected, and ByteInputStream::readValue().

00176 {
00177     // TODO:  symbolic const
00178     BOOST_CHECK_EQUAL(actionType,ACTION_TEST);
00179     int i;
00180     logStream.readValue(i);
00181     BOOST_CHECK(!expected.empty());
00182     ExpectedRange &range = expected.front();
00183     BOOST_CHECK_EQUAL(i,range.first);
00184     range.first++;
00185     if (range.first > range.second) {
00186         expected.erase(expected.begin());
00187     }
00188 }

void LogicalTxnTest::undoLogicalAction ( LogicalActionType  actionType,
ByteInputStream logStream 
) [virtual]

Performs undo for one logical action during rollback or recovery.

The implementation must consume ALL log data for this action, even if some of it turns out to be unneeded.

Parameters:
actionType the type of action to undo; the rest of the action parameters should be read from the LogicalTxn's input stream
logStream stream from which to read action data

Implements LogicalTxnParticipant.

Definition at line 156 of file LogicalTxnTest.cpp.

References ACTION_TEST, expected, and ByteInputStream::readValue().

00159 {
00160     // TODO:  symbolic const
00161     BOOST_CHECK_EQUAL(actionType,ACTION_TEST);
00162     int i;
00163     logStream.readValue(i);
00164     BOOST_CHECK(!expected.empty());
00165     ExpectedRange &range = expected.front();
00166     BOOST_CHECK_EQUAL(i,range.first);
00167     range.first--;
00168     if (range.first < range.second) {
00169         expected.erase(expected.begin());
00170     }
00171 }

SharedLogicalTxnParticipant LogicalTxnTest::loadParticipant ( LogicalTxnClassId  classId,
ByteInputStream logStream 
) [virtual]

Recovers a LogicalTxnParticipant from the log.

Using the classId to determine the participant type to create, the factory reads required constructor parameters from the log input stream. The factory may peool participant instances; i.e. when the same constructor parameters are encountered a second time, the factory can return the same instance. (TODO: refine this when parallelized recovery is implemented.) The implementation must consume ALL log data for this record, even if some of it turns out to be unneeded.

Parameters:
classId the LogicalTxnClassId recorded when the participant was logged while online
logStream the log information written by the participant's describeParticipant() implementation
Returns:
reference to loaded participant

Implements LogicalTxnParticipantFactory.

Definition at line 426 of file LogicalTxnTest.cpp.

References getParticipantClassId(), participantDescription, and ByteInputStream::readValue().

00429 {
00430     BOOST_CHECK_EQUAL(classId,getParticipantClassId());
00431     int x;
00432     logStream.readValue(x);
00433     BOOST_CHECK_EQUAL(x,participantDescription);
00434     return boost::dynamic_pointer_cast<LogicalTxnParticipant>(
00435         shared_from_this());
00436 }

void SegStorageTestBase::openStorage ( DeviceMode  openMode  )  [virtual, inherited]

Reimplemented from CacheTestBase.

Reimplemented in SegmentTestBase.

Definition at line 31 of file SegStorageTestBase.cpp.

References SegStorageTestBase::openSegmentStorage(), and CacheTestBase::openStorage().

Referenced by SegStorageTestBase::openRandomSegment(), SegmentTestBase::openStorage(), LhxHashTableTest::testCaseSetUp(), ExecStreamTestBase::testCaseSetUp(), BTreeTest::testCaseSetUp(), BTreeReadersTest::testCaseSetUp(), LbmEntryTest::testCaseSetUp(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), SegStreamTest::testMarkReset(), SegStreamTest::testReadSeg(), testTxn(), SegStreamTest::testWriteSeg(), and SegStreamTest::testWriteSpillAndRead().

00032 {
00033     CacheTestBase::openStorage(openMode);
00034     openSegmentStorage(openMode);
00035 }

void SegStorageTestBase::openSegmentStorage ( DeviceMode  openMode  )  [virtual, inherited]

Reimplemented in LinearViewSegmentTest, SnapshotSegmentTestBase, and VersionedSegmentTest.

Definition at line 37 of file SegStorageTestBase.cpp.

References CacheTestBase::cbPageFull, DeviceMode::create, SegStorageTestBase::createLinearDeviceSegment(), CacheTestBase::dataDeviceId, SegStorageTestBase::pLinearSegment, and CacheTestBase::pRandomAccessDevice.

Referenced by VersionedSegmentTest::openSegmentStorage(), and SegStorageTestBase::openStorage().

00038 {
00039     pLinearSegment = createLinearDeviceSegment(
00040         dataDeviceId,
00041         openMode.create ? 0
00042         : pRandomAccessDevice->getSizeInBytes() / cbPageFull);
00043 }

void SegStorageTestBase::openRandomSegment (  )  [virtual, inherited]

Reimplemented in LcsClusterReplaceExecStreamTest.

Definition at line 45 of file SegStorageTestBase.cpp.

References SegStorageTestBase::closeStorage(), DeviceMode::load, SegStorageTestBase::openStorage(), SegStorageTestBase::pLinearSegment, SegStorageTestBase::pRandomSegment, and SegStorageTestBase::pSegmentFactory.

Referenced by RandomAllocationSegmentTest::testAllocateAndDeallocate(), LhxHashTableTest::testCaseSetUp(), ExecStreamUnitTestBase::testCaseSetUp(), BTreeTest::testCaseSetUp(), and BTreeReadersTest::testCaseSetUp().

00046 {
00047     // reopen will interpret pages as already allocated, which
00048     // is what RandomAllocationSegment expects
00049     closeStorage();
00050     openStorage(DeviceMode::load);
00051     pRandomSegment = pSegmentFactory->newRandomAllocationSegment(
00052         pLinearSegment, true);
00053     pLinearSegment.reset();
00054 }

SharedSegment SegStorageTestBase::createLinearDeviceSegment ( DeviceId  deviceId,
uint  nPages 
) [inherited]

Definition at line 56 of file SegStorageTestBase.cpp.

References LinearDeviceSegmentParams::firstBlockId, LinearDeviceSegmentParams::nPagesAllocated, LinearDeviceSegmentParams::nPagesMin, CacheTestBase::pCache, SegStorageTestBase::pSegmentFactory, CompoundId::setBlockNum(), and CompoundId::setDeviceId().

Referenced by VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), SegStorageTestBase::openSegmentStorage(), and LinearViewSegmentTest::openSegmentStorage().

00058 {
00059     BlockId blockId(0);
00060     CompoundId::setDeviceId(blockId,deviceId);
00061     CompoundId::setBlockNum(blockId,0);
00062     LinearDeviceSegmentParams deviceParams;
00063     deviceParams.firstBlockId = blockId;
00064     deviceParams.nPagesMin = nPages;
00065     deviceParams.nPagesAllocated = nPages;
00066     return pSegmentFactory->newLinearDeviceSegment(
00067         pCache,deviceParams);
00068 }

void SegStorageTestBase::closeLinearSegment (  )  [inherited]

Definition at line 70 of file SegStorageTestBase.cpp.

References SegStorageTestBase::pLinearSegment.

Referenced by VersionedSegmentTest::closeStorage(), SnapshotSegmentTestBase::closeStorage(), SegStorageTestBase::closeStorage(), and SnapshotSegmentTest::testUncommittedReads().

00071 {
00072     if (pLinearSegment) {
00073         assert(pLinearSegment.unique());
00074         pLinearSegment.reset();
00075     }
00076 }

void SegStorageTestBase::closeRandomSegment (  )  [inherited]

Definition at line 78 of file SegStorageTestBase.cpp.

References SegStorageTestBase::pRandomSegment.

Referenced by VersionedSegmentTest::closeStorage(), and SegStorageTestBase::closeStorage().

00079 {
00080     if (pRandomSegment) {
00081         assert(pRandomSegment.unique());
00082         pRandomSegment.reset();
00083     }
00084 }

void SegStorageTestBase::closeVersionedRandomSegment (  )  [inherited]

Definition at line 86 of file SegStorageTestBase.cpp.

References SegStorageTestBase::pVersionedRandomSegment.

Referenced by SnapshotSegmentTestBase::closeStorage(), and SegStorageTestBase::closeStorage().

00087 {
00088     if (pVersionedRandomSegment) {
00089         assert(pVersionedRandomSegment.unique());
00090         pVersionedRandomSegment.reset();
00091     }
00092 }

void SegStorageTestBase::closeSnapshotRandomSegment (  )  [inherited]

Definition at line 94 of file SegStorageTestBase.cpp.

References SegStorageTestBase::pSnapshotRandomSegment.

Referenced by SnapshotSegmentTestBase::closeStorage().

00095 {
00096     if (pSnapshotRandomSegment) {
00097         assert(pSnapshotRandomSegment.unique());
00098         pSnapshotRandomSegment.reset();
00099     }
00100 }

void SegStorageTestBase::closeStorage (  )  [virtual, inherited]

Reimplemented from CacheTestBase.

Reimplemented in SnapshotSegmentTestBase, and VersionedSegmentTest.

Definition at line 102 of file SegStorageTestBase.cpp.

References SegStorageTestBase::closeLinearSegment(), SegStorageTestBase::closeRandomSegment(), CacheTestBase::closeStorage(), and SegStorageTestBase::closeVersionedRandomSegment().

Referenced by VersionedSegmentTest::closeStorage(), SnapshotSegmentTestBase::closeStorage(), SegStorageTestBase::openRandomSegment(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), SegStreamTest::testMarkReset(), SegStreamTest::testReadSeg(), SegmentTestBase::testSingleThread(), SegStreamTest::testWriteSeg(), and SegStreamTest::testWriteSpillAndRead().

00103 {
00104     closeLinearSegment();
00105     closeRandomSegment();
00106     closeVersionedRandomSegment();
00107     // TODO:  assert pSegmentFactory.unique(), but not here
00108     CacheTestBase::closeStorage();
00109 }

Cache & CacheTestBase::getCache (  )  [inherited]

Definition at line 42 of file CacheTestBase.cpp.

References CacheTestBase::pCache.

Referenced by CacheTest::lockPage(), CacheTest::prefetchBatch(), SegmentTestBase::prefetchPage(), CacheTest::prefetchPage(), PagingTestBase::testCacheResize(), PagingTestBase::testCheckpoint(), PagingTestBase::testOp(), PagingTestBase::testScratch(), SegmentTestBase::unlockPage(), and CacheTest::unlockPage().

00043 {
00044     return *pCache;
00045 }

SharedCache CacheTestBase::newCache (  )  [virtual, inherited]

Definition at line 66 of file CacheTestBase.cpp.

References CacheTestBase::cacheParams, Cache::newCache(), CacheTestBase::victimLRU, CacheTestBase::victimPolicy, CacheTestBase::victimRandom, and CacheTestBase::victimTwoQ.

Referenced by CacheTestBase::openStorage().

00067 {
00068     switch (victimPolicy) {
00069     case victimRandom:
00070         return SharedCache(
00071             new RandomCache(cacheParams),
00072             ClosableObjectDestructor());
00073     case victimLRU:
00074         return SharedCache(
00075             new LRUCache(cacheParams),
00076             ClosableObjectDestructor());
00077     case victimTwoQ:
00078         return Cache::newCache(cacheParams);
00079     default:
00080         permAssert(false);
00081     }
00082 }

SharedRandomAccessDevice CacheTestBase::openDevice ( std::string  devName,
DeviceMode  openMode,
uint  nDevicePages,
DeviceId  deviceId 
) [inherited]

Definition at line 84 of file CacheTestBase.cpp.

References CacheTestBase::cbPageFull, DeviceMode::create, CacheTestBase::pCache, and FileSystem::remove().

Referenced by VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), and CacheTestBase::openStorage().

00087 {
00088     if (openMode.create) {
00089         FileSystem::remove(devName.c_str());
00090     }
00091     SharedRandomAccessDevice pDevice(
00092         new RandomAccessFileDevice(devName,openMode));
00093     if (openMode.create) {
00094         pDevice->setSizeInBytes(nDevicePages*cbPageFull);
00095     }
00096     pCache->registerDevice(deviceId,pDevice);
00097     return pDevice;
00098 }

void CacheTestBase::testCaseTearDown (  )  [virtual, inherited]

Equivalent to JUnit TestCase.tearDown; this is called after each test case method is invoked.

Default is no-op.

Reimplemented from TestBase.

Reimplemented in LbmEntryTest, LbmLoadBitmapTest, LbmSearchTest, LcsClusterAppendExecStreamTest, LcsClusterReplaceExecStreamTest, LcsMultiClusterAppendTest, LcsRowScanExecStreamTest, BTreeReadersTest, BTreeTest, ExecStreamTestBase, and LhxHashTableTest.

Definition at line 125 of file CacheTestBase.cpp.

References CacheTestBase::closeStorage().

Referenced by LhxHashTableTest::testCaseTearDown(), ExecStreamTestBase::testCaseTearDown(), BTreeTest::testCaseTearDown(), BTreeReadersTest::testCaseTearDown(), and LbmEntryTest::testCaseTearDown().

00126 {
00127     closeStorage();
00128 }

void CacheTestBase::closeDevice ( DeviceId  deviceId,
SharedRandomAccessDevice pDevice 
) [inherited]

Definition at line 130 of file CacheTestBase.cpp.

References CHECKPOINT_FLUSH_AND_UNMAP, and CacheTestBase::pCache.

Referenced by VersionedSegmentTest::closeStorage(), SnapshotSegmentTestBase::closeStorage(), and CacheTestBase::closeStorage().

00132 {
00133     if (!pDevice) {
00134         return;
00135     }
00136     DeviceIdPagePredicate pagePredicate(deviceId);
00137     pCache->checkpointPages(pagePredicate,CHECKPOINT_FLUSH_AND_UNMAP);
00138     pCache->unregisterDevice(deviceId);
00139     assert(pDevice.unique());
00140     pDevice.reset();
00141 }

void TestBase::snooze ( uint  nSeconds  )  [protected, inherited]

Definition at line 263 of file TestBase.cpp.

Referenced by DatabaseTest::executeForceTxn(), ThreadedTestBase::runThreadedTestCase(), PagingTestBase::testCacheResize(), BTreeTxnTest::testCheckpoint(), PagingTestBase::testCheckpointGuarded(), PagingTestBase::testPrefetch(), and PagingTestBase::testPrefetchBatch().

00264 {
00265 #ifdef __MSVC__
00266     ::_sleep(nSeconds*1000);
00267 #else
00268     ::sleep(nSeconds);
00269 #endif
00270 }

void TestBase::readParams ( int  argc,
char **  argv 
) [static, inherited]

Parses the command line.

format: [-v] [-t TEST | -all] {param=val}* [CONFIGFILE | -] Normally, the test program runs the default test cases. With the option "-all", runs the extra test cases as well. With the option "-t TEST", runs only the single test case named TEST. CONFIGFILE is read to load configuration parameters. Configuration parameters can also be set ad hoc, from the command line, as pairs name=val. These take precedence.

Definition at line 108 of file TestBase.cpp.

References TestBase::configMap, ConfigMap::dumpParams(), ConfigMap::isParamSet(), ConfigMap::mergeFrom(), TestBase::paramDictionaryFileName, ConfigMap::readParams(), TestBase::runAll, TestBase::runSingle, ConfigMap::setStringParam(), and verbose.

00109 {
00110     bool verbose = false;
00111     ConfigMap adhocMap;
00112 
00113     for (int i = 1; i < argc; ++i) {
00114         std::string arg = argv[i];
00115         if (argv[i][0] == '-') {
00116             if (arg == "-v") {
00117                 verbose = true;
00118             } else if (arg == "-") {
00119                 configMap.readParams(std::cin);
00120             } else if (arg == "-all") {
00121                 runAll = true;
00122             } else if (arg == "-t") {   // -t TEST
00123                 permAssert(i + 1 < argc);
00124                 runSingle = argv[++i];
00125             } else if (arg[1] == 't') { // allow -tTEST
00126                 runSingle = arg.substr(2);
00127             }
00128         } else {
00129             int i = arg.find("=");
00130             if ((0 < i) && (i < arg.size())) {
00131                 // an ad hoc parameter
00132                 std::string key = arg.substr(0,i);
00133                 std::string val = arg.substr(i + 1);
00134                 adhocMap.setStringParam(key,val);
00135             } else {
00136                 // a config file name
00137                 std::ifstream configFile(arg.c_str());
00138                 assert(configFile.good());
00139                 configMap.readParams(configFile);
00140             }
00141         }
00142     }
00143     configMap.mergeFrom(adhocMap);
00144 
00145     // set a default dictionary file location for use by tests that need a
00146     // small non-random sorted data set
00147     if (!configMap.isParamSet(paramDictionaryFileName)) {
00148         std::string dictFileName = "dictWords";
00149         configMap.setStringParam(paramDictionaryFileName,dictFileName);
00150     }
00151 
00152     if (verbose) {
00153         configMap.dumpParams(std::cout);
00154     }
00155 }

TestSuite * TestBase::releaseTestSuite (  )  [inherited]

Definition at line 157 of file TestBase.cpp.

References TestBase::TestCaseGroup::addAllToTestSuite(), TestBase::defaultTests, TestBase::extraTests, TestBase::TestCaseGroup::findTest(), TestBase::pTestObj, TestBase::pTestSuite, TestBase::runAll, TestBase::runSingle, and TestBase::testName.

00158 {
00159     assert(pTestObj);
00160     assert(pTestObj.use_count() > 1);
00161 
00162     // release self-reference now that all test cases have been registered
00163     pTestObj.reset();
00164 
00165     TestSuite* pTestSuite = BOOST_TEST_SUITE(testName.c_str());
00166 
00167     if (runSingle.size()) {
00168         test_unit *p =  defaultTests.findTest(runSingle);
00169         if (!p) {
00170             p = extraTests.findTest(runSingle);
00171         }
00172         if (!p) {
00173             std::cerr << "test " << runSingle << " not found\n";
00174             exit(2);
00175         }
00176         pTestSuite->add(p);
00177     } else {
00178         defaultTests.addAllToTestSuite(pTestSuite);
00179         if (runAll) {
00180             extraTests.addAllToTestSuite(pTestSuite);
00181         }
00182     }
00183     return pTestSuite;
00184 }

void TestBase::beforeTestCase ( std::string  testCaseName  )  [inherited]

Definition at line 214 of file TestBase.cpp.

References TestBase::configMap, TraceSource::initTraceSource(), AutoBacktrace::install(), TestBase::notifyTrace(), AutoBacktrace::setOutputStream(), AutoBacktrace::setTraceTarget(), TestBase::testName, and TRACE_INFO.

00215 {
00216     notifyTrace(testName,TRACE_INFO,"ENTER:  " + testCaseName);
00217 
00218     // Install the AutoBacktrace signal handler now, after
00219     // boost::execution_monitor::catch_signals() has installed its own, so that
00220     // on SIGABRT AutoBacktrace goes first, prints the backtrace, then chains
00221     // to boost, which handles the error.
00222     AutoBacktrace::setOutputStream();
00223     AutoBacktrace::setTraceTarget(shared_from_this());
00224     AutoBacktrace::install();
00225     configMap.initTraceSource(shared_from_this(), "testConfig");
00226 }

void TestBase::afterTestCase ( std::string  testCaseName  )  [inherited]

Definition at line 228 of file TestBase.cpp.

References TestBase::configMap, TraceSource::disableTracing(), TestBase::notifyTrace(), AutoBacktrace::setTraceTarget(), TestBase::testName, and TRACE_INFO.

00229 {
00230     AutoBacktrace::setTraceTarget();
00231     configMap.disableTracing();
00232     notifyTrace(testName,TRACE_INFO,"LEAVE:  " + testCaseName);
00233 }

void TestBase::notifyTrace ( std::string  source,
TraceLevel  level,
std::string  message 
) [virtual, inherited]

Receives notification when a trace event occurs.

Parameters:
source the facility from which the message originated
level the trace event severity level
message the text of the message

Implements TraceTarget.

Definition at line 243 of file TestBase.cpp.

References TestBase::traceFile, TestBase::traceMutex, TestBase::traceStdout, and TestBase::traceStream.

Referenced by TestBase::afterTestCase(), and TestBase::beforeTestCase().

00244 {
00245     if (traceFile || traceStdout) {
00246         StrictMutexGuard traceMutexGuard(traceMutex);
00247         if (traceFile) {
00248             traceStream << "[" << source << "] " << message << std::endl;
00249             traceStream.flush();
00250         }
00251         if (traceStdout) {
00252             std::cout << "[" << source << "] " << message << std::endl;
00253             std::cout.flush();
00254         }
00255     }
00256 }

TraceLevel TestBase::getSourceTraceLevel ( std::string  source  )  [virtual, inherited]

Gets the level at which a particular source should be traced.

Parameters:
source name of source to be traced
Returns:
minimum severity level which should be traced

Implements TraceTarget.

Definition at line 258 of file TestBase.cpp.

References TestBase::traceLevel.

Referenced by LbmExecStreamTestBase::generateBitmaps().

00259 {
00260     return traceLevel;
00261 }

LogicalTxn * LogicalTxnParticipant::getLogicalTxn (  )  [inline, protected, inherited]

Returns:
LogicalTxn being participated in, or null if no txn in progress; null is also returned during recovery

Definition at line 111 of file LogicalTxnParticipant.h.

References LogicalTxnParticipant::pTxn.

Referenced by commit(), BTreeWriter::deleteCurrent(), FtrsTableWriter::execute(), DatabaseTest::executeIncrementAction(), BTreeWriter::insertTupleFromBuffer(), rollbackFull(), testActions(), testCheckpointCommitSavepoint(), testRollbackSavepoint(), testTxn(), and testTxnIdSequence().

00112 {
00113     return pTxn;
00114 }

bool LogicalTxnParticipant::isLoggingEnabled (  )  const [inline, protected, inherited]

Returns:
true if actions should be logged; this is false during recovery

Definition at line 116 of file LogicalTxnParticipant.h.

References LogicalTxnParticipant::loggingEnabled.

Referenced by BTreeWriter::deleteCurrent(), FtrsTableWriter::execute(), BTreeWriter::insertTupleFromBuffer(), and BTreeWriter::updateCurrent().

00117 {
00118     return loggingEnabled;
00119 }


Member Data Documentation

const int LogicalTxnTest::participantDescription [static, private]

Definition at line 45 of file LogicalTxnTest.cpp.

Referenced by describeParticipant(), and loadParticipant().

const LogicalActionType LogicalTxnTest::ACTION_TEST [static, private]

Definition at line 46 of file LogicalTxnTest.cpp.

Referenced by redoLogicalAction(), testActions(), testTxn(), and undoLogicalAction().

SharedLogicalTxnLog LogicalTxnTest::pTxnLog [private]

Definition at line 48 of file LogicalTxnTest.cpp.

Referenced by checkpointTxnLog(), commit(), rollbackFull(), testTxn(), and testTxnIdSequence().

LogicalTxnLogCheckpointMemento LogicalTxnTest::firstCheckpointMemento [private]

Definition at line 49 of file LogicalTxnTest.cpp.

Referenced by testCommit(), and testTxn().

LogicalTxnLogCheckpointMemento LogicalTxnTest::intermediateCheckpointMemento [private]

Definition at line 50 of file LogicalTxnTest.cpp.

Referenced by testCheckpointCommitSavepoint(), testCommit(), testRollback(), and testTxn().

LogicalTxnLogCheckpointMemento LogicalTxnTest::finalCheckpointMemento [private]

Definition at line 51 of file LogicalTxnTest.cpp.

Referenced by commit(), and rollbackFull().

SavepointId LogicalTxnTest::svptId [private]

Definition at line 52 of file LogicalTxnTest.cpp.

Referenced by testCheckpointCommitSavepoint(), testRollbackSavepoint(), and testTxn().

PseudoUuid LogicalTxnTest::onlineUuid [private]

Definition at line 53 of file LogicalTxnTest.cpp.

Referenced by createRecoveryLog(), LogicalTxnTest(), and testTxn().

std::vector<ExpectedRange> LogicalTxnTest::expected [private]

Definition at line 56 of file LogicalTxnTest.cpp.

Referenced by redoLogicalAction(), rollbackFull(), testCaseSetUp(), testCheckpointCommitSavepoint(), testCommit(), testRollback(), testRollbackSavepoint(), and undoLogicalAction().

SharedSegmentFactory SegStorageTestBase::pSegmentFactory [protected, inherited]

Definition at line 40 of file SegStorageTestBase.h.

Referenced by BackupRestoreTest::backup(), SegStorageTestBase::createLinearDeviceSegment(), createRecoveryLog(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), SegStorageTestBase::openRandomSegment(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), BackupRestoreTest::restore(), SegStorageTestBase::SegStorageTestBase(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), LhxHashTableTest::testCaseSetUp(), LcsClusterReplaceExecStreamTest::testClusterReplace(), LhxAggExecStreamTest::testCountImpl(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamGovernorTest::testGovernor(), LhxAggExecStreamTest::testGroupCountImpl(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), BTreeTest::testInserts(), LbmIntersectExecStreamTest::testIntersect(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), LbmEntryTest::testMergeEntry(), BTreeTest::testMultiKeySearches(), BTreeTest::testScan(), ExecStreamTestSuite::testScratchBufferExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), FlatFileExecStreamTest::testStream(), LhxAggExecStreamTest::testSumImpl(), testTxn(), SnapshotSegmentTest::testUncommittedReads(), LbmUnionExecStreamTest::testUnion(), SegStreamTest::testWriteSpillAndRead(), and LbmEntryTest::testZeroBytes().

SharedSegment SegStorageTestBase::pLinearSegment [protected, inherited]

Segment supporting linear page allocation.

Definition at line 45 of file SegStorageTestBase.h.

Referenced by SegStorageTestBase::closeLinearSegment(), createRecoveryLog(), SegmentTestBase::lockPage(), SegStorageTestBase::openRandomSegment(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), SegStorageTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), SegmentTestBase::openStorage(), SegmentTestBase::prefetchPage(), SnapshotSegmentTestBase::testAllocateAll(), LinearViewSegmentTest::testAllocateAll(), VersionedSegmentTest::testCheckpoint(), SegmentTestBase::testCheckpoint(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), SegStreamTest::testMarkReset(), SegStreamTest::testReadSeg(), VersionedSegmentTest::testRecovery(), testTxn(), SnapshotSegmentTest::testUncommittedReads(), SegStreamTest::testWriteSeg(), and VersionedSegmentTest::verifyPage().

SharedSegment SegStorageTestBase::pRandomSegment [protected, inherited]

(Optional) segment supporting random page allocation.

Definition at line 50 of file SegStorageTestBase.h.

Referenced by SegStorageTestBase::closeRandomSegment(), SnapshotSegmentTestBase::closeStorage(), LbmSplicerExecStreamTest::createBTree(), LbmSplicerExecStreamTest::initBTreeParam(), LbmSearchTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeTupleDesc(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegStorageTestBase::openRandomSegment(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), SegmentTestBase::openStorage(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), ExecStreamTestSuite::testBTreeInsertExecStream(), BTreeTest::testBulkLoad(), LhxHashTableTest::testCaseSetUp(), BTreeTest::testCaseSetUp(), BTreeReadersTest::testCaseSetUp(), LcsRowScanExecStreamTest::testCaseSetUp(), LcsMultiClusterAppendTest::testCaseSetUp(), LcsClusterReplaceExecStreamTest::testCaseSetUp(), LcsClusterAppendExecStreamTest::testCaseSetUp(), LbmExecStreamTestBase::testCaseSetUp(), LcsClusterReplaceExecStreamTest::testClusterReplace(), LhxAggExecStreamTest::testCountImpl(), SegmentTestBase::testDeallocate(), LhxAggExecStreamTest::testGroupCountImpl(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), BTreeTest::testInserts(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), ExecStreamTestSuite::testMergeImplicitPullInputs(), BTreeTest::testMultiKeySearches(), BTreeReadersTest::testReaders(), LcsRowScanExecStreamTest::testScanOnEmptyCluster(), ExecStreamTestSuite::testSegBufferExecStream(), ExecStreamTestSuite::testSegBufferReaderWriterExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), LhxAggExecStreamTest::testSumImpl(), and LbmUnionExecStreamTest::testUnion().

SharedSegment SegStorageTestBase::pVersionedRandomSegment [protected, inherited]

(Optional) segment supporting versioned random page allocation.

Definition at line 55 of file SegStorageTestBase.h.

Referenced by BackupRestoreTest::backup(), SnapshotSegmentTestBase::closeStorage(), SegStorageTestBase::closeVersionedRandomSegment(), SnapshotSegmentTest::deallocateOldPages(), SnapshotSegmentTestBase::openSegmentStorage(), BackupRestoreTest::restore(), LcsClusterReplaceExecStreamTest::testClusterReplace(), SnapshotSegmentTest::testRollback(), and SnapshotSegmentTest::testUncommittedReads().

SharedSegment SegStorageTestBase::pSnapshotRandomSegment [protected, inherited]

(Optional) segment supporting snapshot random page allocation.

Definition at line 60 of file SegStorageTestBase.h.

Referenced by SegStorageTestBase::closeSnapshotRandomSegment(), SnapshotSegmentTestBase::commitChanges(), SnapshotSegmentTestBase::openSegmentStorage(), LcsClusterReplaceExecStreamTest::testClusterReplace(), and SnapshotSegmentTest::testDeallocateOld().

VictimPolicy CacheTestBase::victimPolicy [protected, inherited]

VictimPolicy to instantiate.

Definition at line 53 of file CacheTestBase.h.

Referenced by CacheTestBase::CacheTestBase(), and CacheTestBase::newCache().

CacheParams CacheTestBase::cacheParams [protected, inherited]

Parameters for cache initialization.

Definition at line 58 of file CacheTestBase.h.

Referenced by CacheTestBase::CacheTestBase(), CacheTestBase::newCache(), BackupRestoreTest::testBackupCleanup(), BackupRestoreTest::testHeaderBackupRestore(), and SegPageEntryIterTest::testIter().

SharedCache CacheTestBase::pCache [protected, inherited]

Cache instance being tested.

Definition at line 63 of file CacheTestBase.h.

Referenced by BackupRestoreTest::backup(), CacheTestBase::closeDevice(), CacheTestBase::closeStorage(), LbmSplicerExecStreamTest::createBTree(), SegStorageTestBase::createLinearDeviceSegment(), createRecoveryLog(), BackupRestoreTest::createSnapshotData(), BackupRestoreTest::executeSnapshotTxn(), CacheTestBase::getCache(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LbmSearchTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegmentTestBase::lockPage(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), CacheTestBase::openDevice(), CacheTestBase::openStorage(), LcsClusterReplaceExecStreamTest::replaceCluster(), BackupRestoreTest::restore(), LbmSplicerExecStreamTest::spliceInput(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), BackupRestoreTest::testBackupCleanup(), ExecStreamTestSuite::testBTreeInsertExecStream(), BTreeTest::testBulkLoad(), LhxHashTableTest::testCaseSetUp(), ExecStreamUnitTestBase::testCaseSetUp(), BTreeTest::testCaseSetUp(), BTreeReadersTest::testCaseSetUp(), LhxAggExecStreamTest::testCountImpl(), SegmentTestBase::testDeallocate(), SnapshotSegmentTest::testDeallocateOld(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamGovernorTest::testGovernor(), LhxAggExecStreamTest::testGroupCountImpl(), BackupRestoreTest::testHeaderBackupRestore(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), BTreeTest::testInserts(), LbmIntersectExecStreamTest::testIntersect(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), CacheTest::testLargeCacheInit(), CacheTest::testLargeCacheRequest(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), SegStreamTest::testMarkReset(), LbmEntryTest::testMergeEntry(), BTreeTest::testMultiKeySearches(), CacheTest::testQuotaCacheAccessor(), BTreeReadersTest::testReaders(), SegStreamTest::testReadSeg(), BTreeTest::testScan(), LcsRowScanExecStreamTest::testScanOnEmptyCluster(), ExecStreamTestSuite::testScratchBufferExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), FlatFileExecStreamTest::testStream(), LhxAggExecStreamTest::testSumImpl(), testTxn(), testTxnIdSequence(), LbmUnionExecStreamTest::testUnion(), SegStreamTest::testWriteSeg(), SegStreamTest::testWriteSpillAndRead(), LbmEntryTest::testZeroBytes(), and BackupRestoreTest::verifySnapshotData().

SharedRandomAccessDevice CacheTestBase::pRandomAccessDevice [protected, inherited]

The default cached device.

Definition at line 68 of file CacheTestBase.h.

Referenced by BackupRestoreTest::backup(), CacheTestBase::closeStorage(), SegStorageTestBase::openSegmentStorage(), CacheTestBase::openStorage(), and BackupRestoreTest::restore().

uint CacheTestBase::nMemPages [protected, inherited]

Size of cache in memory pages.

Definition at line 73 of file CacheTestBase.h.

Referenced by CacheTestBase::CacheTestBase(), PagingTestBase::testCacheResize(), and ExecStreamTestBase::testCaseSetUp().

uint CacheTestBase::nDiskPages [protected, inherited]

Size of device in disk pages.

Definition at line 78 of file CacheTestBase.h.

Referenced by CacheTestBase::CacheTestBase(), LinearViewSegmentTest::LinearViewSegmentTest(), CacheTest::makeBlockId(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), CacheTestBase::openStorage(), SegStreamTest::SegStreamTest(), SnapshotSegmentTestBase::SnapshotSegmentTestBase(), SnapshotSegmentTest::testDeallocateOld(), PagingTestBase::testPrefetch(), PagingTestBase::testPrefetchBatch(), PagingTestBase::testRandomOp(), SnapshotSegmentTest::testRollback(), PagingTestBase::testSequentialOp(), and PagingTestBase::testSkipOp().

uint CacheTestBase::cbPageFull [protected, inherited]

Disk page size.

Definition at line 83 of file CacheTestBase.h.

Referenced by CacheTest::CacheTest(), CacheTestBase::CacheTestBase(), CacheTestBase::openDevice(), and SegStorageTestBase::openSegmentStorage().

DeviceId CacheTestBase::dataDeviceId [protected, inherited]

Fixed ID to assign to data device.

Definition at line 88 of file CacheTestBase.h.

Referenced by CacheTestBase::CacheTestBase(), CacheTestBase::closeStorage(), CacheTest::makeBlockId(), SnapshotSegmentTestBase::openSegmentStorage(), SegStorageTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), CacheTestBase::openStorage(), and PagingTestBase::testCheckpoint().

TestSuite* TestBase::pTestSuite [protected, inherited]

Boost test suite.

Definition at line 59 of file TestBase.h.

Referenced by TestBase::releaseTestSuite().

boost::shared_ptr<TestBase> TestBase::pTestObj [protected, inherited]

Definition at line 61 of file TestBase.h.

Referenced by TestBase::releaseTestSuite(), and TestBase::TestBase().

std::ofstream TestBase::traceStream [protected, inherited]

Output file stream for tracing.

Definition at line 66 of file TestBase.h.

Referenced by TestBase::notifyTrace(), TestBase::TestBase(), and TestBase::~TestBase().

StrictMutex TestBase::traceMutex [protected, inherited]

Protects traceStream.

Definition at line 71 of file TestBase.h.

Referenced by TestBase::notifyTrace().

std::string TestBase::testName [protected, inherited]

Name of test.

Definition at line 76 of file TestBase.h.

Referenced by TestBase::afterTestCase(), TestBase::beforeTestCase(), TestBase::releaseTestSuite(), TestBase::TestBase(), LhxHashTableTest::testInsert1Ka(), and LhxHashTableTest::testInsert1Kb().

TraceLevel TestBase::traceLevel [protected, inherited]

Level at which to trace test execution.

Definition at line 81 of file TestBase.h.

Referenced by TestBase::getSourceTraceLevel(), and TestBase::TestBase().

FileStatsTarget TestBase::statsTarget [protected, inherited]

Output for stats.

Definition at line 86 of file TestBase.h.

StatsTimer TestBase::statsTimer [protected, inherited]

Timer for stats collection.

Definition at line 91 of file TestBase.h.

Referenced by CacheTestBase::closeStorage(), CacheTestBase::openStorage(), BTreeTxnTest::testCaseSetUp(), BTreeTxnTest::testCaseTearDown(), and BTreeTxnTest::testTxns().

bool TestBase::traceStdout [protected, inherited]

Copy trace output to stdout.

Definition at line 99 of file TestBase.h.

Referenced by TestBase::notifyTrace(), and TestBase::TestBase().

bool TestBase::traceFile [protected, inherited]

Copy trace output to file.

Definition at line 104 of file TestBase.h.

Referenced by TestBase::notifyTrace(), and TestBase::TestBase().

bool TestBase::runAll [static, protected, inherited]

Run all test cases, including the extra tests.

(static, since set by readParams())

Definition at line 110 of file TestBase.h.

Referenced by TestBase::readParams(), and TestBase::releaseTestSuite().

std::string TestBase::runSingle [static, protected, inherited]

Run only the test case of this name.

(static, since set by readParams())

Definition at line 116 of file TestBase.h.

Referenced by TestBase::readParams(), and TestBase::releaseTestSuite().

TestCaseGroup TestBase::defaultTests [protected, inherited]

Definition at line 139 of file TestBase.h.

Referenced by TestBase::releaseTestSuite().

TestCaseGroup TestBase::extraTests [protected, inherited]

Definition at line 140 of file TestBase.h.

Referenced by TestBase::releaseTestSuite().

ParamName TestBase::paramTestSuiteName [static, inherited]

Definition at line 143 of file TestBase.h.

Referenced by TestBase::TestBase().

ParamName TestBase::paramTraceFileName [static, inherited]

Definition at line 144 of file TestBase.h.

Referenced by TestBase::TestBase().

ParamName TestBase::paramDictionaryFileName [static, inherited]

Definition at line 145 of file TestBase.h.

Referenced by TestBase::readParams(), SegStreamTest::testRead(), and SegStreamTest::testWrite().

ParamName TestBase::paramTraceLevel [static, inherited]

Definition at line 146 of file TestBase.h.

Referenced by TestBase::TestBase().

ParamName TestBase::paramStatsFileName [static, inherited]

Definition at line 147 of file TestBase.h.

ParamName TestBase::paramTraceStdout [static, inherited]

Definition at line 148 of file TestBase.h.

Referenced by TestBase::TestBase().

ParamName TestBase::paramDegreeOfParallelism [static, inherited]

Definition at line 149 of file TestBase.h.

Referenced by ParallelExecStreamSchedulerTest::ParallelExecStreamSchedulerTest().

ConfigMap TestBase::configMap [static, inherited]

Configuration parameters.

The reason this is static is so that no constructor parameters (which burden virtual bases) are needed.

Definition at line 155 of file TestBase.h.

Referenced by TestBase::afterTestCase(), TestBase::beforeTestCase(), BTreeTxnTest::BTreeTxnTest(), CacheTestBase::CacheTestBase(), BackupRestoreTest::createSnapshotData(), DatabaseTest::DatabaseTest(), TestOptionsTest::extra(), DatabaseTest::loadDatabase(), SparseBitmapTest::openStorage(), PagingTestBase::PagingTestBase(), ParallelExecStreamSchedulerTest::ParallelExecStreamSchedulerTest(), RandomAccessFileDeviceTest::RandomAccessFileDeviceTest(), TestBase::readParams(), SegStorageTestBase::SegStorageTestBase(), TestOptionsTest::test1(), TestOptionsTest::test2(), BackupRestoreTest::testBackupCleanup(), TestBase::TestBase(), BTreeTxnTest::testCaseSetUp(), BTreeTxnTest::testCheckpoint(), DatabaseTest::testCreateEmpty(), DatabaseTest::testForceTxns(), BackupRestoreTest::testHeaderBackupRestore(), SegPageEntryIterTest::testIter(), SegStreamTest::testRead(), BTreeTxnTest::testTxns(), SegStreamTest::testWrite(), ThreadedTestBase::ThreadedTestBase(), and TestBase::~TestBase().


The documentation for this class was generated from the following file:
Generated on Mon Jun 22 04:00:39 2009 for Fennel by  doxygen 1.5.1