BTreeReadersTest Class Reference

This test unit tests the BTreeNonLeafReader and BTreeLeafReader classes. More...

Inheritance diagram for BTreeReadersTest:

SegStorageTestBase CacheTestBase TestBase TraceTarget List of all members.

Public Member Functions

 BTreeReadersTest ()
virtual void testCaseSetUp ()
 Equivalent to JUnit TestCase.setUp; this is called before each test case method is invoked.
virtual void testCaseTearDown ()
 Equivalent to JUnit TestCase.tearDown; this is called after each test case method is invoked.
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)
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)

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

enum  { nRandomSeed = 1000000, iValueMax = 1000000000 }

Private Member Functions

int32_t readLeafKey ()
int32_t readNonLeafKey ()
PageId readPageId ()
int32_t readLeafValue ()
void testOneLevel ()
void testTwoLevels ()
void testThreeLevels ()
void testReaders (uint nRecords)
void testScan (SharedByteInputStream, uint nRecords)
void testSearch (SharedByteInputStream, uint nRecords)
void marshalLeafRecord ()
void unmarshalLeafRecord (SharedByteInputStream pInputStream)

Private Attributes

BTreeDescriptor treeDescriptor
TupleDescriptor nonLeafDescriptor
TupleAccessor leafTupleAccessor
TupleData keyData
TupleData leafTupleData
TupleData nonLeafTupleData
LeafRecord leafRecord
boost::scoped_array< FixedBuffernonLeafRecordBuf
boost::scoped_array< FixedBufferleafRecordBuf

Classes

struct  LeafRecord

Detailed Description

This test unit tests the BTreeNonLeafReader and BTreeLeafReader classes.

Definition at line 44 of file BTreeReadersTest.cpp.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
nRandomSeed 
iValueMax 

Definition at line 46 of file BTreeReadersTest.cpp.

00046          {
00047         nRandomSeed = 1000000,
00048         iValueMax = 1000000000
00049     };

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

BTreeReadersTest::BTreeReadersTest (  )  [inline, explicit]

Definition at line 96 of file BTreeReadersTest.cpp.

References TupleData::compute(), TupleAccessor::compute(), FixedBuffer, TupleAccessor::getMaxByteCount(), BTreeDescriptor::keyProjection, leafRecordBuf, leafTupleAccessor, leafTupleData, StandardTypeDescriptorFactory::newDataType(), nonLeafDescriptor, nonLeafTupleData, STANDARD_TYPE_INT_32, STANDARD_TYPE_UINT_64, testOneLevel(), testThreeLevels(), testTwoLevels(), treeDescriptor, and BTreeDescriptor::tupleDescriptor.

00097     {
00098         FENNEL_UNIT_TEST_CASE(BTreeReadersTest,testOneLevel);
00099         FENNEL_UNIT_TEST_CASE(BTreeReadersTest,testTwoLevels);
00100         FENNEL_UNIT_TEST_CASE(BTreeReadersTest,testThreeLevels);
00101 
00102         StandardTypeDescriptorFactory stdTypeFactory;
00103         TupleAttributeDescriptor attrDesc(
00104             stdTypeFactory.newDataType(STANDARD_TYPE_INT_32));
00105         treeDescriptor.tupleDescriptor.push_back(attrDesc);
00106         treeDescriptor.tupleDescriptor.push_back(attrDesc);
00107         treeDescriptor.keyProjection.push_back(0);
00108         leafTupleAccessor.compute(treeDescriptor.tupleDescriptor);
00109         leafRecordBuf.reset(
00110             new FixedBuffer[leafTupleAccessor.getMaxByteCount()]);
00111         leafTupleData.compute(treeDescriptor.tupleDescriptor);
00112 
00113         nonLeafDescriptor.push_back(attrDesc);
00114         TupleAttributeDescriptor pageIdDesc(
00115             stdTypeFactory.newDataType(STANDARD_TYPE_UINT_64));
00116         nonLeafDescriptor.push_back(pageIdDesc);
00117         nonLeafTupleData.compute(nonLeafDescriptor);
00118     }


Member Function Documentation

int32_t BTreeReadersTest::readLeafKey (  )  [private]

Definition at line 350 of file BTreeReadersTest.cpp.

References leafTupleData.

Referenced by testScan(), testSearch(), and unmarshalLeafRecord().

00351 {
00352     return *reinterpret_cast<int32_t const *>(
00353         leafTupleData[0].pData);
00354 }

int32_t BTreeReadersTest::readNonLeafKey (  )  [private]

Definition at line 362 of file BTreeReadersTest.cpp.

References nonLeafTupleData.

Referenced by testScan(), and testSearch().

00363 {
00364     return *reinterpret_cast<int32_t const *>(
00365         nonLeafTupleData[0].pData);
00366 }

PageId BTreeReadersTest::readPageId (  )  [private]

Definition at line 368 of file BTreeReadersTest.cpp.

References nonLeafTupleData.

Referenced by testScan(), and testSearch().

00369 {
00370     return *reinterpret_cast<PageId const *>(
00371         nonLeafTupleData[1].pData);
00372 }

int32_t BTreeReadersTest::readLeafValue (  )  [private]

Definition at line 356 of file BTreeReadersTest.cpp.

References leafTupleData.

Referenced by testScan(), testSearch(), and unmarshalLeafRecord().

00357 {
00358     return *reinterpret_cast<int32_t const *>(
00359         leafTupleData[1].pData);
00360 }

void BTreeReadersTest::testOneLevel (  )  [inline, private]

Definition at line 73 of file BTreeReadersTest.cpp.

References testReaders().

Referenced by BTreeReadersTest().

00074     {
00075         testReaders(200);
00076     }

void BTreeReadersTest::testTwoLevels (  )  [inline, private]

Definition at line 78 of file BTreeReadersTest.cpp.

References testReaders().

Referenced by BTreeReadersTest().

00079     {
00080         testReaders(20000);
00081     }

void BTreeReadersTest::testThreeLevels (  )  [inline, private]

Definition at line 83 of file BTreeReadersTest.cpp.

References testReaders().

Referenced by BTreeReadersTest().

00084     {
00085         testReaders(200000);
00086     }

void BTreeReadersTest::testReaders ( uint  nRecords  )  [private]

Definition at line 157 of file BTreeReadersTest.cpp.

References BTreeBuilder::build(), TupleData::compute(), BTreeBuilder::createEmptyRoot(), TupleAccessor::getCurrentByteCount(), BTreeAccessBase::getKeyDescriptor(), BTreeAccessBase::getRootPageId(), iValueMax, BTreeReadersTest::LeafRecord::key, keyData, leafRecord, leafRecordBuf, leafTupleAccessor, marshalLeafRecord(), SegInputStream::newSegInputStream(), SegOutputStream::newSegOutputStream(), nRandomSeed, NULL_PAGE_ID, CacheTestBase::pCache, SegStorageTestBase::pRandomSegment, BTreeDescriptor::rootPageId, testScan(), testSearch(), treeDescriptor, BTreeBuilder::truncate(), and BTreeReadersTest::LeafRecord::value.

Referenced by testOneLevel(), testThreeLevels(), and testTwoLevels().

00158 {
00159     // Load the btree with random values
00160 
00161     treeDescriptor.rootPageId = NULL_PAGE_ID;
00162     BTreeBuilder builder(treeDescriptor, pRandomSegment);
00163 
00164     keyData.compute(builder.getKeyDescriptor());
00165     keyData[0].pData = reinterpret_cast<PConstBuffer>(&leafRecord.key);
00166 
00167     builder.createEmptyRoot();
00168     treeDescriptor.rootPageId = builder.getRootPageId();
00169 
00170     // Generate random key/value data
00171     SegmentAccessor segmentAccessor(pRandomSegment,pCache);
00172     SharedSegOutputStream pOutputStream =
00173         SegOutputStream::newSegOutputStream(segmentAccessor);
00174     std::subtractive_rng randomNumberGenerator(nRandomSeed);
00175     leafRecord.key = 0;
00176     for (uint i = 0; i < nRecords; i++) {
00177         // +2 to guarantee holes
00178         leafRecord.key += (randomNumberGenerator(10)) + 2;
00179         leafRecord.value = randomNumberGenerator(iValueMax);
00180 
00181         marshalLeafRecord();
00182         uint cbTuple = leafTupleAccessor.getCurrentByteCount();
00183         PBuffer pBuffer = pOutputStream->getWritePointer(cbTuple);
00184         memcpy(pBuffer,leafRecordBuf.get(),cbTuple);
00185         pOutputStream->consumeWritePointer(cbTuple);
00186     }
00187     PageId pageId = pOutputStream->getFirstPageId();
00188     pOutputStream.reset();
00189     SharedSegInputStream pInputStream =
00190         SegInputStream::newSegInputStream(segmentAccessor,pageId);
00191     SegStreamPosition startPos;
00192     pInputStream->getSegPos(startPos);
00193 
00194     // Load the data into the tree
00195     builder.build(*pInputStream,nRecords,1.0);
00196     treeDescriptor.rootPageId = builder.getRootPageId();
00197 
00198     // Make sure we can search for each key individually
00199     pInputStream->seekSegPos(startPos);
00200     testSearch(pInputStream,nRecords);
00201 
00202     // Make sure we can scan all tuples
00203     pInputStream->seekSegPos(startPos);
00204     testScan(pInputStream,nRecords);
00205 
00206     // Deallocate the test data storage
00207     pInputStream->seekSegPos(startPos);
00208     pInputStream->setDeallocate(true);
00209     pInputStream.reset();
00210 
00211     // And deallocate the tree's storage
00212     builder.truncate(true);
00213 }

void BTreeReadersTest::testScan ( SharedByteInputStream  ,
uint  nRecords 
) [private]

Definition at line 258 of file BTreeReadersTest.cpp.

References BTreeReader::endSearch(), BTreeLeafReader::endSearch(), BTreeAccessBase::getRootPageId(), BTreeReader::getTupleAccessorForRead(), BTreeNonLeafReader::getTupleAccessorForRead(), BTreeNonLeafReader::isPositionedOnInfinityKey(), BTreeNonLeafReader::isRootOnly(), BTreeReadersTest::LeafRecord::key, leafRecord, leafTupleData, nonLeafTupleData, readLeafKey(), readLeafValue(), readNonLeafKey(), readPageId(), BTreeReader::searchFirst(), BTreeReader::searchLast(), BTreeNonLeafReader::searchNext(), BTreeLeafReader::searchNext(), BTreeLeafReader::setCurrentPageId(), treeDescriptor, TupleAccessor::unmarshal(), unmarshalLeafRecord(), and BTreeReadersTest::LeafRecord::value.

Referenced by testReaders().

00261 {
00262     // Read records from both leaf and non-leaf pages starting from left
00263     // to right.
00264 
00265     BTreeNonLeafReader nonLeafReader(treeDescriptor);
00266     BTreeLeafReader leafReader(treeDescriptor);
00267 
00268     // Position to the first record in the non-leaf page, just above the leaf
00269     // level.
00270     bool found;
00271     int32_t lastKey = -1;
00272     bool rootOnly = nonLeafReader.isRootOnly();
00273     if (!rootOnly) {
00274         found = nonLeafReader.searchFirst();
00275         if (!found) {
00276             BOOST_FAIL("searchFirst on non-leaf found nothing");
00277         }
00278     }
00279 
00280     for (uint i = 0; i < nRecords;) {
00281         unmarshalLeafRecord(pInputStream);
00282         PageId leafPageId;
00283         if (rootOnly) {
00284             leafPageId = nonLeafReader.getRootPageId();
00285         } else {
00286             // Read the non-leaf record to locate the leaf pageId.
00287             nonLeafReader.getTupleAccessorForRead().unmarshal(nonLeafTupleData);
00288             if (!nonLeafReader.isPositionedOnInfinityKey() &&
00289                 readNonLeafKey() < leafRecord.key)
00290             {
00291                 BOOST_FAIL(
00292                     "Non-leaf key is less than expected key.  Expected key = "
00293                     << leafRecord.key << ".  Key read = " << readNonLeafKey());
00294             }
00295             leafPageId = readPageId();
00296         }
00297         leafReader.setCurrentPageId(leafPageId);
00298 
00299         // Position to the start of that leaf page.
00300         found = leafReader.searchFirst();
00301         if (!found) {
00302             BOOST_FAIL("searchFirst on leaf found nothing");
00303         }
00304 
00305         // Iterate over each record in the leaf page until we hit the
00306         // end of the page.
00307         while (true) {
00308             leafReader.getTupleAccessorForRead().unmarshal(leafTupleData);
00309             lastKey = readLeafKey();
00310             BOOST_CHECK_EQUAL(leafRecord.key, lastKey);
00311             BOOST_CHECK_EQUAL(leafRecord.value, readLeafValue());
00312             i++;
00313             if (i == nRecords) {
00314                 break;
00315             }
00316             found = leafReader.searchNext();
00317             if (!found) {
00318                 break;
00319             }
00320             unmarshalLeafRecord(pInputStream);
00321         }
00322 
00323         // Check that the last key on the leaf matches the last one read
00324         // in the loop above.
00325         found = leafReader.searchLast();
00326         if (!found) {
00327             BOOST_FAIL("seachLast on leaf found nothing");
00328         }
00329         leafReader.getTupleAccessorForRead().unmarshal(leafTupleData);
00330         BOOST_CHECK_EQUAL(lastKey, readLeafKey());
00331         leafReader.endSearch();
00332 
00333         if (i == nRecords) {
00334             break;
00335         }
00336 
00337         if (!rootOnly) {
00338             // Position to the next record in the non-leaf page, then loop back
00339             // and repeat.
00340             found = nonLeafReader.searchNext();
00341             if (!found) {
00342                 BOOST_FAIL("searchNext on non-leaf found nothing");
00343             }
00344         }
00345     }
00346 
00347     nonLeafReader.endSearch();
00348 }

void BTreeReadersTest::testSearch ( SharedByteInputStream  ,
uint  nRecords 
) [private]

Definition at line 215 of file BTreeReadersTest.cpp.

References DUP_SEEK_ANY, BTreeAccessBase::getRootPageId(), BTreeReader::getTupleAccessorForRead(), BTreeNonLeafReader::getTupleAccessorForRead(), BTreeNonLeafReader::isPositionedOnInfinityKey(), BTreeNonLeafReader::isRootOnly(), BTreeReader::isSingular(), BTreeReadersTest::LeafRecord::key, keyData, leafRecord, leafTupleData, nonLeafTupleData, readLeafKey(), readLeafValue(), readNonLeafKey(), readPageId(), BTreeLeafReader::searchForKey(), BTreeNonLeafReader::searchForKey(), BTreeLeafReader::setCurrentPageId(), treeDescriptor, TupleAccessor::unmarshal(), unmarshalLeafRecord(), and BTreeReadersTest::LeafRecord::value.

Referenced by testReaders().

00218 {
00219     // Search for each key in the btree using both leaf and non-leaf readers
00220 
00221     BTreeNonLeafReader nonLeafReader(treeDescriptor);
00222     BTreeLeafReader leafReader(treeDescriptor);
00223     for (uint i = 0; i < nRecords; ++i) {
00224         // First search for the leaf pageId containing the desired key value
00225         // using the nonLeafReader, provided this is a multi-level tree.
00226         // If not, then directly search the leaf.
00227         unmarshalLeafRecord(pInputStream);
00228 
00229         PageId leafPageId;
00230         if (nonLeafReader.isRootOnly()) {
00231             leafPageId = nonLeafReader.getRootPageId();
00232         } else {
00233             nonLeafReader.searchForKey(keyData, DUP_SEEK_ANY);
00234             BOOST_CHECK(!nonLeafReader.isSingular());
00235             nonLeafReader.getTupleAccessorForRead().unmarshal(nonLeafTupleData);
00236             if (!nonLeafReader.isPositionedOnInfinityKey() &&
00237                 readNonLeafKey() < leafRecord.key)
00238             {
00239                 BOOST_FAIL(
00240                     "Non-leaf key is less than expected key.  Expected key = "
00241                     << leafRecord.key << ".  Key read = " << readNonLeafKey());
00242             }
00243             leafPageId = readPageId();
00244         }
00245 
00246         // Use the leafReader to locate the key in the leaf page
00247         leafReader.setCurrentPageId(leafPageId);
00248         if (!leafReader.searchForKey(keyData, DUP_SEEK_ANY)) {
00249             BOOST_FAIL(
00250                 "Couldn't locate key " << leafRecord.key << " in leaf page");
00251         }
00252         leafReader.getTupleAccessorForRead().unmarshal(leafTupleData);
00253         BOOST_CHECK_EQUAL(leafRecord.key, readLeafKey());
00254         BOOST_CHECK_EQUAL(leafRecord.value, readLeafValue());
00255     }
00256 }

void BTreeReadersTest::marshalLeafRecord (  )  [private]

Definition at line 139 of file BTreeReadersTest.cpp.

References BTreeReadersTest::LeafRecord::key, leafRecord, leafRecordBuf, leafTupleAccessor, leafTupleData, TupleAccessor::marshal(), and BTreeReadersTest::LeafRecord::value.

Referenced by testReaders().

00140 {
00141     leafTupleData[0].pData = reinterpret_cast<PBuffer>(&leafRecord.key);
00142     leafTupleData[1].pData = reinterpret_cast<PBuffer>(&leafRecord.value);
00143     leafTupleAccessor.marshal(leafTupleData, leafRecordBuf.get());
00144 }

void BTreeReadersTest::unmarshalLeafRecord ( SharedByteInputStream  pInputStream  )  [private]

Definition at line 146 of file BTreeReadersTest.cpp.

References TupleAccessor::getCurrentByteCount(), BTreeReadersTest::LeafRecord::key, leafRecord, leafTupleAccessor, leafTupleData, readLeafKey(), readLeafValue(), TupleAccessor::setCurrentTupleBuf(), TupleAccessor::unmarshal(), and BTreeReadersTest::LeafRecord::value.

Referenced by testScan(), and testSearch().

00147 {
00148     PConstBuffer pBuf = pInputStream->getReadPointer(1);
00149     leafTupleAccessor.setCurrentTupleBuf(pBuf);
00150     uint cbTuple = leafTupleAccessor.getCurrentByteCount();
00151     leafTupleAccessor.unmarshal(leafTupleData);
00152     leafRecord.key = readLeafKey();
00153     leafRecord.value = readLeafValue();
00154     pInputStream->consumeReadPointer(cbTuple);
00155 }

void BTreeReadersTest::testCaseSetUp (  )  [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 124 of file BTreeReadersTest.cpp.

References DeviceMode::createNew, SegStorageTestBase::openRandomSegment(), SegStorageTestBase::openStorage(), CacheTestBase::pCache, SegmentAccessor::pCacheAccessor, SegStorageTestBase::pRandomSegment, SegmentAccessor::pSegment, BTreeDescriptor::segmentAccessor, and treeDescriptor.

void BTreeReadersTest::testCaseTearDown (  )  [virtual]

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

Default is no-op.

Reimplemented from CacheTestBase.

Definition at line 133 of file BTreeReadersTest.cpp.

References SegmentAccessor::reset(), BTreeDescriptor::segmentAccessor, CacheTestBase::testCaseTearDown(), and treeDescriptor.

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(), testCaseSetUp(), LbmEntryTest::testCaseSetUp(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), SegStreamTest::testMarkReset(), SegStreamTest::testReadSeg(), LogicalTxnTest::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 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::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 }


Member Data Documentation

BTreeDescriptor BTreeReadersTest::treeDescriptor [private]

Definition at line 57 of file BTreeReadersTest.cpp.

Referenced by BTreeReadersTest(), testCaseSetUp(), testCaseTearDown(), testReaders(), testScan(), and testSearch().

TupleDescriptor BTreeReadersTest::nonLeafDescriptor [private]

Definition at line 58 of file BTreeReadersTest.cpp.

Referenced by BTreeReadersTest().

TupleAccessor BTreeReadersTest::leafTupleAccessor [private]

Definition at line 60 of file BTreeReadersTest.cpp.

Referenced by BTreeReadersTest(), marshalLeafRecord(), testReaders(), and unmarshalLeafRecord().

TupleData BTreeReadersTest::keyData [private]

Definition at line 61 of file BTreeReadersTest.cpp.

Referenced by testReaders(), and testSearch().

TupleData BTreeReadersTest::leafTupleData [private]

Definition at line 62 of file BTreeReadersTest.cpp.

Referenced by BTreeReadersTest(), marshalLeafRecord(), readLeafKey(), readLeafValue(), testScan(), testSearch(), and unmarshalLeafRecord().

TupleData BTreeReadersTest::nonLeafTupleData [private]

Definition at line 63 of file BTreeReadersTest.cpp.

Referenced by BTreeReadersTest(), readNonLeafKey(), readPageId(), testScan(), and testSearch().

LeafRecord BTreeReadersTest::leafRecord [private]

Definition at line 64 of file BTreeReadersTest.cpp.

Referenced by marshalLeafRecord(), testReaders(), testScan(), testSearch(), and unmarshalLeafRecord().

boost::scoped_array<FixedBuffer> BTreeReadersTest::nonLeafRecordBuf [private]

Definition at line 65 of file BTreeReadersTest.cpp.

boost::scoped_array<FixedBuffer> BTreeReadersTest::leafRecordBuf [private]

Definition at line 66 of file BTreeReadersTest.cpp.

Referenced by BTreeReadersTest(), marshalLeafRecord(), and testReaders().

SharedSegmentFactory SegStorageTestBase::pSegmentFactory [protected, inherited]

Definition at line 40 of file SegStorageTestBase.h.

Referenced by BackupRestoreTest::backup(), SegStorageTestBase::createLinearDeviceSegment(), LogicalTxnTest::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(), LogicalTxnTest::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(), LogicalTxnTest::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(), LogicalTxnTest::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(), 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(), 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(), LogicalTxnTest::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(), 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(), testReaders(), SegStreamTest::testReadSeg(), BTreeTest::testScan(), LcsRowScanExecStreamTest::testScanOnEmptyCluster(), ExecStreamTestSuite::testScratchBufferExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), FlatFileExecStreamTest::testStream(), LhxAggExecStreamTest::testSumImpl(), LogicalTxnTest::testTxn(), LogicalTxnTest::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:26 2009 for Fennel by  doxygen 1.5.1