LcsClusterReplaceExecStreamTest Class Reference

Test class for exercising LcsClusterReplaceExecStream. More...

Inheritance diagram for LcsClusterReplaceExecStreamTest:

ExecStreamUnitTestBase SnapshotSegmentTestBase ExecStreamTestBase SegmentTestBase SegStorageTestBase SegStorageTestBase PagingTestBase CacheTestBase CacheTestBase CacheTestBase ThreadedTestBase TestBase TestBase TestBase TestBase TraceTarget TraceTarget TraceTarget TraceTarget List of all members.

Public Types

enum  OpType {
  OP_READ_SEQ, OP_WRITE_SEQ, OP_READ_RAND, OP_WRITE_RAND,
  OP_READ_NOWAIT, OP_WRITE_NOWAIT, OP_WRITE_SKIP, OP_SCRATCH,
  OP_PREFETCH, OP_PREFETCH_BATCH, OP_ALLOCATE, OP_DEALLOCATE,
  OP_CHECKPOINT, OP_RESIZE_CACHE, OP_MAX
}
 The various operations that can be run in the multi-threaded test. More...

Public Member Functions

 LcsClusterReplaceExecStreamTest ()
void testSingleColOddNumRows ()
void testSingleColEvenNumRows ()
void testSingleColSeqStartAt1 ()
void testReplaceAllRows ()
void testReplaceNoRows ()
void test3ColClusterReplace ()
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 openRandomSegment ()
virtual void openStorage (DeviceMode openMode)
virtual void openSegmentStorage (DeviceMode openMode)
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.
virtual void openSegmentStorage (DeviceMode openMode)
virtual void closeStorage ()
virtual void testAllocateAll ()
 Initializes all disk pages, filling them with information based on their block numbers.
virtual void verifyPage (CachePage &page, uint x)
 Verifies that the page contents are correct (based on the parameter x).
virtual void fillPage (CachePage &page, uint x)
 Scribbles on the contents of a page.
virtual void openStorage (DeviceMode openMode)
virtual CachePagelockPage (OpType opType, uint iPage)
virtual void unlockPage (CachePage &page, LockMode lockMode)
virtual void prefetchPage (uint iPage)
virtual void prefetchBatch (uint, uint)
virtual void testAllocate ()
virtual void testDeallocate ()
virtual void testCheckpoint ()
 Performs a periodic checkpoint.
void testSingleThread ()
bool testOp (OpType opType, uint iPage, bool bNice)
 Carries out one operation on a page.
char const * getOpName (OpType opType)
 Makes up an operation name based on an OpType.
LockMode getLockMode (OpType opType)
 Gets the LockMode corresponding to an OpType.
void testSequentialOp (OpType opType)
 Carries out an operation on each disk page in order from 0 to nDiskPages-1.
void testRandomOp (OpType opType)
 Carries out an operation on nRandomOps pages selected at random.
void testSkipOp (OpType opType, uint n)
 Carries out an operation on every "n" pages, starting at page 0.
void testScratch ()
 Performs nRandomOps scratch operations.
void testPrefetch ()
 Performs a limited number of prefetch operations.
void testPrefetchBatch ()
 Performs a limited number of batch prefetch operations.
void testSequentialRead ()
 Carries out one sequential read pass over the entire device.
void testSequentialWrite ()
 Carries out one sequential write pass over the entire device.
void testRandomRead ()
 Carries out nRandomOps read operations on pages selected at random.
void testRandomWrite ()
 Carries out nRandomOps write operations on pages selected at random.
void testSkipWrite (uint n)
 Carries out write operations every n pages.
void testCheckpointGuarded ()
void testCacheResize ()
void testMultipleThreads ()
 Carries out specified tests in multi-threaded mode.
virtual void threadInit ()
virtual void threadTerminate ()
virtual bool testThreadedOp (int iOp)
 Test implementation must be supplied by derived test class.

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

SharedExecStream prepareSourceGraph (ExecStreamEmbryo &sourceStreamEmbryo)
 Defines and prepares a graph consisting of one source stream.
SharedExecStream prepareTransformGraph (ExecStreamEmbryo &sourceStreamEmbryo, ExecStreamEmbryo &transformStreamEmbryo)
 Defines and prepares a graph consisting of one source stream and one transform stream.
SharedExecStream prepareTransformGraph (ExecStreamEmbryo &sourceStreamEmbryo, std::vector< ExecStreamEmbryo > &transforms)
 Defines and prepares a graph consisting of one source stream and one or multiple transform streams.
SharedExecStream prepareConfluenceGraph (ExecStreamEmbryo &sourceStreamEmbryo1, ExecStreamEmbryo &sourceStreamEmbryo2, ExecStreamEmbryo &confluenceStreamEmbryo)
 Defines and prepares a graph consisting of two source streams and one confluence stream.
SharedExecStream prepareConfluenceGraph (std::vector< ExecStreamEmbryo > &sourceStreamEmbryos, ExecStreamEmbryo &confluenceStreamEmbryo)
 Defines and prepares a graph consisting of a list of source streams and one confluence stream.
SharedExecStream prepareConfluenceGraph (std::vector< std::vector< ExecStreamEmbryo > > &sourceStreamEmbryosList, ExecStreamEmbryo &confluenceStreamEmbryo)
 Defines and prepares a graph consisting of one or more source streams and one confluence stream.
SharedExecStream prepareConfluenceTransformGraph (ExecStreamEmbryo &sourceStreamEmbryo1, ExecStreamEmbryo &sourceStreamEmbryo2, ExecStreamEmbryo &confluenceStreamEmbryo, ExecStreamEmbryo &transformStreamEmbryo)
 Defines and prepares a graph consisting of two source streams, one confluence stream, and one transform stream.
SharedExecStream prepareDAG (ExecStreamEmbryo &srcStreamEmbryo, ExecStreamEmbryo &splitterStreamEmbryo, std::vector< ExecStreamEmbryo > &interStreamEmbryos, ExecStreamEmbryo &destStreamEmbryo, bool createSink=true, bool saveSrc=true)
 Defines and prepares a graph consisting of a source, a splitter, and one or more parallel transform streams which flow together into a confluence stream.
SharedExecStream prepareDAG (ExecStreamEmbryo &srcStreamEmbryo, ExecStreamEmbryo &splitterStreamEmbryo, std::vector< std::vector< ExecStreamEmbryo > > &interStreamEmbryosList, ExecStreamEmbryo &destStreamEmbryo, bool createSink=true, bool saveSrc=true)
 Defines and prepares a graph consisting of a source, a splitter, and one or more parallel transform streams which flow together into a confluence stream.
void verifyOutput (ExecStream &stream, uint nRowsExpected, MockProducerExecStreamGenerator &verifier, bool stopEarly=false)
 Executes the prepared stream graph and verifies that its output matches that produced by a value generator.
void verifyConstantOutput (ExecStream &stream, const TupleData &expectedTuple, uint nRowsExpected)
 Executes the prepared stream graph and verifies that all output tuples matche an expected and given one.
void verifyBufferedOutput (ExecStream &stream, TupleDescriptor outputTupleDesc, uint nRowsExpected, PBuffer expectedBuffer)
 Executes the prepared stream graph and verifies the resultant tuples against a set of tuples supplied in an input buffer.
void resetExecStreamTest ()
 Reset stream graph so multiple iterations of a method can be called within a single testcase.
virtual void tearDownExecStreamTest ()
 ExecStream-specific handler called from testCaseTearDown.
virtual SharedExecStreamGraph newStreamGraph ()
 Creates a stream graph.
virtual SharedExecStreamGraphEmbryo newStreamGraphEmbryo (SharedExecStreamGraph)
 Creates an embryo for a stream graph.
virtual ExecStreamSchedulernewScheduler ()
 Creates a scheduler.
virtual ExecStreamGovernornewResourceGovernor (ExecStreamResourceKnobs const &knobSettings, ExecStreamResourceQuantity const &resourcesAvailable)
 Creates the resource governor.
void snooze (uint nSeconds)
void setForceCacheUnmap (SharedSegment pSegment)
 Forces the underlying snapshot segment to always execute its checkpoints during a cache flush and unmap.
void commitChanges (TxnId commitCsn)
 Commits transactions associated with a specified csn.
uint generateRandomNumber (uint iMax)
void runThreadedTestCase ()
 Executes specified test threads.

Protected Attributes

SharedExecStreamGraph pGraph
SharedExecStreamGraphEmbryo pGraphEmbryo
SharedExecStreamScheduler pScheduler
SharedExecStreamGovernor pResourceGovernor
SharedCacheAccessor pCacheAccessor
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
uint nDiskPagesTotal
PageId firstPageId
DeviceId tempDeviceId
SharedRandomAccessDevice pTempDevice
SharedSegment pTempSegment
TxnId currCsn
std::vector< TxnId > updatedCsns
bool commit
SharedSegment pSnapshotRandomSegment2
std::vector< PageId > freeablePages
 Queue of allocated pages waiting to be freed.
StrictMutex freeablePagesMutex
 Mutex protecting freeablePages.
PageOwnerId objId
 PageOwnerId to use when allocating pages.
uint cbPageUsable
 Portion of each page that should be scribbled on.
uint nRandomOps
 Number of random access operations to run per pass.
uint nSecondsBetweenCheckpoints
 Checkpoint interval during multi-threaded test.
StrictMutex logMutex
 Protects output stream.
SXMutex checkpointMutex
 SXMutex used to synchronize checkpoints with write actions.
bool bTestResize
 Flag indicating that the cache should be dynamically resized during the multi-threaded portion of the test.
uint nSeconds
 Duration of multi-threaded test.
std::vector< int > threadCounts
 Number of threads to run for each type of operation.

Static Protected Attributes

static const uint DefaultCacheReservePercent = 5
static const uint DefaultConcurrentStatements = 4
static bool runAll
 Run all test cases, including the extra tests.
static std::string runSingle
 Run only the test case of this name.

Private Member Functions

void loadCluster (uint nCols, uint nRows, SharedMockProducerExecStreamGenerator pInputGenerator)
 Loads a cluster with the values specified by the mock producer stream generator input parameter, using a LcsClusterAppendExecStream.
void verifyCluster (uint nCols, uint nRows, MockProducerExecStreamGenerator &resultGenerator)
 Verifies that a cluster contains the values specified by the mock producer stream generator passed in.
void replaceCluster (uint nCols, uint nRows, SharedMockProducerExecStreamGenerator pInputGenerator)
 Replaces rows in an existing cluster column based on a mock producer exec stream passed in.
void testClusterReplace (uint nCols, uint totalNumRows, uint numReplRows, SharedMockProducerExecStreamGenerator pOrigClusterInputGenerator, MockProducerExecStreamGenerator &origClusterResultGenerator, SharedMockProducerExecStreamGenerator pReplClusterInputGenerator, MockProducerExecStreamGenerator &replClusterResultGenerator)
 Loads a cluster and then replaces selected rows from the cluster with new input.
void testSingleColRepeatingSequence (uint nRows, uint inputSeqStart, uint replSeqStart, uint expectedSeqStart)
void testMultiColClusterReplace (uint nCols, uint nRows)
void initClusterAppendParams (LcsClusterAppendExecStreamParams &lcsAppendParams, uint nCols, bool replace)

Private Attributes

StandardTypeDescriptorFactory stdTypeFactory
TupleAttributeDescriptor attrDesc_int64
TupleAttributeDescriptor attrDesc_bitmap
PageId savedRootPageId
BTreeDescriptor btreeDescriptor

Detailed Description

Test class for exercising LcsClusterReplaceExecStream.

Note that the class is derived from SnapshotSegmentTestBase, which allows the underlying segment it uses for storage to be versioned.

Definition at line 47 of file LcsClusterReplaceExecStreamTest.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     };

enum PagingTestBase::OpType [inherited]

The various operations that can be run in the multi-threaded test.

Enumerator:
OP_READ_SEQ 
OP_WRITE_SEQ 
OP_READ_RAND 
OP_WRITE_RAND 
OP_READ_NOWAIT 
OP_WRITE_NOWAIT 
OP_WRITE_SKIP 
OP_SCRATCH 
OP_PREFETCH 
OP_PREFETCH_BATCH 
OP_ALLOCATE 
OP_DEALLOCATE 
OP_CHECKPOINT 
OP_RESIZE_CACHE 
OP_MAX 

Definition at line 83 of file PagingTestBase.h.

00083                 {
00084         OP_READ_SEQ,
00085         OP_WRITE_SEQ,
00086         OP_READ_RAND,
00087         OP_WRITE_RAND,
00088         OP_READ_NOWAIT,
00089         OP_WRITE_NOWAIT,
00090         OP_WRITE_SKIP,
00091         OP_SCRATCH,
00092         OP_PREFETCH,
00093         OP_PREFETCH_BATCH,
00094         OP_ALLOCATE,
00095         OP_DEALLOCATE,
00096         OP_CHECKPOINT,
00097         OP_RESIZE_CACHE,
00098         OP_MAX
00099     };


Constructor & Destructor Documentation

LcsClusterReplaceExecStreamTest::LcsClusterReplaceExecStreamTest (  )  [inline, explicit]

Definition at line 139 of file LcsClusterReplaceExecStreamTest.cpp.

References test3ColClusterReplace(), testReplaceAllRows(), testReplaceNoRows(), testSingleColEvenNumRows(), testSingleColOddNumRows(), and testSingleColSeqStartAt1().

00140     {
00141         FENNEL_UNIT_TEST_CASE(
00142             LcsClusterReplaceExecStreamTest, testSingleColOddNumRows);
00143         FENNEL_UNIT_TEST_CASE(
00144             LcsClusterReplaceExecStreamTest, testSingleColEvenNumRows);
00145         FENNEL_UNIT_TEST_CASE(
00146             LcsClusterReplaceExecStreamTest, testSingleColSeqStartAt1);
00147         FENNEL_UNIT_TEST_CASE(
00148             LcsClusterReplaceExecStreamTest, testReplaceAllRows);
00149         FENNEL_UNIT_TEST_CASE(
00150             LcsClusterReplaceExecStreamTest, testReplaceNoRows);
00151         FENNEL_UNIT_TEST_CASE(
00152             LcsClusterReplaceExecStreamTest, test3ColClusterReplace);
00153     }


Member Function Documentation

void LcsClusterReplaceExecStreamTest::loadCluster ( uint  nCols,
uint  nRows,
SharedMockProducerExecStreamGenerator  pInputGenerator 
) [private]

Loads a cluster with the values specified by the mock producer stream generator input parameter, using a LcsClusterAppendExecStream.

Parameters:
nCols number of columns in the cluster
nRows number of rows to load
pInputGenerator the generator that produces the data to be loaded into the cluster

Definition at line 424 of file LcsClusterReplaceExecStreamTest.cpp.

References attrDesc_int64, btreeDescriptor, BTreeBuilder::createEmptyRoot(), BTreeAccessBase::getRootPageId(), ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), initClusterAppendParams(), BTreeParams::keyProj, BTreeDescriptor::keyProjection, MockProducerExecStreamParams::nRows, NULL_PAGE_ID, SingleOutputExecStreamParams::outputTupleDesc, CacheTestBase::pCache, SegmentAccessor::pCacheAccessor, MockProducerExecStreamParams::pGenerator, SegStorageTestBase::pRandomSegment, ExecStreamUnitTestBase::prepareTransformGraph(), BTreeParams::pSegment, SegmentAccessor::pSegment, BTreeParams::rootPageId, BTreeDescriptor::rootPageId, savedRootPageId, BTreeDescriptor::segmentAccessor, BTreeParams::tupleDesc, BTreeDescriptor::tupleDescriptor, and ExecStreamUnitTestBase::verifyOutput().

Referenced by testClusterReplace().

00428 {
00429     MockProducerExecStreamParams mockParams;
00430     for (uint i = 0; i < nCols; i++) {
00431         mockParams.outputTupleDesc.push_back(attrDesc_int64);
00432     }
00433     mockParams.nRows = nRows;
00434     mockParams.pGenerator = pInputGenerator;
00435 
00436     ExecStreamEmbryo mockStreamEmbryo;
00437     mockStreamEmbryo.init(new MockProducerExecStream(), mockParams);
00438     mockStreamEmbryo.getStream()->setName("MockProducerExecStream");
00439 
00440     LcsClusterAppendExecStreamParams lcsAppendParams;
00441     initClusterAppendParams(lcsAppendParams, nCols, false);
00442 
00443     // setup temporary btree descriptor to get an empty page to start the btree
00444     btreeDescriptor.segmentAccessor.pSegment = lcsAppendParams.pSegment;
00445     btreeDescriptor.segmentAccessor.pCacheAccessor = pCache;
00446     btreeDescriptor.tupleDescriptor = lcsAppendParams.tupleDesc;
00447     btreeDescriptor.keyProjection = lcsAppendParams.keyProj;
00448     btreeDescriptor.rootPageId = NULL_PAGE_ID;
00449 
00450     BTreeBuilder builder(btreeDescriptor, pRandomSegment);
00451     builder.createEmptyRoot();
00452     savedRootPageId = builder.getRootPageId();
00453 
00454     lcsAppendParams.rootPageId = btreeDescriptor.rootPageId = savedRootPageId;
00455 
00456     ExecStreamEmbryo lcsAppendStreamEmbryo;
00457     lcsAppendStreamEmbryo.init(
00458         new LcsClusterAppendExecStream(),
00459         lcsAppendParams);
00460     lcsAppendStreamEmbryo.getStream()->setName("LcsClusterAppendExecStream");
00461 
00462     SharedExecStream pOutputStream = prepareTransformGraph(
00463         mockStreamEmbryo, lcsAppendStreamEmbryo);
00464 
00465     // set up a generator which can produce the expected output
00466     vector<boost::shared_ptr<ColumnGenerator<int64_t> > > columnGenerators;
00467     SharedInt64ColumnGenerator colGen =
00468         SharedInt64ColumnGenerator(new SeqColumnGenerator(nRows));
00469     columnGenerators.push_back(colGen);
00470     colGen = SharedInt64ColumnGenerator(new SeqColumnGenerator(0));
00471     columnGenerators.push_back(colGen);
00472 
00473     CompositeExecStreamGenerator expectedResultGenerator(columnGenerators);
00474 
00475     verifyOutput(*pOutputStream, 1, expectedResultGenerator);
00476 }

void LcsClusterReplaceExecStreamTest::verifyCluster ( uint  nCols,
uint  nRows,
MockProducerExecStreamGenerator resultGenerator 
) [private]

Verifies that a cluster contains the values specified by the mock producer stream generator passed in.

Parameters:
nCols number of columns in the cluster
nRows number of rows expected in the cluster
resultGenerator the generator that produces the expected data in the cluster

Definition at line 515 of file LcsClusterReplaceExecStreamTest.cpp.

References attrDesc_bitmap, attrDesc_int64, btreeDescriptor, ValuesExecStreamParams::bufSize, LcsClusterScanDef::clusterTupleDesc, FixedBuffer, ExecStreamEmbryo::getStream(), LcsRowScanExecStreamParams::hasExtraFilter, ExecStreamEmbryo::init(), LcsRowScanExecStreamParams::isFullScan, BTreeParams::keyProj, BTreeDescriptor::keyProjection, LcsRowScanBaseExecStreamParams::lcsClusterScanDefs, LcsRowScanBaseExecStreamParams::outputProj, SingleOutputExecStreamParams::outputTupleDesc, BTreeDescriptor::pageOwnerId, BTreeParams::pageOwnerId, SegmentAccessor::pCacheAccessor, ExecStreamParams::pCacheAccessor, ExecStreamUnitTestBase::prepareTransformGraph(), SegmentAccessor::pSegment, BTreeParams::pSegment, ValuesExecStreamParams::pTupleBuffer, BTreeDescriptor::rootPageId, BTreeParams::rootPageId, SAMPLING_OFF, LcsRowScanExecStreamParams::samplingMode, BTreeDescriptor::segmentAccessor, BTreeDescriptor::segmentId, BTreeParams::segmentId, BTreeParams::tupleDesc, BTreeDescriptor::tupleDescriptor, and ExecStreamUnitTestBase::verifyOutput().

Referenced by testClusterReplace().

00519 {
00520     // setup parameters into scan
00521     //  single cluster with only one column, project that single column
00522 
00523     LcsRowScanExecStreamParams scanParams;
00524     scanParams.hasExtraFilter = false;
00525     scanParams.isFullScan = true;
00526     scanParams.samplingMode = SAMPLING_OFF;
00527 
00528     struct LcsClusterScanDef clusterScanDef;
00529 
00530     for (uint i = 0; i < nCols; i++) {
00531         clusterScanDef.clusterTupleDesc.push_back(attrDesc_int64);
00532     }
00533     clusterScanDef.pSegment = btreeDescriptor.segmentAccessor.pSegment;
00534     clusterScanDef.pCacheAccessor =
00535         btreeDescriptor.segmentAccessor.pCacheAccessor;
00536     clusterScanDef.tupleDesc = btreeDescriptor.tupleDescriptor;
00537     clusterScanDef.keyProj = btreeDescriptor.keyProjection;
00538     clusterScanDef.rootPageId = btreeDescriptor.rootPageId;
00539     clusterScanDef.segmentId = btreeDescriptor.segmentId;
00540     clusterScanDef.pageOwnerId = btreeDescriptor.pageOwnerId;
00541 
00542     scanParams.lcsClusterScanDefs.push_back(clusterScanDef);
00543     for (uint i = 0; i < nCols; i++) {
00544         scanParams.outputTupleDesc.push_back(attrDesc_int64);
00545         scanParams.outputProj.push_back(i);
00546     }
00547 
00548     ValuesExecStreamParams valuesParams;
00549     ExecStreamEmbryo valuesStreamEmbryo;
00550     boost::shared_array<FixedBuffer> pBuffer;
00551 
00552     valuesParams.outputTupleDesc.push_back(attrDesc_int64);
00553     valuesParams.outputTupleDesc.push_back(attrDesc_bitmap);
00554     valuesParams.outputTupleDesc.push_back(attrDesc_bitmap);
00555 
00556     uint bufferSize = 16;
00557     pBuffer.reset(new FixedBuffer[bufferSize]);
00558     valuesParams.pTupleBuffer = pBuffer;
00559     valuesParams.bufSize = 0;
00560     valuesStreamEmbryo.init(new ValuesExecStream(), valuesParams);
00561     valuesStreamEmbryo.getStream()->setName("ValuesExecStream");
00562 
00563     ExecStreamEmbryo scanStreamEmbryo;
00564     scanStreamEmbryo.init(new LcsRowScanExecStream(), scanParams);
00565     scanStreamEmbryo.getStream()->setName("RowScanExecStream");
00566 
00567     SharedExecStream pOutputStream =
00568         prepareTransformGraph(valuesStreamEmbryo, scanStreamEmbryo);
00569 
00570     verifyOutput(*pOutputStream, nRows, resultGenerator);
00571 }

void LcsClusterReplaceExecStreamTest::replaceCluster ( uint  nCols,
uint  nRows,
SharedMockProducerExecStreamGenerator  pInputGenerator 
) [private]

Replaces rows in an existing cluster column based on a mock producer exec stream passed in.

Parameters:
nCols the number of columns in the cluster
nRows the number of rows to be replaced
pInputGenerator the generator that generates the input into the replace stream; each input row contains the rid value of the row to be replaced and the new column values

Definition at line 573 of file LcsClusterReplaceExecStreamTest.cpp.

References attrDesc_int64, btreeDescriptor, ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), initClusterAppendParams(), BTreeDescriptor::keyProjection, MockProducerExecStreamParams::nRows, SingleOutputExecStreamParams::outputTupleDesc, CacheTestBase::pCache, SegmentAccessor::pCacheAccessor, MockProducerExecStreamParams::pGenerator, ExecStreamUnitTestBase::prepareTransformGraph(), SegmentAccessor::pSegment, BTreeDescriptor::rootPageId, savedRootPageId, BTreeDescriptor::segmentAccessor, BTreeDescriptor::tupleDescriptor, and ExecStreamUnitTestBase::verifyOutput().

Referenced by testClusterReplace().

00577 {
00578     MockProducerExecStreamParams mockParams;
00579     // +1 for the rid column
00580     for (uint i = 0; i < nCols + 1; i++) {
00581         mockParams.outputTupleDesc.push_back(attrDesc_int64);
00582     }
00583     mockParams.nRows = nRows;
00584     mockParams.pGenerator = pGenerator;
00585 
00586     ExecStreamEmbryo mockStreamEmbryo;
00587     mockStreamEmbryo.init(new MockProducerExecStream(), mockParams);
00588     mockStreamEmbryo.getStream()->setName("MockProducerExecStream");
00589 
00590     LcsClusterReplaceExecStreamParams lcsReplaceParams;
00591     initClusterAppendParams(lcsReplaceParams, nCols, true);
00592 
00593     btreeDescriptor.segmentAccessor.pSegment = lcsReplaceParams.pSegment;
00594     btreeDescriptor.segmentAccessor.pCacheAccessor = pCache;
00595     btreeDescriptor.tupleDescriptor = lcsReplaceParams.tupleDesc;
00596     btreeDescriptor.keyProjection = lcsReplaceParams.keyProj;
00597 
00598     lcsReplaceParams.rootPageId = btreeDescriptor.rootPageId = savedRootPageId;
00599 
00600     ExecStreamEmbryo lcsReplaceStreamEmbryo;
00601     lcsReplaceStreamEmbryo.init(
00602         new LcsClusterReplaceExecStream(),
00603         lcsReplaceParams);
00604     lcsReplaceStreamEmbryo.getStream()->setName("LcsClusterReplaceExecStream");
00605 
00606     SharedExecStream pOutputStream = prepareTransformGraph(
00607         mockStreamEmbryo, lcsReplaceStreamEmbryo);
00608 
00609     // set up a generator which can produce the expected output
00610     vector<boost::shared_ptr<ColumnGenerator<int64_t> > > columnGenerators;
00611     SharedInt64ColumnGenerator colGenerator =
00612         SharedInt64ColumnGenerator(new SeqColumnGenerator(nRows));
00613     columnGenerators.push_back(colGenerator);
00614     colGenerator = SharedInt64ColumnGenerator(new SeqColumnGenerator(0));
00615     columnGenerators.push_back(colGenerator);
00616 
00617     CompositeExecStreamGenerator expectedResultGenerator(columnGenerators);
00618 
00619     verifyOutput(*pOutputStream, 1, expectedResultGenerator);
00620 }

void LcsClusterReplaceExecStreamTest::testClusterReplace ( uint  nCols,
uint  totalNumRows,
uint  numReplRows,
SharedMockProducerExecStreamGenerator  pOrigClusterInputGenerator,
MockProducerExecStreamGenerator origClusterResultGenerator,
SharedMockProducerExecStreamGenerator  pReplClusterInputGenerator,
MockProducerExecStreamGenerator replClusterResultGenerator 
) [private]

Loads a cluster and then replaces selected rows from the cluster with new input.

Parameters:
nCols number of columns in the cluster
totalNumRows number of rows loaded into the original cluster
numReplRows number of rows to replace in the cluster
pOrigClusterInputGenerator generator that produces input to be loaded into the original cluster
origClusterResultGenerator generator that produces the expected result after loading the original cluster
pReplClusterInputGenerator generator that produces the rows to be replaced in the cluster
replClusterResultGenerator generator that produces the expected rows in the replaced cluster

Definition at line 378 of file LcsClusterReplaceExecStreamTest.cpp.

References Segment::checkpoint(), CHECKPOINT_FLUSH_ALL, SnapshotRandomAllocationSegment::commitChanges(), SnapshotSegmentTestBase::currCsn, loadCluster(), SegStorageTestBase::pRandomSegment, SegStorageTestBase::pSegmentFactory, SegStorageTestBase::pSnapshotRandomSegment, SnapshotSegmentTestBase::pSnapshotRandomSegment2, SegStorageTestBase::pVersionedRandomSegment, replaceCluster(), ExecStreamUnitTestBase::resetExecStreamTest(), SnapshotSegmentTestBase::setForceCacheUnmap(), and verifyCluster().

Referenced by testMultiColClusterReplace(), testReplaceAllRows(), testReplaceNoRows(), and testSingleColRepeatingSequence().

00386 {
00387     // Load the cluster and verify the load by scanning the resulting cluster
00388     loadCluster(nCols, totalNumRows, pOrigClusterInputGenerator);
00389     resetExecStreamTest();
00390     verifyCluster(nCols, totalNumRows, origClusterResultGenerator);
00391     resetExecStreamTest();
00392 
00393     // Commit the changes associated with the current txn and create a new
00394     // snapshot segment for the next txn
00395     SnapshotRandomAllocationSegment *pSnapshotSegment =
00396         SegmentFactory::dynamicCast<SnapshotRandomAllocationSegment *>(
00397             pSnapshotRandomSegment);
00398     pSnapshotSegment->commitChanges(currCsn);
00399     pSnapshotSegment->checkpoint(CHECKPOINT_FLUSH_ALL);
00400     currCsn = TxnId(1);
00401     pSnapshotRandomSegment2 =
00402         pSegmentFactory->newSnapshotRandomAllocationSegment(
00403             pVersionedRandomSegment,
00404             pVersionedRandomSegment,
00405             currCsn);
00406     setForceCacheUnmap(pSnapshotRandomSegment2);
00407     pRandomSegment = pSnapshotRandomSegment2;
00408 
00409     // Replace some sequence of rows from the cluster
00410     replaceCluster(nCols, numReplRows, pReplClusterInputGenerator);
00411 
00412     // Commit the changes and then verify that the resulting cluster contains
00413     // a combination of the original and replaced values.  It should be
00414     // 0, 1, 2, 3, ...
00415     pSnapshotSegment =
00416         SegmentFactory::dynamicCast<SnapshotRandomAllocationSegment *>(
00417             pSnapshotRandomSegment2);
00418     pSnapshotSegment->commitChanges(currCsn);
00419     pSnapshotSegment->checkpoint(CHECKPOINT_FLUSH_ALL);
00420     resetExecStreamTest();
00421     verifyCluster(nCols, totalNumRows, replClusterResultGenerator);
00422 }

void LcsClusterReplaceExecStreamTest::testSingleColRepeatingSequence ( uint  nRows,
uint  inputSeqStart,
uint  replSeqStart,
uint  expectedSeqStart 
) [private]

Definition at line 192 of file LcsClusterReplaceExecStreamTest.cpp.

References testClusterReplace().

Referenced by testSingleColEvenNumRows(), testSingleColOddNumRows(), and testSingleColSeqStartAt1().

00197 {
00198     // Original cluster contains the values inputSeqStart, inputSeqStart+2, ...
00199     // Replace every other rid starting at rid replSeqStart with values
00200     // replaceSeqStart, replaceSeqStart+2, ...,
00201     // The replace cluster should have the sequence expectedSeqStart,
00202     // expectedSeqStart+1, ...
00203 
00204     SharedMockProducerExecStreamGenerator pOrigClusterInputGenerator =
00205         SharedMockProducerExecStreamGenerator(
00206             new StairCaseExecStreamGenerator(2, 2, inputSeqStart));
00207 
00208     StairCaseExecStreamGenerator origClusterResultGenerator =
00209         StairCaseExecStreamGenerator(2, 2, inputSeqStart);
00210 
00211     vector<boost::shared_ptr<ColumnGenerator<int64_t> > > columnGenerators;
00212     SharedInt64ColumnGenerator colGenerator =
00213         SharedInt64ColumnGenerator(new SeqColumnGenerator(replSeqStart, 2));
00214     columnGenerators.push_back(colGenerator);
00215     colGenerator =
00216         SharedInt64ColumnGenerator(new SeqColumnGenerator(replSeqStart, 2));
00217     columnGenerators.push_back(colGenerator);
00218     SharedMockProducerExecStreamGenerator pReplClusterInputGenerator =
00219         SharedMockProducerExecStreamGenerator(
00220             new CompositeExecStreamGenerator(columnGenerators));
00221 
00222     RampExecStreamGenerator replClusterResultGenerator(expectedSeqStart);
00223 
00224     testClusterReplace(
00225         1,
00226         nRows,
00227         nRows / 2,
00228         pOrigClusterInputGenerator,
00229         origClusterResultGenerator,
00230         pReplClusterInputGenerator,
00231         replClusterResultGenerator);
00232 }

void LcsClusterReplaceExecStreamTest::testMultiColClusterReplace ( uint  nCols,
uint  nRows 
) [private]

Definition at line 315 of file LcsClusterReplaceExecStreamTest.cpp.

References testClusterReplace().

Referenced by test3ColClusterReplace().

00318 {
00319     vector<boost::shared_ptr<ColumnGenerator<int64_t> > > columnGenerators;
00320     SharedInt64ColumnGenerator colGenerator;
00321 
00322     // For the original cluster, each column is a repeating sequence of
00323     // values n,n,n+2,n+2,n+4,n+4, ..., where n corresponds to the column
00324     // number, starting at 0
00325     for (uint i = 0; i < nCols; i++) {
00326         colGenerator =
00327             SharedInt64ColumnGenerator(new StairCaseColumnGenerator(2, 2, i));
00328         columnGenerators.push_back(colGenerator);
00329     }
00330     SharedMockProducerExecStreamGenerator pOrigClusterInputGenerator =
00331         SharedMockProducerExecStreamGenerator(
00332             new CompositeExecStreamGenerator(columnGenerators));
00333 
00334     columnGenerators.clear();
00335     for (uint i = 0; i < nCols; i++) {
00336         colGenerator =
00337             SharedInt64ColumnGenerator(new StairCaseColumnGenerator(2, 2, i));
00338         columnGenerators.push_back(colGenerator);
00339     }
00340     CompositeExecStreamGenerator origClusterResultGenerator =
00341         CompositeExecStreamGenerator(columnGenerators);
00342 
00343     // Replace every other row, starting at rid 1, with the values n+1, n+3, ...
00344     // where n is the column number.  The first column generator below is
00345     // for the rid sequence.
00346     columnGenerators.clear();
00347     colGenerator =
00348         SharedInt64ColumnGenerator(new SeqColumnGenerator(1, 2));
00349     columnGenerators.push_back(colGenerator);
00350     for (uint i = 1; i < nCols + 1; i++) {
00351         colGenerator = SharedInt64ColumnGenerator(new SeqColumnGenerator(i, 2));
00352         columnGenerators.push_back(colGenerator);
00353     }
00354     SharedMockProducerExecStreamGenerator pReplClusterInputGenerator =
00355         SharedMockProducerExecStreamGenerator(
00356             new CompositeExecStreamGenerator(columnGenerators));
00357 
00358     // Expected resulting cluster should have values n,n+1, ... where n is
00359     // the column number
00360     columnGenerators.clear();
00361     for (uint i = 0; i < nCols; i++) {
00362         colGenerator = SharedInt64ColumnGenerator(new SeqColumnGenerator(i));
00363         columnGenerators.push_back(colGenerator);
00364     }
00365     CompositeExecStreamGenerator replClusterResultGenerator =
00366         CompositeExecStreamGenerator(columnGenerators);
00367 
00368     testClusterReplace(
00369         nCols,
00370         nRows,
00371         nRows / 2,
00372         pOrigClusterInputGenerator,
00373         origClusterResultGenerator,
00374         pReplClusterInputGenerator,
00375         replClusterResultGenerator);
00376 }

void LcsClusterReplaceExecStreamTest::initClusterAppendParams ( LcsClusterAppendExecStreamParams lcsAppendParams,
uint  nCols,
bool  replace 
) [private]

Definition at line 478 of file LcsClusterReplaceExecStreamTest.cpp.

References attrDesc_int64, btreeDescriptor, LcsClusterAppendExecStreamParams::inputProj, BTreeParams::keyProj, SingleOutputExecStreamParams::outputTupleDesc, BTreeDescriptor::pageOwnerId, BTreeParams::pageOwnerId, CacheTestBase::pCache, ExecStreamParams::pCacheAccessor, SegStorageTestBase::pRandomSegment, BTreeParams::pRootMap, BTreeParams::pSegment, SegStorageTestBase::pSegmentFactory, BTreeParams::rootPageIdParamId, ExecStreamParams::scratchAccessor, BTreeDescriptor::segmentId, BTreeParams::segmentId, and BTreeParams::tupleDesc.

Referenced by loadCluster(), and replaceCluster().

00482 {
00483     lcsAppendParams.scratchAccessor =
00484         pSegmentFactory->newScratchSegment(pCache, 10);
00485     lcsAppendParams.pCacheAccessor = pCache;
00486     lcsAppendParams.pSegment = pRandomSegment;
00487     lcsAppendParams.rootPageIdParamId = DynamicParamId(0);
00488 
00489     for (uint i = 0; i < nCols; i++) {
00490         lcsAppendParams.inputProj.push_back(i);
00491     }
00492     if (replace) {
00493         lcsAppendParams.inputProj.push_back(nCols);
00494     }
00495 
00496     // initialize the btree parameter portion of lcsAppendParams
00497     // BTree tuple desc only has one column
00498     (lcsAppendParams.tupleDesc).push_back(attrDesc_int64);
00499     (lcsAppendParams.tupleDesc).push_back(attrDesc_int64);
00500 
00501     // BTree key only has one column which is the first column.
00502     (lcsAppendParams.keyProj).push_back(0);
00503 
00504     // output only single row with 2 columns (# rows loaded, starting rid value)
00505     lcsAppendParams.outputTupleDesc.push_back(attrDesc_int64);
00506     lcsAppendParams.outputTupleDesc.push_back(attrDesc_int64);
00507 
00508     lcsAppendParams.pRootMap = 0;
00509 
00510     // Set up BTreeExecStreamParams using default values from BTreeDescriptor.
00511     lcsAppendParams.segmentId = btreeDescriptor.segmentId;
00512     lcsAppendParams.pageOwnerId = btreeDescriptor.pageOwnerId;
00513 }

void LcsClusterReplaceExecStreamTest::testSingleColOddNumRows (  ) 

Definition at line 168 of file LcsClusterReplaceExecStreamTest.cpp.

References testSingleColRepeatingSequence().

Referenced by LcsClusterReplaceExecStreamTest().

00169 {
00170     // Original cluster contains 5001 rows with values 0, 0, 2, 2, 4, 4, ...
00171     // Replace every other rid starting at rid 1 with the values 1, 3, 5, ...
00172     // Resulting cluster contains the values 0, 1, 2, 3, ...
00173     testSingleColRepeatingSequence(5001, 0, 1, 0);
00174 }

void LcsClusterReplaceExecStreamTest::testSingleColEvenNumRows (  ) 

Definition at line 176 of file LcsClusterReplaceExecStreamTest.cpp.

References testSingleColRepeatingSequence().

Referenced by LcsClusterReplaceExecStreamTest().

00177 {
00178     // Original cluster contains 4000 rows with values 0, 0, 2, 2, 4, 4, ...
00179     // Replace every other rid starting at rid 1 with the values 1, 3, 5, ...
00180     // Resulting cluster contains the values 0, 1, 2, 3, ...
00181     testSingleColRepeatingSequence(4000, 0, 1, 0);
00182 }

void LcsClusterReplaceExecStreamTest::testSingleColSeqStartAt1 (  ) 

Definition at line 184 of file LcsClusterReplaceExecStreamTest.cpp.

References testSingleColRepeatingSequence().

Referenced by LcsClusterReplaceExecStreamTest().

00185 {
00186     // Original cluster contains 3000 rows with values 1, 1, 3, 3, 5, 5, ...
00187     // Replace every other rid starting at rid 0 with the values 0, 2, 4, ...
00188     // Resulting cluster contains the values 0, 1, 2, 3, ...
00189     testSingleColRepeatingSequence(3000, 1, 0, 0);
00190 }

void LcsClusterReplaceExecStreamTest::testReplaceAllRows (  ) 

Definition at line 234 of file LcsClusterReplaceExecStreamTest.cpp.

References testClusterReplace().

Referenced by LcsClusterReplaceExecStreamTest().

00235 {
00236     // Original cluster 2003 rows, all with the value 99.
00237     // Replace every row with the sequence 0, 1, 2, ...
00238 
00239     uint nRows = 2003;
00240 
00241     SharedMockProducerExecStreamGenerator pOrigClusterInputGenerator =
00242         SharedMockProducerExecStreamGenerator(
00243             new ConstExecStreamGenerator(99));
00244 
00245     ConstExecStreamGenerator origClusterResultGenerator =
00246         ConstExecStreamGenerator(99);
00247 
00248     vector<boost::shared_ptr<ColumnGenerator<int64_t> > > columnGenerators;
00249     SharedInt64ColumnGenerator colGenerator =
00250         SharedInt64ColumnGenerator(new SeqColumnGenerator(0, 1));
00251     columnGenerators.push_back(colGenerator);
00252     colGenerator =
00253         SharedInt64ColumnGenerator(new SeqColumnGenerator(0, 1));
00254     columnGenerators.push_back(colGenerator);
00255     SharedMockProducerExecStreamGenerator pReplClusterInputGenerator =
00256         SharedMockProducerExecStreamGenerator(
00257             new CompositeExecStreamGenerator(columnGenerators));
00258 
00259     RampExecStreamGenerator replClusterResultGenerator;
00260 
00261     testClusterReplace(
00262         1,
00263         nRows,
00264         nRows,
00265         pOrigClusterInputGenerator,
00266         origClusterResultGenerator,
00267         pReplClusterInputGenerator,
00268         replClusterResultGenerator);
00269 }

void LcsClusterReplaceExecStreamTest::testReplaceNoRows (  ) 

Definition at line 271 of file LcsClusterReplaceExecStreamTest.cpp.

References testClusterReplace().

Referenced by LcsClusterReplaceExecStreamTest().

00272 {
00273     // Original cluster contains 1007 rows with the sequence 0, 1, 2, ...
00274     // Replace no rows.
00275 
00276     uint nRows = 1007;
00277 
00278     SharedMockProducerExecStreamGenerator pOrigClusterInputGenerator =
00279         SharedMockProducerExecStreamGenerator(
00280             new RampExecStreamGenerator());
00281 
00282     RampExecStreamGenerator origClusterResultGenerator =
00283         RampExecStreamGenerator();
00284 
00285     // It doesn't matter what we use for these ColumnGenerators, since no
00286     // rows will be generated.
00287     vector<boost::shared_ptr<ColumnGenerator<int64_t> > > columnGenerators;
00288     SharedInt64ColumnGenerator colGenerator =
00289         SharedInt64ColumnGenerator(new SeqColumnGenerator(0, 1));
00290     columnGenerators.push_back(colGenerator);
00291     colGenerator =
00292         SharedInt64ColumnGenerator(new SeqColumnGenerator(0, 1));
00293     columnGenerators.push_back(colGenerator);
00294     SharedMockProducerExecStreamGenerator pReplClusterInputGenerator =
00295         SharedMockProducerExecStreamGenerator(
00296             new CompositeExecStreamGenerator(columnGenerators));
00297 
00298     RampExecStreamGenerator replClusterResultGenerator;
00299 
00300     testClusterReplace(
00301         1,
00302         nRows,
00303         0,
00304         pOrigClusterInputGenerator,
00305         origClusterResultGenerator,
00306         pReplClusterInputGenerator,
00307         replClusterResultGenerator);
00308 }

void LcsClusterReplaceExecStreamTest::test3ColClusterReplace (  ) 

Definition at line 310 of file LcsClusterReplaceExecStreamTest.cpp.

References testMultiColClusterReplace().

Referenced by LcsClusterReplaceExecStreamTest().

00311 {
00312     testMultiColClusterReplace(3, 800);
00313 }

void LcsClusterReplaceExecStreamTest::testCaseSetUp (  )  [virtual]

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

Default is no-op.

Reimplemented from ExecStreamUnitTestBase.

Definition at line 622 of file LcsClusterReplaceExecStreamTest.cpp.

References attrDesc_bitmap, attrDesc_int64, StandardTypeDescriptorFactory::newDataType(), NULL_PAGE_ID, SegStorageTestBase::pRandomSegment, savedRootPageId, STANDARD_TYPE_CHAR, STANDARD_TYPE_INT_64, stdTypeFactory, SnapshotSegmentTestBase::testCaseSetUp(), and ExecStreamUnitTestBase::testCaseSetUp().

void LcsClusterReplaceExecStreamTest::testCaseTearDown (  )  [virtual]

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

Default is no-op.

Reimplemented from ExecStreamTestBase.

Definition at line 642 of file LcsClusterReplaceExecStreamTest.cpp.

References btreeDescriptor, SegmentAccessor::reset(), BTreeDescriptor::segmentAccessor, and ExecStreamTestBase::testCaseTearDown().

void LcsClusterReplaceExecStreamTest::openRandomSegment (  )  [virtual]

Reimplemented from SegStorageTestBase.

Definition at line 636 of file LcsClusterReplaceExecStreamTest.cpp.

00637 {
00638     // nothing to do since SnapshotSegmentTestBase::openSegmentStorage
00639     // has already set pRandomSegment to the snapshot segment.
00640 }

SharedExecStream ExecStreamUnitTestBase::prepareSourceGraph ( ExecStreamEmbryo sourceStreamEmbryo  )  [protected, inherited]

Defines and prepares a graph consisting of one source stream.

Parameters:
sourceStreamEmbryo embryonic source stream which produces tuples
Returns:
output buffer stream

Definition at line 41 of file ExecStreamUnitTestBase.cpp.

References ExecStreamUnitTestBase::prepareTransformGraph().

Referenced by FlatFileExecStreamTest::testStream().

00043 {
00044     std::vector<ExecStreamEmbryo> transforms;
00045     return prepareTransformGraph(sourceStreamEmbryo, transforms);
00046 }

SharedExecStream ExecStreamUnitTestBase::prepareTransformGraph ( ExecStreamEmbryo sourceStreamEmbryo,
ExecStreamEmbryo transformStreamEmbryo 
) [protected, inherited]

Defines and prepares a graph consisting of one source stream and one transform stream.

Parameters:
sourceStreamEmbryo embryonic source stream which produces tuples
transformStreamEmbryo embryonic transform stream which processes tuples produced by sourceStreamEmbryo
Returns:
output buffer stream

Definition at line 48 of file ExecStreamUnitTestBase.cpp.

Referenced by loadCluster(), LcsRowScanExecStreamTest::loadOneCluster(), ExecStreamUnitTestBase::prepareSourceGraph(), replaceCluster(), LcsMultiClusterAppendTest::scanCols(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), CollectExecStreamTestSuite::testCollectCollectUncollectUncollect(), CollectExecStreamTestSuite::testCollectInts(), CollectExecStreamTestSuite::testCollectUncollect(), CalcExecStreamTestSuite::testConstant(), ExecStreamTestSuite::testCopyExecStream(), ExecStreamTestSuite::testCountAggExecStream(), LhxAggExecStreamTest::testCountImpl(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamTestSuite::testGroupAggExecStreamNrows(), LhxAggExecStreamTest::testGroupCountImpl(), ExternalSortExecStreamTest::testImpl(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), LbmNormalizerExecStreamTest::testNormalizer(), ExecStreamTestSuite::testReshapeExecStream(), LcsRowScanExecStreamTest::testSampleScanCols(), LcsRowScanExecStreamTest::testScanCols(), LbmSearchTest::testScanIdx(), LcsClusterAppendExecStreamTest::testScanMultiCol(), LcsClusterAppendExecStreamTest::testScanSingleCol(), ExecStreamTestSuite::testScratchBufferExecStream(), ExecStreamTestSuite::testSegBufferExecStream(), ExecStreamTestSuite::testSingleValueAggExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), LbmSortedAggExecStreamTest::testSortedAgg(), ExecStreamTestSuite::testSumAggExecStream(), LhxAggExecStreamTest::testSumImpl(), LbmUnionExecStreamTest::testUnion(), and verifyCluster().

00051 {
00052     std::vector<ExecStreamEmbryo> transforms;
00053     transforms.push_back(transformStreamEmbryo);
00054     return prepareTransformGraph(sourceStreamEmbryo, transforms);
00055 }

SharedExecStream ExecStreamUnitTestBase::prepareTransformGraph ( ExecStreamEmbryo sourceStreamEmbryo,
std::vector< ExecStreamEmbryo > &  transforms 
) [protected, inherited]

Defines and prepares a graph consisting of one source stream and one or multiple transform streams.

Parameters:
sourceStreamEmbryo embryonic source stream which produces tuples
transforms embryonic transform streams which process tuples produced by sourceStreamEmbryo or a child stream
Returns:
output buffer stream

Definition at line 57 of file ExecStreamUnitTestBase.cpp.

References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.

00060 {
00061     pGraphEmbryo->saveStreamEmbryo(sourceStreamEmbryo);
00062     std::vector<ExecStreamEmbryo>::iterator it;
00063 
00064     // save all transforms
00065     for (it = transforms.begin(); it != transforms.end(); ++it) {
00066         pGraphEmbryo->saveStreamEmbryo(*it);
00067     }
00068 
00069     // connect streams in a cascade
00070     ExecStreamEmbryo& previousStream = sourceStreamEmbryo;
00071     for (it = transforms.begin(); it != transforms.end(); ++it) {
00072         pGraphEmbryo->addDataflow(
00073             previousStream.getStream()->getName(),
00074             (*it).getStream()->getName());
00075         previousStream = *it;
00076     }
00077 
00078     SharedExecStream pAdaptedStream =
00079         pGraphEmbryo->addAdapterFor(
00080             previousStream.getStream()->getName(),
00081             0,
00082             BUFPROV_PRODUCER);
00083     pGraph->addOutputDataflow(pAdaptedStream->getStreamId());
00084 
00085     pGraphEmbryo->prepareGraph(shared_from_this(), "");
00086     return pAdaptedStream;
00087 }

SharedExecStream ExecStreamUnitTestBase::prepareConfluenceGraph ( ExecStreamEmbryo sourceStreamEmbryo1,
ExecStreamEmbryo sourceStreamEmbryo2,
ExecStreamEmbryo confluenceStreamEmbryo 
) [protected, inherited]

Defines and prepares a graph consisting of two source streams and one confluence stream.

Parameters:
sourceStreamEmbryo1 embryonic source stream which produces tuples
sourceStreamEmbryo2 embryonic source stream which produces tuples
confluenceStreamEmbryo embryonic confluence stream which processes tuples produced by the sourceStreamEmbryos
Returns:
output buffer stream

Definition at line 89 of file ExecStreamUnitTestBase.cpp.

Referenced by ExecStreamUnitTestBase::prepareConfluenceGraph(), ExecStreamTestSuite::testCartesianJoinExecStream(), CorrelationJoinExecStreamTestSuite::testCorrelationJoin(), LcsRowScanExecStreamTest::testFilterCols(), ExecStreamGovernorTest::testGovernor(), LhxJoinExecStreamTest::testImpl(), LbmIntersectExecStreamTest::testIntersect(), ExecStreamTestSuite::testMergeExecStream(), LbmMinusExecStreamTest::testMinus(), and ExecStreamTestSuite::testNestedLoopJoinExecStream().

00093 {
00094     std::vector<ExecStreamEmbryo> sourceStreamEmbryos;
00095     sourceStreamEmbryos.push_back(sourceStreamEmbryo1);
00096     sourceStreamEmbryos.push_back(sourceStreamEmbryo2);
00097     return prepareConfluenceGraph(sourceStreamEmbryos, confluenceStreamEmbryo);
00098 }

SharedExecStream ExecStreamUnitTestBase::prepareConfluenceGraph ( std::vector< ExecStreamEmbryo > &  sourceStreamEmbryos,
ExecStreamEmbryo confluenceStreamEmbryo 
) [protected, inherited]

Defines and prepares a graph consisting of a list of source streams and one confluence stream.

Parameters:
sourceStreamEmbryos list of embryonic source streams that produce tuples
confluenceStreamEmbryo embryonic confluence stream which processes tuples produced by the sourceStreamEmbryos
Returns:
output buffer stream

Definition at line 155 of file ExecStreamUnitTestBase.cpp.

References ExecStreamUnitTestBase::prepareConfluenceGraph().

00158 {
00159     std::vector<std::vector<ExecStreamEmbryo> > sourceStreamEmbryosList;
00160     std::vector<ExecStreamEmbryo>::iterator it;
00161     std::vector<ExecStreamEmbryo> sourceStreamList;
00162     for (it = sourceStreamEmbryos.begin(); it != sourceStreamEmbryos.end();
00163         it++)
00164     {
00165         sourceStreamList.clear();
00166         sourceStreamList.push_back(*it);
00167         sourceStreamEmbryosList.push_back(sourceStreamList);
00168     }
00169 
00170     return
00171         prepareConfluenceGraph(sourceStreamEmbryosList, confluenceStreamEmbryo);
00172 }

SharedExecStream ExecStreamUnitTestBase::prepareConfluenceGraph ( std::vector< std::vector< ExecStreamEmbryo > > &  sourceStreamEmbryosList,
ExecStreamEmbryo confluenceStreamEmbryo 
) [protected, inherited]

Defines and prepares a graph consisting of one or more source streams and one confluence stream.

Each source stream can be a list of streams.

Parameters:
sourceStreamEmbryosList list of embryonic source streams which produce tuples
confluenceStreamEmbryo embryonic confluence stream which processes tuples produced by the source streams
Returns:
output buffer stream

Definition at line 174 of file ExecStreamUnitTestBase.cpp.

References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.

00177 {
00178     pGraphEmbryo->saveStreamEmbryo(confluenceStreamEmbryo);
00179 
00180     for (int i = 0; i < sourceStreamEmbryosList.size(); i++) {
00181         for (int j = 0; j < sourceStreamEmbryosList[i].size(); j++) {
00182             pGraphEmbryo->saveStreamEmbryo(sourceStreamEmbryosList[i][j]);
00183         }
00184 
00185         // connect streams in each sourceStreamEmbryos list in a cascade
00186         for (int j = 1; j < sourceStreamEmbryosList[i].size(); j++) {
00187             pGraphEmbryo->addDataflow(
00188                 sourceStreamEmbryosList[i][j - 1].getStream()->getName(),
00189                 sourceStreamEmbryosList[i][j].getStream()->getName());
00190         }
00191         pGraphEmbryo->addDataflow(
00192             sourceStreamEmbryosList[i].back().getStream()->getName(),
00193             confluenceStreamEmbryo.getStream()->getName());
00194     }
00195 
00196     SharedExecStream pAdaptedStream =
00197         pGraphEmbryo->addAdapterFor(
00198             confluenceStreamEmbryo.getStream()->getName(), 0,
00199             BUFPROV_PRODUCER);
00200     pGraph->addOutputDataflow(
00201         pAdaptedStream->getStreamId());
00202 
00203     pGraphEmbryo->prepareGraph(shared_from_this(), "");
00204 
00205     return pAdaptedStream;
00206 }

SharedExecStream ExecStreamUnitTestBase::prepareConfluenceTransformGraph ( ExecStreamEmbryo sourceStreamEmbryo1,
ExecStreamEmbryo sourceStreamEmbryo2,
ExecStreamEmbryo confluenceStreamEmbryo,
ExecStreamEmbryo transformStreamEmbryo 
) [protected, inherited]

Defines and prepares a graph consisting of two source streams, one confluence stream, and one transform stream.

Parameters:
sourceStreamEmbryo1 embryonic source stream which produces tuples
sourceStreamEmbryo2 embryonic source stream which produces tuples
confluenceStreamEmbryo embryonic confluence stream which processes tuples produced by the sourceStreamEmbryos
transformStreamEmbryo embryonic transform streams which process tuples produced by a child stream
Returns:
output buffer stream

Definition at line 100 of file ExecStreamUnitTestBase.cpp.

References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.

Referenced by LhxJoinExecStreamTest::testImpl(), and LbmMinusExecStreamTest::testRestartingMinus().

00105 {
00106     std::vector<ExecStreamEmbryo> sourceStreamEmbryos;
00107     sourceStreamEmbryos.push_back(sourceStreamEmbryo1);
00108     sourceStreamEmbryos.push_back(sourceStreamEmbryo2);
00109 
00110     std::vector<ExecStreamEmbryo>::iterator it;
00111 
00112     for (it = sourceStreamEmbryos.begin(); it != sourceStreamEmbryos.end();
00113         ++it)
00114     {
00115         pGraphEmbryo->saveStreamEmbryo(*it);
00116     }
00117     pGraphEmbryo->saveStreamEmbryo(confluenceStreamEmbryo);
00118 
00119     for (it = sourceStreamEmbryos.begin(); it != sourceStreamEmbryos.end();
00120         ++it)
00121     {
00122         pGraphEmbryo->addDataflow(
00123             (*it).getStream()->getName(),
00124             confluenceStreamEmbryo.getStream()->getName());
00125     }
00126 
00127     std::vector<ExecStreamEmbryo> transforms;
00128     transforms.push_back(transformStreamEmbryo);
00129     ExecStreamEmbryo& previousStream = confluenceStreamEmbryo;
00130 
00131     // save all transforms
00132     for (it = transforms.begin(); it != transforms.end(); ++it) {
00133         pGraphEmbryo->saveStreamEmbryo(*it);
00134     }
00135 
00136     for (it = transforms.begin(); it != transforms.end(); ++it) {
00137         pGraphEmbryo->addDataflow(
00138             previousStream.getStream()->getName(),
00139             (*it).getStream()->getName());
00140         previousStream = *it;
00141     }
00142 
00143 
00144     SharedExecStream pAdaptedStream =
00145         pGraphEmbryo->addAdapterFor(
00146             previousStream.getStream()->getName(),
00147             0,
00148             BUFPROV_PRODUCER);
00149     pGraph->addOutputDataflow(pAdaptedStream->getStreamId());
00150 
00151     pGraphEmbryo->prepareGraph(shared_from_this(), "");
00152     return pAdaptedStream;
00153 }

SharedExecStream ExecStreamUnitTestBase::prepareDAG ( ExecStreamEmbryo srcStreamEmbryo,
ExecStreamEmbryo splitterStreamEmbryo,
std::vector< ExecStreamEmbryo > &  interStreamEmbryos,
ExecStreamEmbryo destStreamEmbryo,
bool  createSink = true,
bool  saveSrc = true 
) [protected, inherited]

Defines and prepares a graph consisting of a source, a splitter, and one or more parallel transform streams which flow together into a confluence stream.

Parameters:
srcStreamEmbryo embryonic source stream which produces tuples
splitterStreamEmbryo embryonic SplitterExecStream which produces tuples for multiple consumers
interStreamEmbryos embryonic intermediate streams which transform tuples; each stream consists of a single embryo
destStreamEmbryo embryonic confluence stream which processes tuples produced by the interStreamEmbryos
createSink if true (the default), creates a final output sink in the stream graph
saveSrc if true (the default), save the source in the stream graph; if false, the save has already been done
Returns:
output buffer stream or null stream if createSink is false

Definition at line 208 of file ExecStreamUnitTestBase.cpp.

Referenced by LcsMultiClusterAppendTest::loadClusters(), LbmSearchTest::loadTableAndIndex(), LbmLoadBitmapTest::testLoad(), ExecStreamTestSuite::testMergeImplicitPullInputs(), ExecStreamTestSuite::testSegBufferReaderWriterExecStream(), and ExecStreamTestSuite::testSplitterPlusBarrier().

00215 {
00216     std::vector<std::vector<ExecStreamEmbryo> > listOfList;
00217 
00218     // Convert interStreamEmbryos to a vector of vectors.  E.g., if
00219     // interStreamEmbryos contains (1, 2, 3), it will get converted to:
00220     // ((1)) ((2)) ((3))
00221     for (uint i = 0; i < interStreamEmbryos.size(); i++) {
00222         std::vector<ExecStreamEmbryo> interStreamEmbryoList;
00223 
00224         interStreamEmbryoList.push_back(interStreamEmbryos[i]);
00225         listOfList.push_back(interStreamEmbryoList);
00226     }
00227     return prepareDAG(
00228         srcStreamEmbryo, splitterStreamEmbryo, listOfList, destStreamEmbryo,
00229         createSink, saveSrc);
00230 }

SharedExecStream ExecStreamUnitTestBase::prepareDAG ( ExecStreamEmbryo srcStreamEmbryo,
ExecStreamEmbryo splitterStreamEmbryo,
std::vector< std::vector< ExecStreamEmbryo > > &  interStreamEmbryosList,
ExecStreamEmbryo destStreamEmbryo,
bool  createSink = true,
bool  saveSrc = true 
) [protected, inherited]

Defines and prepares a graph consisting of a source, a splitter, and one or more parallel transform streams which flow together into a confluence stream.

Parameters:
srcStreamEmbryo embryonic source stream which produces tuples
splitterStreamEmbryo embryonic SplitterExecStream which produces tuples for multiple consumers
interStreamEmbryosList one or more embryonic intermediate streams which transform tuples; each stream can have one more embryos
destStreamEmbryo embryonic confluence stream which processes tuples produced by the interStreamEmbryos
createSink if true (the default), creates a final output sink in the stream graph
saveSrc if true (the default), save the source in the stream graph; if false, the save has already been done
Returns:
output buffer stream or null stream if createSink is false

Definition at line 232 of file ExecStreamUnitTestBase.cpp.

References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.

00239 {
00240     if (saveSrc) {
00241         pGraphEmbryo->saveStreamEmbryo(srcStreamEmbryo);
00242     }
00243     pGraphEmbryo->saveStreamEmbryo(splitterStreamEmbryo);
00244 
00245     // save all intermediate stream embryos
00246     for (int i = 0; i < interStreamEmbryos.size(); i++) {
00247         for (int j = 0; j < interStreamEmbryos[i].size(); j++) {
00248             pGraphEmbryo->saveStreamEmbryo(interStreamEmbryos[i][j]);
00249         }
00250 
00251         // connect streams in each interStreamEmbryos list in a cascade
00252         for (int j = 1; j < interStreamEmbryos[i].size(); j++) {
00253             pGraphEmbryo->addDataflow(
00254                 interStreamEmbryos[i][j - 1].getStream()->getName(),
00255                 interStreamEmbryos[i][j].getStream()->getName());
00256         }
00257     }
00258 
00259     pGraphEmbryo->saveStreamEmbryo(destStreamEmbryo);
00260 
00261     pGraphEmbryo->addDataflow(
00262         srcStreamEmbryo.getStream()->getName(),
00263         splitterStreamEmbryo.getStream()->getName());
00264 
00265     // connect all inter streams to src and dest
00266     for (int i = 0; i < interStreamEmbryos.size(); i++) {
00267         pGraphEmbryo->addDataflow(
00268             splitterStreamEmbryo.getStream()->getName(),
00269             interStreamEmbryos[i][0].getStream()->getName());
00270         pGraphEmbryo->addDataflow(
00271             interStreamEmbryos[i].back().getStream()->getName(),
00272             destStreamEmbryo.getStream()->getName());
00273     }
00274 
00275     SharedExecStream pAdaptedStream;
00276 
00277     if (createSink) {
00278         pAdaptedStream = pGraphEmbryo->addAdapterFor(
00279             destStreamEmbryo.getStream()->getName(), 0,
00280             BUFPROV_PRODUCER);
00281         pGraph->addOutputDataflow(pAdaptedStream->getStreamId());
00282 
00283         pGraphEmbryo->prepareGraph(shared_from_this(), "");
00284     }
00285 
00286     return pAdaptedStream;
00287 }

void ExecStreamUnitTestBase::verifyOutput ( ExecStream stream,
uint  nRowsExpected,
MockProducerExecStreamGenerator verifier,
bool  stopEarly = false 
) [protected, inherited]

Executes the prepared stream graph and verifies that its output matches that produced by a value generator.

Parameters:
stream output stream from which to read
nRowsExpected number of rows expected
verifier generator for expected values
stopEarly if true, stop once nRowsExpected have been fetched, even if more rows are available; this can be used for simulating the cleanup effect of an error in the middle of execution

Definition at line 325 of file ExecStreamUnitTestBase.cpp.

References TupleData::compute(), EXECBUF_EOS, MockProducerExecStreamGenerator::generateValue(), ExecStreamUnitTestBase::pGraph, ExecStreamTestBase::pResourceGovernor, and ExecStreamTestBase::pScheduler.

Referenced by loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), replaceCluster(), LcsMultiClusterAppendTest::scanCols(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), CollectExecStreamTestSuite::testCollectCollectUncollectUncollect(), CollectExecStreamTestSuite::testCollectUncollect(), CorrelationJoinExecStreamTestSuite::testCorrelationJoin(), ExecStreamTestSuite::testCountAggExecStream(), LhxAggExecStreamTest::testCountImpl(), ExecStreamTestSuite::testDoubleBufferExecStream(), LcsRowScanExecStreamTest::testFilterCols(), ExecStreamTestSuite::testGroupAggExecStreamNrows(), LhxAggExecStreamTest::testGroupCountImpl(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), ExecStreamTestSuite::testMergeImplicitPullInputs(), ExecStreamTestSuite::testNestedLoopJoinExecStream(), LbmNormalizerExecStreamTest::testNormalizer(), ExecStreamTestSuite::testReshapeExecStream(), LbmMinusExecStreamTest::testRestartingMinus(), LcsRowScanExecStreamTest::testSampleScanCols(), LcsRowScanExecStreamTest::testScanCols(), LcsClusterAppendExecStreamTest::testScanMultiCol(), LcsClusterAppendExecStreamTest::testScanSingleCol(), ExecStreamTestSuite::testScratchBufferExecStream(), ExecStreamTestSuite::testSingleValueAggExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), LbmSortedAggExecStreamTest::testSortedAgg(), ExecStreamTestSuite::testSplitterPlusBarrier(), ExecStreamTestSuite::testSumAggExecStream(), LhxAggExecStreamTest::testSumImpl(), and verifyCluster().

00330 {
00331     // TODO:  assertions about output tuple
00332 
00333     pResourceGovernor->requestResources(*pGraph);
00334     pGraph->open();
00335     pScheduler->start();
00336     uint nRows = 0;
00337     for (;;) {
00338         ExecStreamBufAccessor &bufAccessor =
00339             pScheduler->readStream(stream);
00340         if (bufAccessor.getState() == EXECBUF_EOS) {
00341             break;
00342         }
00343         BOOST_REQUIRE(bufAccessor.isConsumptionPossible());
00344         const uint nCol =
00345             bufAccessor.getConsumptionTupleAccessor().size();
00346         BOOST_REQUIRE(nCol == bufAccessor.getTupleDesc().size());
00347         BOOST_REQUIRE(nCol >= 1);
00348         TupleData inputTuple;
00349         inputTuple.compute(bufAccessor.getTupleDesc());
00350         for (;;) {
00351             if (!bufAccessor.demandData()) {
00352                 break;
00353             }
00354             BOOST_REQUIRE(nRows < nRowsExpected);
00355             bufAccessor.unmarshalTuple(inputTuple);
00356             for (int col = 0; col < nCol; ++col) {
00357                 int64_t actualValue =
00358                     *reinterpret_cast<int64_t const *>(inputTuple[col].pData);
00359                 int64_t expectedValue = generator.generateValue(nRows, col);
00360                 if (actualValue != expectedValue) {
00361                     std::cout << "(Row, Col) = (" << nRows << ", " << col <<")"
00362                               << std::endl;
00363                     BOOST_CHECK_EQUAL(expectedValue,actualValue);
00364                     return;
00365                 }
00366             }
00367             bufAccessor.consumeTuple();
00368             ++nRows;
00369             if (stopEarly && nRows == nRowsExpected) {
00370                 return;
00371             }
00372         }
00373     }
00374     BOOST_CHECK_EQUAL(nRowsExpected,nRows);
00375 }

void ExecStreamUnitTestBase::verifyConstantOutput ( ExecStream stream,
const TupleData expectedTuple,
uint  nRowsExpected 
) [protected, inherited]

Executes the prepared stream graph and verifies that all output tuples matche an expected and given one.

Parameters:
stream output stream from which to read
expectedTuple 
nRowsExpected 

Definition at line 377 of file ExecStreamUnitTestBase.cpp.

References TupleData::compute(), EXECBUF_EOS, ExecStreamUnitTestBase::pGraph, ExecStreamTestBase::pResourceGovernor, TuplePrinter::print(), and ExecStreamTestBase::pScheduler.

Referenced by ExecStreamTestSuite::testCartesianJoinExecStream(), CollectExecStreamTestSuite::testCollectInts(), CalcExecStreamTestSuite::testConstant(), ExecStreamTestSuite::testCopyExecStream(), ExecStreamGovernorTest::testGovernor(), ExecStreamTestSuite::testMergeExecStream(), ExecStreamTestSuite::testSegBufferExecStream(), and ExecStreamTestSuite::testSegBufferReaderWriterExecStream().

00381 {
00382     // TODO:  assertions about output tuple
00383 
00384     pResourceGovernor->requestResources(*pGraph);
00385     pGraph->open();
00386     pScheduler->start();
00387     uint nRows = 0;
00388     for (;;) {
00389         ExecStreamBufAccessor &bufAccessor =
00390             pScheduler->readStream(stream);
00391         if (bufAccessor.getState() == EXECBUF_EOS) {
00392             break;
00393         }
00394         BOOST_REQUIRE(bufAccessor.isConsumptionPossible());
00395 
00396         if (!bufAccessor.demandData()) {
00397             break;
00398         }
00399         BOOST_REQUIRE(nRows < nRowsExpected);
00400 
00401         TupleData actualTuple;
00402         actualTuple.compute(bufAccessor.getTupleDesc());
00403         bufAccessor.unmarshalTuple(actualTuple);
00404 
00405         int c = bufAccessor.getTupleDesc().compareTuples(
00406                                expectedTuple, actualTuple);
00407         bufAccessor.consumeTuple();
00408         ++nRows;
00409         if (c) {
00410 #if 1
00411             TupleDescriptor statusDesc = bufAccessor.getTupleDesc();
00412             TuplePrinter tuplePrinter;
00413             tuplePrinter.print(std::cout, statusDesc, actualTuple);
00414             tuplePrinter.print(std::cout, statusDesc, expectedTuple);
00415             std::cout << std::endl;
00416 #endif
00417             BOOST_CHECK_EQUAL(0,c);
00418             break;
00419         }
00420     }
00421     BOOST_CHECK_EQUAL(nRowsExpected, nRows);
00422 }

void ExecStreamUnitTestBase::verifyBufferedOutput ( ExecStream stream,
TupleDescriptor  outputTupleDesc,
uint  nRowsExpected,
PBuffer  expectedBuffer 
) [protected, inherited]

Executes the prepared stream graph and verifies the resultant tuples against a set of tuples supplied in an input buffer.

Parameters:
stream output stream from which to read
outputTupleDesc descriptor of expected output tuple
nRowsExpected number of rows expected
expectedBuffer buffer containing expected tuples

Definition at line 424 of file ExecStreamUnitTestBase.cpp.

References TupleDescriptor::compareTuples(), TupleData::compute(), TupleAccessor::compute(), EXECBUF_EOS, TupleAccessor::getCurrentByteCount(), ExecStreamUnitTestBase::pGraph, ExecStreamTestBase::pResourceGovernor, ExecStreamTestBase::pScheduler, TupleAccessor::setCurrentTupleBuf(), and TupleAccessor::unmarshal().

Referenced by LbmIntersectExecStreamTest::testIntersect(), LbmMinusExecStreamTest::testMinus(), LbmSearchTest::testScanIdx(), and LbmUnionExecStreamTest::testUnion().

00429 {
00430     // TODO:  assertions about output tuple
00431 
00432     TupleAccessor expectedOutputAccessor;
00433     expectedOutputAccessor.compute(outputTupleDesc);
00434     TupleData expectedTuple(outputTupleDesc);
00435     uint bufOffset = 0;
00436     pResourceGovernor->requestResources(*pGraph);
00437     pGraph->open();
00438     pScheduler->start();
00439     uint nRows = 0;
00440     for (;;) {
00441         ExecStreamBufAccessor &bufAccessor =
00442             pScheduler->readStream(stream);
00443         if (bufAccessor.getState() == EXECBUF_EOS) {
00444             break;
00445         }
00446         BOOST_REQUIRE(bufAccessor.getTupleDesc() == outputTupleDesc);
00447         BOOST_REQUIRE(bufAccessor.isConsumptionPossible());
00448         const uint nCol =
00449             bufAccessor.getConsumptionTupleAccessor().size();
00450         BOOST_REQUIRE(nCol == bufAccessor.getTupleDesc().size());
00451         BOOST_REQUIRE(nCol >= 1);
00452         TupleData inputTuple;
00453         inputTuple.compute(bufAccessor.getTupleDesc());
00454         for (;;) {
00455             if (!bufAccessor.demandData()) {
00456                 break;
00457             }
00458             BOOST_REQUIRE(nRows < nRowsExpected);
00459             bufAccessor.unmarshalTuple(inputTuple);
00460             expectedOutputAccessor.setCurrentTupleBuf(
00461                 expectedBuffer + bufOffset);
00462             expectedOutputAccessor.unmarshal(expectedTuple);
00463             int c = outputTupleDesc.compareTuples(inputTuple, expectedTuple);
00464             if (c) {
00465                 std::cout << "(Row) = (" << nRows << ")"
00466                     << " -- Tuples don't match"<< std::endl;
00467                 BOOST_CHECK_EQUAL(0,c);
00468                 return;
00469             }
00470             bufAccessor.consumeTuple();
00471             bufOffset += expectedOutputAccessor.getCurrentByteCount();
00472             ++nRows;
00473         }
00474     }
00475     BOOST_CHECK_EQUAL(nRowsExpected,nRows);
00476 }

void ExecStreamUnitTestBase::resetExecStreamTest (  )  [protected, inherited]

Reset stream graph so multiple iterations of a method can be called within a single testcase.

Definition at line 305 of file ExecStreamUnitTestBase.cpp.

References ExecStreamTestBase::newScheduler(), ExecStreamTestBase::newStreamGraph(), ExecStreamTestBase::newStreamGraphEmbryo(), ExecStreamUnitTestBase::pGraph, ExecStreamUnitTestBase::pGraphEmbryo, ExecStreamTestBase::pResourceGovernor, ExecStreamTestBase::pScheduler, and ExecStreamUnitTestBase::tearDownExecStreamTest().

Referenced by LcsRowScanExecStreamTest::loadClusters(), LbmLoadBitmapTest::testAppend(), LcsRowScanExecStreamTest::testBernoulliSampling(), testClusterReplace(), LcsRowScanExecStreamTest::testCompressedFiltering(), LbmSplicerExecStreamTest::testLER5968(), LbmSplicerExecStreamTest::testLER6473(), LcsMultiClusterAppendTest::testLoad(), LcsClusterAppendExecStreamTest::testMultiColConstNewRoot(), LcsClusterAppendExecStreamTest::testMultiColConstOldRoot(), LcsClusterAppendExecStreamTest::testMultiColNoDupNewRoot(), LcsClusterAppendExecStreamTest::testMultiColNoDupOldRoot(), LcsClusterAppendExecStreamTest::testMultiColStairNewRoot(), LcsClusterAppendExecStreamTest::testMultiColStairOldRoot(), LbmSearchTest::testMultipleRanges(), ExecStreamGovernorTest::testReturnResources(), LbmSearchTest::testScanIdx(), LcsRowScanExecStreamTest::testScanPastEndOfCluster(), LcsRowScanExecStreamTest::testScans(), LcsClusterAppendExecStreamTest::testSingleColConstNewRoot(), LcsClusterAppendExecStreamTest::testSingleColConstOldRoot(), LcsClusterAppendExecStreamTest::testSingleColNoDupNewRoot(), LcsClusterAppendExecStreamTest::testSingleColNoDupOldRoot(), LcsClusterAppendExecStreamTest::testSingleColStairNewRoot(), LcsClusterAppendExecStreamTest::testSingleColStairOldRoot(), LbmSplicerExecStreamTest::testSpliceRids(), LbmSplicerExecStreamTest::testSpliceWithKeys(), and LcsRowScanExecStreamTest::testSystemSampling().

00306 {
00307     if (pScheduler) {
00308         pScheduler->stop();
00309     }
00310     tearDownExecStreamTest();
00311 
00312     pScheduler.reset(newScheduler());
00313     pGraph = newStreamGraph();
00314     pGraphEmbryo = newStreamGraphEmbryo(pGraph);
00315     pGraph->setResourceGovernor(pResourceGovernor);
00316 }

void ExecStreamUnitTestBase::tearDownExecStreamTest (  )  [protected, virtual, inherited]

ExecStream-specific handler called from testCaseTearDown.

Reimplemented from ExecStreamTestBase.

Definition at line 319 of file ExecStreamUnitTestBase.cpp.

References ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.

Referenced by ExecStreamUnitTestBase::resetExecStreamTest().

00320 {
00321     pGraph.reset();
00322     pGraphEmbryo.reset();
00323 }

SharedExecStreamGraph ExecStreamTestBase::newStreamGraph (  )  [protected, virtual, inherited]

Creates a stream graph.

Definition at line 37 of file ExecStreamTestBase.cpp.

References ExecStreamGraph::newExecStreamGraph().

Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), and ExecStreamUnitTestBase::testCaseSetUp().

00038 {
00039     SharedExecStreamGraph pGraph = ExecStreamGraph::newExecStreamGraph();
00040     pGraph->enableDummyTxnId(true);
00041     return pGraph;
00042 }

SharedExecStreamGraphEmbryo ExecStreamTestBase::newStreamGraphEmbryo ( SharedExecStreamGraph   )  [protected, virtual, inherited]

Creates an embryo for a stream graph.

Definition at line 45 of file ExecStreamTestBase.cpp.

References CacheTestBase::pCache, ExecStreamTestBase::pScheduler, and SegStorageTestBase::pSegmentFactory.

Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), and ExecStreamUnitTestBase::testCaseSetUp().

00046 {
00047     return SharedExecStreamGraphEmbryo(
00048         new ExecStreamGraphEmbryo(
00049             g, pScheduler, pCache, pSegmentFactory));
00050 }

ExecStreamScheduler * ExecStreamTestBase::newScheduler (  )  [protected, virtual, inherited]

Creates a scheduler.

Reimplemented in ParallelExecStreamSchedulerTest.

Definition at line 52 of file ExecStreamTestBase.cpp.

Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), and ExecStreamTestBase::testCaseSetUp().

00053 {
00054     return new DfsTreeExecStreamScheduler(
00055         shared_from_this(),
00056         "DfsTreeExecStreamScheduler");
00057 }

ExecStreamGovernor * ExecStreamTestBase::newResourceGovernor ( ExecStreamResourceKnobs const &  knobSettings,
ExecStreamResourceQuantity const &  resourcesAvailable 
) [protected, virtual, inherited]

Creates the resource governor.

Definition at line 59 of file ExecStreamTestBase.cpp.

Referenced by ExecStreamTestBase::testCaseSetUp().

00062 {
00063     return new SimpleExecStreamGovernor(
00064         knobSettings, resourcesAvailable, shared_from_this(),
00065         "SimpleExecStreamGovernor");
00066 }

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(), 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 }

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 }

void SnapshotSegmentTestBase::setForceCacheUnmap ( SharedSegment  pSegment  )  [protected, inherited]

Forces the underlying snapshot segment to always execute its checkpoints during a cache flush and unmap.

Definition at line 87 of file SnapshotSegmentTestBase.cpp.

References SnapshotRandomAllocationSegment::setForceCacheUnmap().

Referenced by SnapshotSegmentTestBase::openSegmentStorage(), testClusterReplace(), and SnapshotSegmentTest::testUncommittedReads().

00088 {
00089     // Force the snapshot segment to always execute its checkpoints during
00090     // a cache flush and unmap, in order to unmap these page from the cache
00091     if (pSegment) {
00092         SnapshotRandomAllocationSegment *pSnapshotSegment =
00093             SegmentFactory::dynamicCast<SnapshotRandomAllocationSegment *>(
00094                 pSegment);
00095         pSnapshotSegment->setForceCacheUnmap();
00096     }
00097 }

void SnapshotSegmentTestBase::commitChanges ( TxnId  commitCsn  )  [protected, inherited]

Commits transactions associated with a specified csn.

Parameters:
commitCsn the specified csn

Definition at line 161 of file SnapshotSegmentTestBase.cpp.

References SnapshotSegmentTestBase::commit, SnapshotRandomAllocationSegment::commitChanges(), SegStorageTestBase::pSnapshotRandomSegment, and SnapshotRandomAllocationSegment::rollbackChanges().

Referenced by SnapshotSegmentTestBase::closeStorage().

00162 {
00163     if (pSnapshotRandomSegment) {
00164         SnapshotRandomAllocationSegment *pSnapshotSegment =
00165             SegmentFactory::dynamicCast<SnapshotRandomAllocationSegment *>(
00166                 pSnapshotRandomSegment);
00167         if (commit) {
00168             pSnapshotSegment->commitChanges(commitCsn);
00169         } else {
00170             pSnapshotSegment->rollbackChanges();
00171         }
00172     }
00173 }

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

Reimplemented from SegStorageTestBase.

Definition at line 47 of file SnapshotSegmentTestBase.cpp.

References DeviceMode::create, SegStorageTestBase::createLinearDeviceSegment(), SnapshotSegmentTestBase::currCsn, CacheTestBase::dataDeviceId, SnapshotSegmentTestBase::firstPageId, CacheTestBase::nDiskPages, SnapshotSegmentTestBase::nDiskPagesTotal, NULL_PAGE_ID, CacheTestBase::openDevice(), SegStorageTestBase::pLinearSegment, SegStorageTestBase::pRandomSegment, SegStorageTestBase::pSegmentFactory, SegStorageTestBase::pSnapshotRandomSegment, SnapshotSegmentTestBase::pTempDevice, SnapshotSegmentTestBase::pTempSegment, SegStorageTestBase::pVersionedRandomSegment, SnapshotSegmentTestBase::setForceCacheUnmap(), and SnapshotSegmentTestBase::tempDeviceId.

00048 {
00049     nDiskPages = nDiskPagesTotal;
00050     if (openMode.create) {
00051         firstPageId = NULL_PAGE_ID;
00052     }
00053 
00054     pTempDevice =
00055         openDevice("temp.dat", openMode, nDiskPages / 50, tempDeviceId);
00056     SharedSegment pTempDeviceSegment =
00057         createLinearDeviceSegment(tempDeviceId, nDiskPages / 50);
00058     pTempSegment =
00059         pSegmentFactory->newRandomAllocationSegment(
00060             pTempDeviceSegment,
00061             openMode.create);
00062 
00063     SharedSegment pDeviceSegment =
00064         createLinearDeviceSegment(dataDeviceId, nDiskPages);
00065     pVersionedRandomSegment =
00066         pSegmentFactory->newVersionedRandomAllocationSegment(
00067             pDeviceSegment,
00068             pTempSegment,
00069             openMode.create);
00070     pSnapshotRandomSegment =
00071         pSegmentFactory->newSnapshotRandomAllocationSegment(
00072             pVersionedRandomSegment,
00073             pVersionedRandomSegment,
00074             currCsn);
00075     setForceCacheUnmap(pSnapshotRandomSegment);
00076 
00077     pRandomSegment = pSnapshotRandomSegment;
00078 
00079     nDiskPages /= 2;
00080     SharedSegment pLinearViewSegment =
00081         pSegmentFactory->newLinearViewSegment(
00082             pSnapshotRandomSegment,
00083             firstPageId);
00084     pLinearSegment = pLinearViewSegment;
00085 }

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

Reimplemented from SegStorageTestBase.

Definition at line 99 of file SnapshotSegmentTestBase.cpp.

References CacheTestBase::closeDevice(), SegStorageTestBase::closeLinearSegment(), SegStorageTestBase::closeSnapshotRandomSegment(), SegStorageTestBase::closeStorage(), SegStorageTestBase::closeVersionedRandomSegment(), SnapshotSegmentTestBase::commitChanges(), SnapshotSegmentTestBase::currCsn, VersionedRandomAllocationSegment::freeTempPages(), SegStorageTestBase::pRandomSegment, SnapshotSegmentTestBase::pSnapshotRandomSegment2, SnapshotSegmentTestBase::pTempDevice, SnapshotSegmentTestBase::pTempSegment, SegStorageTestBase::pVersionedRandomSegment, and SnapshotSegmentTestBase::tempDeviceId.

Referenced by BackupRestoreTest::backup(), SnapshotSegmentTest::deallocateOldPages(), BackupRestoreTest::restore(), BackupRestoreTest::testBackupRestore(), SnapshotSegmentTest::testDeallocateOld(), SnapshotSegmentTest::testRollback(), SnapshotSegmentTest::testSnapshotReads(), SnapshotSegmentTest::testUncommittedReads(), and BackupRestoreTest::verifyData().

00100 {
00101     commitChanges(currCsn);
00102     closeLinearSegment();
00103     pRandomSegment.reset();
00104     closeSnapshotRandomSegment();
00105     if (pSnapshotRandomSegment2) {
00106         assert(pSnapshotRandomSegment2.unique());
00107         pSnapshotRandomSegment2.reset();
00108     }
00109     // Free leftover temp pages used during page versioning
00110     if (pVersionedRandomSegment) {
00111         VersionedRandomAllocationSegment *pVRSegment =
00112             SegmentFactory::dynamicCast<VersionedRandomAllocationSegment *>(
00113                 pVersionedRandomSegment);
00114         pVRSegment->freeTempPages();
00115     }
00116     closeVersionedRandomSegment();
00117     if (pTempSegment) {
00118         // Confirm that all temp pages have been freed.
00119         BOOST_REQUIRE(pTempSegment->getAllocatedSizeInPages() == 0);
00120         assert(pTempSegment.unique());
00121         pTempSegment.reset();
00122     }
00123     if (pTempDevice) {
00124         closeDevice(tempDeviceId, pTempDevice);
00125     }
00126     SegmentTestBase::closeStorage();
00127 }

void SnapshotSegmentTestBase::testAllocateAll (  )  [virtual, inherited]

Initializes all disk pages, filling them with information based on their block numbers.

Reimplemented from PagingTestBase.

Definition at line 129 of file SnapshotSegmentTestBase.cpp.

References SnapshotSegmentTestBase::firstPageId, LinearViewSegment::getFirstPageId(), NULL_PAGE_ID, SegStorageTestBase::pLinearSegment, and PagingTestBase::testAllocateAll().

Referenced by BackupRestoreTest::testBackupRestore(), SnapshotSegmentTest::testDeallocateOld(), SnapshotSegmentTest::testRollback(), SnapshotSegmentTest::testSnapshotReads(), and SnapshotSegmentTest::testUncommittedReads().

00130 {
00131     SegmentTestBase::testAllocateAll();
00132     assert(firstPageId == NULL_PAGE_ID);
00133     LinearViewSegment *pLinearViewSegment =
00134         SegmentFactory::dynamicCast<LinearViewSegment *>(pLinearSegment);
00135     assert(pLinearViewSegment);
00136     firstPageId = pLinearViewSegment->getFirstPageId();
00137 }

void SnapshotSegmentTestBase::verifyPage ( CachePage page,
uint  x 
) [virtual, inherited]

Verifies that the page contents are correct (based on the parameter x).

Reimplemented from PagingTestBase.

Definition at line 139 of file SnapshotSegmentTestBase.cpp.

References SnapshotSegmentTestBase::currCsn, opaqueToInt(), SnapshotSegmentTestBase::updatedCsns, and PagingTestBase::verifyPage().

00140 {
00141     // If the pageId is a multiple of one of the csn's smaller than the
00142     // current csn, then the page should reflect the update made by
00143     // that smaller csn
00144     uint update = 0;
00145     for (int i = updatedCsns.size() - 1; i >= 0; i--) {
00146         if (updatedCsns[i] <= currCsn &&
00147             x % opaqueToInt(updatedCsns[i]) == 0)
00148         {
00149             update = opaqueToInt(updatedCsns[i]);
00150             break;
00151         }
00152     }
00153     SegmentTestBase::verifyPage(page, x + update);
00154 }

void SnapshotSegmentTestBase::fillPage ( CachePage page,
uint  x 
) [virtual, inherited]

Scribbles on the contents of a page.

The data written is derived from the parameter x.

Reimplemented from PagingTestBase.

Definition at line 156 of file SnapshotSegmentTestBase.cpp.

References SnapshotSegmentTestBase::currCsn, PagingTestBase::fillPage(), and opaqueToInt().

00157 {
00158     SegmentTestBase::fillPage(page, x + opaqueToInt(currCsn));
00159 }

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

Reimplemented from SegStorageTestBase.

Definition at line 37 of file SegmentTestBase.cpp.

References PagingTestBase::cbPageUsable, PagingTestBase::OP_ALLOCATE, PagingTestBase::OP_DEALLOCATE, SegStorageTestBase::openStorage(), SegStorageTestBase::pLinearSegment, SegStorageTestBase::pRandomSegment, and ThreadedTestBase::threadCounts.

Referenced by BackupRestoreTest::backup(), SnapshotSegmentTest::deallocateOldPages(), BackupRestoreTest::restore(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), BackupRestoreTest::testBackupRestore(), SnapshotSegmentTest::testDeallocateOld(), VersionedSegmentTest::testRecovery(), SnapshotSegmentTest::testRollback(), SegmentTestBase::testSingleThread(), SnapshotSegmentTest::testSnapshotReads(), SnapshotSegmentTest::testUncommittedReads(), and BackupRestoreTest::verifyData().

00038 {
00039     SegStorageTestBase::openStorage(openMode);
00040     cbPageUsable = pLinearSegment->getUsablePageSize();
00041     if (!pRandomSegment) {
00042         threadCounts[OP_ALLOCATE] = 0;
00043         threadCounts[OP_DEALLOCATE] = 0;
00044     }
00045 }

CachePage * SegmentTestBase::lockPage ( OpType  opType,
uint  iPage 
) [virtual, inherited]

Implements PagingTestBase.

Definition at line 47 of file SegmentTestBase.cpp.

References SegPageLock::allocatePage(), SegPageLock::dontUnlock(), PagingTestBase::fillPage(), Segment::getLinearBlockNum(), Segment::getLinearPageId(), PagingTestBase::getLockMode(), SegPageLock::getPage(), SegPageLock::isLocked(), SegPageLock::lockPage(), SegmentTestBase::objId, PagingTestBase::OP_ALLOCATE, PagingTestBase::OP_WRITE_RAND, PagingTestBase::OP_WRITE_SEQ, PagingTestBase::OP_WRITE_SKIP, CacheTestBase::pCache, and SegStorageTestBase::pLinearSegment.

00048 {
00049     SegmentAccessor segmentAccessor(pLinearSegment,pCache);
00050     SegPageLock pageLock(segmentAccessor);
00051     if (opType == OP_ALLOCATE) {
00052         PageId pageId = pageLock.allocatePage(objId);
00053         assert(Segment::getLinearBlockNum(pageId) == iPage);
00054         CachePage &page = pageLock.getPage();
00055         fillPage(page,iPage);
00056         pageLock.dontUnlock();
00057         return &page;
00058     } else {
00059         PageId pageId = Segment::getLinearPageId(iPage);
00060         // Prepare the page for update before locking it
00061         if (opType == OP_WRITE_SEQ || opType == OP_WRITE_RAND ||
00062             opType == OP_WRITE_SKIP)
00063         {
00064             pLinearSegment->updatePage(pageId, true);
00065         }
00066         pageLock.lockPage(pageId,getLockMode(opType));
00067         CachePage *pPage = pageLock.isLocked() ? &(pageLock.getPage()) : NULL;
00068         pageLock.dontUnlock();
00069         return pPage;
00070     }
00071 }

void SegmentTestBase::unlockPage ( CachePage page,
LockMode  lockMode 
) [virtual, inherited]

Implements PagingTestBase.

Definition at line 73 of file SegmentTestBase.cpp.

References CacheTestBase::getCache(), and CacheAccessor::unlockPage().

00074 {
00075     getCache().unlockPage(page,lockMode);
00076 }

void SegmentTestBase::prefetchPage ( uint  iPage  )  [virtual, inherited]

Implements PagingTestBase.

Definition at line 78 of file SegmentTestBase.cpp.

References CacheTestBase::getCache(), Segment::getLinearPageId(), SegStorageTestBase::pLinearSegment, and CacheAccessor::prefetchPage().

00079 {
00080     PageId pageId = Segment::getLinearPageId(iPage);
00081     BlockId blockId = pLinearSegment->translatePageId(pageId);
00082     getCache().prefetchPage(blockId,pLinearSegment.get());
00083 }

void SegmentTestBase::prefetchBatch ( uint  ,
uint   
) [virtual, inherited]

Implements PagingTestBase.

Definition at line 85 of file SegmentTestBase.cpp.

00086 {
00087     permAssert(false);
00088 }

void SegmentTestBase::testAllocate (  )  [virtual, inherited]

Reimplemented from PagingTestBase.

Definition at line 90 of file SegmentTestBase.cpp.

References SegmentTestBase::freeablePages, SegmentTestBase::freeablePagesMutex, PagingTestBase::logMutex, PagingTestBase::nRandomOps, NULL_PAGE_ID, SegmentTestBase::objId, CacheTestBase::pCache, SegStorageTestBase::pRandomSegment, SegPageLock::tryAllocatePage(), and SegPageLock::unlock().

00091 {
00092     assert(pRandomSegment);
00093 
00094     uint i;
00095     SegmentAccessor segmentAccessor(pRandomSegment,pCache);
00096     for (i = 0; i < nRandomOps; ++i) {
00097 #ifdef HAVE_SCHED_H
00098         sched_yield();
00099 #else
00100         // TODO:  call Mingw equivalent
00101 #endif
00102         SegPageLock pageLock(segmentAccessor);
00103         PageId pageId = pageLock.tryAllocatePage(objId);
00104         if (pageId == NULL_PAGE_ID) {
00105             break;
00106         }
00107         pageLock.unlock();
00108         StrictMutexGuard freeablePagesGuard(freeablePagesMutex);
00109         freeablePages.push_back(pageId);
00110     }
00111     if (i) {
00112         StrictMutexGuard logGuard(logMutex);
00113         BOOST_MESSAGE("completed " << i << " allocate ops");
00114     }
00115 }

void SegmentTestBase::testDeallocate (  )  [virtual, inherited]

Reimplemented from PagingTestBase.

Definition at line 117 of file SegmentTestBase.cpp.

References SegPageLock::deallocateLockedPage(), SegmentTestBase::freeablePages, SegmentTestBase::freeablePagesMutex, PagingTestBase::generateRandomNumber(), SegPageLock::lockShared(), PagingTestBase::logMutex, PagingTestBase::nRandomOps, CacheTestBase::pCache, and SegStorageTestBase::pRandomSegment.

00118 {
00119     assert(pRandomSegment);
00120 
00121     uint i;
00122     SegmentAccessor segmentAccessor(pRandomSegment,pCache);
00123     for (i = 0; i < nRandomOps; ++i) {
00124 #ifdef HAVE_SCHED_H
00125         sched_yield();
00126 #else
00127         // TODO:  call Mingw equivalent
00128 #endif
00129         StrictMutexGuard freeablePagesGuard(freeablePagesMutex);
00130         if (freeablePages.empty()) {
00131             break;
00132         }
00133         uint i = generateRandomNumber(freeablePages.size());
00134         PageId pageId = freeablePages[i];
00135         freeablePages.erase(freeablePages.begin() + i);
00136         freeablePagesGuard.unlock();
00137         SegPageLock pageLock(segmentAccessor);
00138         pageLock.lockShared(pageId);
00139         pageLock.deallocateLockedPage();
00140     }
00141     if (i) {
00142         StrictMutexGuard logGuard(logMutex);
00143         BOOST_MESSAGE("completed " << i << " deallocate ops");
00144     }
00145 }

void SegmentTestBase::testCheckpoint (  )  [virtual, inherited]

Performs a periodic checkpoint.

Reimplemented from PagingTestBase.

Reimplemented in VersionedSegmentTest.

Definition at line 147 of file SegmentTestBase.cpp.

References CHECKPOINT_FLUSH_ALL, and SegStorageTestBase::pLinearSegment.

00148 {
00149     pLinearSegment->checkpoint(CHECKPOINT_FLUSH_ALL);
00150 }

void SegmentTestBase::testSingleThread (  )  [inherited]

Definition at line 161 of file SegmentTestBase.cpp.

References SegStorageTestBase::closeStorage(), DeviceMode::createNew, SegmentTestBase::freeablePages, DeviceMode::load, SegmentTestBase::openStorage(), PagingTestBase::testAllocateAll(), PagingTestBase::testRandomRead(), PagingTestBase::testRandomWrite(), PagingTestBase::testSequentialRead(), and PagingTestBase::testSequentialWrite().

Referenced by LinearDeviceSegmentTest::LinearDeviceSegmentTest(), LinearViewSegmentTest::LinearViewSegmentTest(), SnapshotSegmentTest::SnapshotSegmentTest(), and VersionedSegmentTest::VersionedSegmentTest().

00162 {
00163     openStorage(DeviceMode::createNew);
00164     testAllocateAll();
00165     testSequentialRead();
00166     testSequentialWrite();
00167     testRandomRead();
00168     closeStorage();
00169     openStorage(DeviceMode::load);
00170     testRandomRead();
00171     testRandomWrite();
00172     testSequentialRead();
00173     closeStorage();
00174     freeablePages.clear();
00175 }

uint PagingTestBase::generateRandomNumber ( uint  iMax  )  [protected, inherited]

Definition at line 53 of file PagingTestBase.cpp.

References g_pRNG.

Referenced by PagingTestBase::fillPage(), SegmentTestBase::testDeallocate(), PagingTestBase::testPrefetch(), PagingTestBase::testPrefetchBatch(), PagingTestBase::testRandomOp(), and PagingTestBase::testScratch().

00054 {
00055     return (*g_pRNG)(iMax);
00056 }

bool PagingTestBase::testOp ( OpType  opType,
uint  iPage,
bool  bNice 
) [inherited]

Carries out one operation on a page.

This involves locking the page, calling verifyPage or fillPage, and then unlocking the page.

Parameters:
opType operation which will be attempted
iPage block number of page
bNice true if page should be marked as nice as part of access
Returns:
true if the operation was successfully carried out; false if NoWait locking was requested and the page lock could not be acquired

Definition at line 85 of file PagingTestBase.cpp.

References PagingTestBase::fillPage(), CacheTestBase::getCache(), PagingTestBase::getLockMode(), LOCKMODE_S, LOCKMODE_S_NOWAIT, LOCKMODE_X, LOCKMODE_X_NOWAIT, PagingTestBase::lockPage(), CacheAccessor::nicePage(), PagingTestBase::unlockPage(), and PagingTestBase::verifyPage().

Referenced by PagingTestBase::testRandomOp(), PagingTestBase::testSequentialOp(), and PagingTestBase::testSkipOp().

00086 {
00087     CachePage *pPage = lockPage(opType,iPage);
00088     LockMode lockMode = getLockMode(opType);
00089     if (!pPage) {
00090         // must be NoWait locking failed
00091         assert(lockMode >= LOCKMODE_S_NOWAIT);
00092         return false;
00093     }
00094     CachePage &page = *pPage;
00095     if (lockMode == LOCKMODE_S
00096         || lockMode == LOCKMODE_S_NOWAIT)
00097     {
00098         verifyPage(page,iPage);
00099     } else {
00100         fillPage(page,iPage);
00101     }
00102     switch (lockMode) {
00103     case LOCKMODE_X_NOWAIT:
00104         lockMode = LOCKMODE_X;
00105         break;
00106     case LOCKMODE_S_NOWAIT:
00107         lockMode = LOCKMODE_S;
00108         break;
00109     default:
00110         break;
00111     }
00112     if (bNice) {
00113         getCache().nicePage(page);
00114     }
00115     unlockPage(page,lockMode);
00116     return true;
00117 }

char const * PagingTestBase::getOpName ( OpType  opType  )  [inherited]

Makes up an operation name based on an OpType.

Definition at line 119 of file PagingTestBase.cpp.

References PagingTestBase::OP_ALLOCATE, PagingTestBase::OP_READ_NOWAIT, PagingTestBase::OP_READ_RAND, PagingTestBase::OP_READ_SEQ, PagingTestBase::OP_WRITE_NOWAIT, PagingTestBase::OP_WRITE_RAND, PagingTestBase::OP_WRITE_SEQ, and PagingTestBase::OP_WRITE_SKIP.

Referenced by PagingTestBase::testRandomOp(), PagingTestBase::testSequentialOp(), and PagingTestBase::testSkipOp().

00120 {
00121     switch (opType) {
00122     case OP_ALLOCATE:
00123         return "allocate";
00124     case OP_READ_SEQ:
00125         return "sequential read";
00126     case OP_WRITE_SEQ:
00127         return "sequential write";
00128     case OP_READ_RAND:
00129         return "random read";
00130     case OP_WRITE_RAND:
00131         return "random write";
00132     case OP_READ_NOWAIT:
00133         return "read no-wait";
00134     case OP_WRITE_NOWAIT:
00135         return "write no-wait";
00136     case OP_WRITE_SKIP:
00137         return "write every n pages";
00138     default:
00139         permAssert(false);
00140     }
00141 }

LockMode PagingTestBase::getLockMode ( OpType  opType  )  [inherited]

Gets the LockMode corresponding to an OpType.

Definition at line 143 of file PagingTestBase.cpp.

References LOCKMODE_S, LOCKMODE_S_NOWAIT, LOCKMODE_X, LOCKMODE_X_NOWAIT, PagingTestBase::OP_ALLOCATE, PagingTestBase::OP_READ_NOWAIT, PagingTestBase::OP_READ_RAND, PagingTestBase::OP_READ_SEQ, PagingTestBase::OP_WRITE_NOWAIT, PagingTestBase::OP_WRITE_RAND, PagingTestBase::OP_WRITE_SEQ, and PagingTestBase::OP_WRITE_SKIP.

Referenced by SegmentTestBase::lockPage(), CacheTest::lockPage(), and PagingTestBase::testOp().

00144 {
00145     switch (opType) {
00146     case OP_ALLOCATE:
00147         return LOCKMODE_X;
00148     case OP_READ_SEQ:
00149         return LOCKMODE_S;
00150     case OP_WRITE_SEQ:
00151         return LOCKMODE_X;
00152     case OP_READ_RAND:
00153         return LOCKMODE_S;
00154     case OP_WRITE_RAND:
00155         return LOCKMODE_X;
00156     case OP_READ_NOWAIT:
00157         return LOCKMODE_S_NOWAIT;
00158     case OP_WRITE_NOWAIT:
00159         return LOCKMODE_X_NOWAIT;
00160     case OP_WRITE_SKIP:
00161         return LOCKMODE_X;
00162     default:
00163         permAssert(false);
00164     }
00165 }

void PagingTestBase::testSequentialOp ( OpType  opType  )  [inherited]

Carries out an operation on each disk page in order from 0 to nDiskPages-1.

Parameters:
opType see testOp

Definition at line 167 of file PagingTestBase.cpp.

References PagingTestBase::getOpName(), PagingTestBase::logMutex, CacheTestBase::nDiskPages, and PagingTestBase::testOp().

Referenced by PagingTestBase::testAllocateAll(), PagingTestBase::testSequentialRead(), PagingTestBase::testSequentialWrite(), and PagingTestBase::testThreadedOp().

00168 {
00169     uint n = 0;
00170     for (uint i = 0; i < nDiskPages; i++) {
00171         if (testOp(opType,i,true)) {
00172             n++;
00173         }
00174     }
00175     StrictMutexGuard mutexGuard(logMutex);
00176     BOOST_MESSAGE(
00177         "completed " << n << " " << getOpName(opType) << " ops");
00178 }

void PagingTestBase::testRandomOp ( OpType  opType  )  [inherited]

Carries out an operation on nRandomOps pages selected at random.

Parameters:
opType see testOp

Definition at line 180 of file PagingTestBase.cpp.

References PagingTestBase::generateRandomNumber(), PagingTestBase::getOpName(), PagingTestBase::logMutex, CacheTestBase::nDiskPages, PagingTestBase::nRandomOps, and PagingTestBase::testOp().

Referenced by PagingTestBase::testRandomRead(), PagingTestBase::testRandomWrite(), and PagingTestBase::testThreadedOp().

00181 {
00182     uint n = 0;
00183     for (uint i = 0; i < nRandomOps; i++) {
00184         uint iPage = generateRandomNumber(nDiskPages);
00185         bool bNice = (generateRandomNumber(nRandomOps) == 0);
00186         if (testOp(opType,iPage,bNice)) {
00187             n++;
00188         }
00189     }
00190     StrictMutexGuard mutexGuard(logMutex);
00191     BOOST_MESSAGE(
00192         "completed " << n << " " << getOpName(opType) << " ops");
00193 
00194 }

void PagingTestBase::testSkipOp ( OpType  opType,
uint  n 
) [inherited]

Carries out an operation on every "n" pages, starting at page 0.

Parameters:
opType see testOp
n the offset between each page

Definition at line 196 of file PagingTestBase.cpp.

References PagingTestBase::getOpName(), PagingTestBase::logMutex, CacheTestBase::nDiskPages, and PagingTestBase::testOp().

Referenced by PagingTestBase::testSkipWrite(), and PagingTestBase::testThreadedOp().

00197 {
00198     uint numOps = 0;
00199     for (uint i = 0; i < nDiskPages; i += n) {
00200         if (testOp(opType,i,true)) {
00201             numOps++;
00202         }
00203     }
00204     StrictMutexGuard mutexGuard(logMutex);
00205     BOOST_MESSAGE(
00206         "completed " << numOps << " " << getOpName(opType) << " ops");
00207 }

void PagingTestBase::testScratch (  )  [inherited]

Performs nRandomOps scratch operations.

A scratch operation consists of locking a scratch page, filling it with random data, and then unlocking it.

Definition at line 209 of file PagingTestBase.cpp.

References PagingTestBase::fillPage(), PagingTestBase::generateRandomNumber(), CacheTestBase::getCache(), LOCKMODE_X, PagingTestBase::logMutex, PagingTestBase::nRandomOps, and CacheAccessor::unlockPage().

Referenced by CacheTest::testSingleThread(), and PagingTestBase::testThreadedOp().

00210 {
00211     for (uint i = 0; i < nRandomOps; i++) {
00212         CachePage &page = getCache().lockScratchPage();
00213         fillPage(page,generateRandomNumber(10000));
00214         getCache().unlockPage(page,LOCKMODE_X);
00215     }
00216     StrictMutexGuard mutexGuard(logMutex);
00217     BOOST_MESSAGE("completed " << nRandomOps << " random scratch ops");
00218 }

void PagingTestBase::testPrefetch (  )  [inherited]

Performs a limited number of prefetch operations.

Prefetches are not verified.

Definition at line 220 of file PagingTestBase.cpp.

References PagingTestBase::generateRandomNumber(), PagingTestBase::logMutex, CacheTestBase::nDiskPages, PagingTestBase::prefetchPage(), and TestBase::snooze().

Referenced by PagingTestBase::testThreadedOp().

00221 {
00222     // TODO: parameterize this
00223     uint n = 3;
00224     for (uint i = 0; i < n; i++) {
00225         uint iPage = generateRandomNumber(nDiskPages);
00226         prefetchPage(iPage);
00227     }
00228     // give the prefetches a chance to complete
00229     snooze(1);
00230     StrictMutexGuard mutexGuard(logMutex);
00231     BOOST_MESSAGE("completed " << n << " random prefetch ops");
00232 }

void PagingTestBase::testPrefetchBatch (  )  [inherited]

Performs a limited number of batch prefetch operations.

Prefetches are not verified.

Definition at line 234 of file PagingTestBase.cpp.

References PagingTestBase::generateRandomNumber(), PagingTestBase::logMutex, CacheTestBase::nDiskPages, PagingTestBase::prefetchBatch(), and TestBase::snooze().

Referenced by PagingTestBase::testThreadedOp().

00235 {
00236     // TODO: parameterize this
00237     uint n = 2;
00238     uint nPagesPerBatch = 4;
00239     for (uint i = 0; i < n; i++) {
00240         uint iPage = generateRandomNumber(nDiskPages - nPagesPerBatch);
00241         prefetchBatch(iPage,nPagesPerBatch);
00242     }
00243     // give the prefetches a chance to complete
00244     snooze(1);
00245     StrictMutexGuard mutexGuard(logMutex);
00246     BOOST_MESSAGE("completed " << n << " random prefetch batch ops");
00247 }

void PagingTestBase::testSequentialRead (  )  [inherited]

Carries out one sequential read pass over the entire device.

Definition at line 254 of file PagingTestBase.cpp.

References PagingTestBase::OP_READ_SEQ, and PagingTestBase::testSequentialOp().

Referenced by SnapshotSegmentTest::deallocateOldPages(), SnapshotSegmentTest::testDeallocateOld(), VersionedSegmentTest::testRecovery(), SnapshotSegmentTest::testRollback(), SegmentTestBase::testSingleThread(), CacheTest::testSingleThread(), SnapshotSegmentTest::testSnapshotReads(), SnapshotSegmentTest::testUncommittedReads(), and BackupRestoreTest::verifyData().

00255 {
00256     testSequentialOp(OP_READ_SEQ);
00257 }

void PagingTestBase::testSequentialWrite (  )  [inherited]

Carries out one sequential write pass over the entire device.

Definition at line 259 of file PagingTestBase.cpp.

References PagingTestBase::OP_WRITE_SEQ, and PagingTestBase::testSequentialOp().

Referenced by SegmentTestBase::testSingleThread(), and CacheTest::testSingleThread().

00260 {
00261     testSequentialOp(OP_WRITE_SEQ);
00262 }

void PagingTestBase::testRandomRead (  )  [inherited]

Carries out nRandomOps read operations on pages selected at random.

Definition at line 264 of file PagingTestBase.cpp.

References PagingTestBase::OP_READ_RAND, and PagingTestBase::testRandomOp().

Referenced by SegmentTestBase::testSingleThread(), and CacheTest::testSingleThread().

00265 {
00266     testRandomOp(OP_READ_RAND);
00267 }

void PagingTestBase::testRandomWrite (  )  [inherited]

Carries out nRandomOps write operations on pages selected at random.

Definition at line 269 of file PagingTestBase.cpp.

References PagingTestBase::OP_WRITE_RAND, and PagingTestBase::testRandomOp().

Referenced by SegmentTestBase::testSingleThread(), and CacheTest::testSingleThread().

00270 {
00271     testRandomOp(OP_WRITE_RAND);
00272 }

void PagingTestBase::testSkipWrite ( uint  n  )  [inherited]

Carries out write operations every n pages.

Parameters:
n offset between pages

Definition at line 274 of file PagingTestBase.cpp.

References PagingTestBase::OP_WRITE_SKIP, and PagingTestBase::testSkipOp().

Referenced by BackupRestoreTest::testBackupRestore(), SnapshotSegmentTest::testDeallocateOld(), SnapshotSegmentTest::testRollback(), SnapshotSegmentTest::testSnapshotReads(), and SnapshotSegmentTest::testUncommittedReads().

00275 {
00276     testSkipOp(OP_WRITE_SKIP, n);
00277 }

void PagingTestBase::testCheckpointGuarded (  )  [inherited]

Definition at line 295 of file PagingTestBase.cpp.

References PagingTestBase::checkpointMutex, PagingTestBase::logMutex, PagingTestBase::nSecondsBetweenCheckpoints, TestBase::snooze(), PagingTestBase::testCheckpoint(), and SXMutexGuard< lockMode >::unlock().

Referenced by PagingTestBase::testThreadedOp().

00296 {
00297     snooze(nSecondsBetweenCheckpoints);
00298     StrictMutexGuard logGuard(logMutex);
00299     BOOST_MESSAGE("checkpoint started");
00300     logGuard.unlock();
00301     SXMutexExclusiveGuard checkpointExclusiveGuard(checkpointMutex);
00302     testCheckpoint();
00303     checkpointExclusiveGuard.unlock();
00304     logGuard.lock();
00305     BOOST_MESSAGE("checkpoint completed");
00306 }

void PagingTestBase::testCacheResize (  )  [inherited]

Definition at line 308 of file PagingTestBase.cpp.

References CacheTestBase::getCache(), PagingTestBase::logMutex, CacheTestBase::nMemPages, ThreadedTestBase::nSeconds, Cache::setAllocatedPageCount(), and TestBase::snooze().

Referenced by PagingTestBase::testThreadedOp().

00309 {
00310     snooze(nSeconds / 3);
00311     getCache().setAllocatedPageCount(nMemPages / 2);
00312     StrictMutexGuard mutexGuard(logMutex);
00313     BOOST_MESSAGE("shrank cache");
00314     mutexGuard.unlock();
00315     snooze(nSeconds / 3);
00316     getCache().setAllocatedPageCount(nMemPages - 1);
00317     mutexGuard.lock();
00318     BOOST_MESSAGE("expanded cache");
00319     mutexGuard.unlock();
00320 }

void PagingTestBase::testMultipleThreads (  )  [inherited]

Carries out specified tests in multi-threaded mode.

Definition at line 431 of file PagingTestBase.cpp.

References DeviceMode::createNew, CacheTestBase::openStorage(), ThreadedTestBase::runThreadedTestCase(), and PagingTestBase::testAllocateAll().

Referenced by CacheTest::CacheTest(), LinearDeviceSegmentTest::LinearDeviceSegmentTest(), LinearViewSegmentTest::LinearViewSegmentTest(), SnapshotSegmentTest::SnapshotSegmentTest(), and VersionedSegmentTest::VersionedSegmentTest().

00432 {
00433     openStorage(DeviceMode::createNew);
00434     testAllocateAll();
00435     runThreadedTestCase();
00436 }

void PagingTestBase::threadInit (  )  [virtual, inherited]

Reimplemented from ThreadedTestBase.

Definition at line 41 of file PagingTestBase.cpp.

References g_pRNG, and ThreadedTestBase::threadInit().

Referenced by PagingTestBase::PagingTestBase().

00042 {
00043     ThreadedTestBase::threadInit();
00044     g_pRNG.reset(new std::subtractive_rng());
00045 }

void PagingTestBase::threadTerminate (  )  [virtual, inherited]

Reimplemented from ThreadedTestBase.

Definition at line 47 of file PagingTestBase.cpp.

References g_pRNG, and ThreadedTestBase::threadTerminate().

Referenced by PagingTestBase::~PagingTestBase().

00048 {
00049     g_pRNG.reset();
00050     ThreadedTestBase::threadTerminate();
00051 }

bool PagingTestBase::testThreadedOp ( int  iOp  )  [virtual, inherited]

Test implementation must be supplied by derived test class.

Parameters:
iOp operation type to test
Returns:
true if test should run again

Implements ThreadedTestBase.

Definition at line 378 of file PagingTestBase.cpp.

References PagingTestBase::checkpointMutex, SXMutexGuard< lockMode >::lock(), PagingTestBase::OP_ALLOCATE, PagingTestBase::OP_CHECKPOINT, PagingTestBase::OP_DEALLOCATE, PagingTestBase::OP_MAX, PagingTestBase::OP_PREFETCH, PagingTestBase::OP_PREFETCH_BATCH, PagingTestBase::OP_READ_NOWAIT, PagingTestBase::OP_READ_RAND, PagingTestBase::OP_READ_SEQ, PagingTestBase::OP_RESIZE_CACHE, PagingTestBase::OP_SCRATCH, PagingTestBase::OP_WRITE_NOWAIT, PagingTestBase::OP_WRITE_RAND, PagingTestBase::OP_WRITE_SEQ, PagingTestBase::OP_WRITE_SKIP, PagingTestBase::testAllocate(), PagingTestBase::testCacheResize(), PagingTestBase::testCheckpointGuarded(), PagingTestBase::testDeallocate(), PagingTestBase::testPrefetch(), PagingTestBase::testPrefetchBatch(), PagingTestBase::testRandomOp(), PagingTestBase::testScratch(), PagingTestBase::testSequentialOp(), and PagingTestBase::testSkipOp().

00379 {
00380     SXMutexSharedGuard checkpointSharedGuard(checkpointMutex,false);
00381     assert(iOp < OP_MAX);
00382     OpType op = static_cast<OpType>(iOp);
00383     switch (op) {
00384     case PagingTestBase::OP_WRITE_SEQ:
00385         checkpointSharedGuard.lock();
00386         // fall through
00387     case PagingTestBase::OP_READ_SEQ:
00388         testSequentialOp(op);
00389         break;
00390     case PagingTestBase::OP_WRITE_RAND:
00391     case PagingTestBase::OP_WRITE_NOWAIT:
00392         checkpointSharedGuard.lock();
00393         // fall through
00394     case PagingTestBase::OP_READ_RAND:
00395     case PagingTestBase::OP_READ_NOWAIT:
00396         testRandomOp(op);
00397         break;
00398     case PagingTestBase::OP_WRITE_SKIP:
00399         checkpointSharedGuard.lock();
00400         testSkipOp(op, 5);
00401         break;
00402     case PagingTestBase::OP_SCRATCH:
00403         testScratch();
00404         break;
00405     case PagingTestBase::OP_PREFETCH:
00406         testPrefetch();
00407         break;
00408     case PagingTestBase::OP_PREFETCH_BATCH:
00409         testPrefetchBatch();
00410         break;
00411     case PagingTestBase::OP_ALLOCATE:
00412         checkpointSharedGuard.lock();
00413         testAllocate();
00414         break;
00415     case PagingTestBase::OP_DEALLOCATE:
00416         checkpointSharedGuard.lock();
00417         testDeallocate();
00418         break;
00419     case PagingTestBase::OP_CHECKPOINT:
00420         testCheckpointGuarded();
00421         break;
00422     case PagingTestBase::OP_RESIZE_CACHE:
00423         testCacheResize();
00424         return false;
00425     default:
00426         permAssert(false);
00427     }
00428     return true;
00429 }

void ThreadedTestBase::runThreadedTestCase (  )  [protected, inherited]

Executes specified test threads.

Definition at line 43 of file ThreadedTestBase.cpp.

References ThreadedTestBase::bDone, ThreadedTestBase::defaultThreadCount, ThreadedTestBase::nSeconds, ThreadedTestBase::pStartBarrier, TestBase::snooze(), ThreadPoolBase::start(), ThreadPoolBase::stop(), ThreadPool< Task >::submitTask(), and ThreadedTestBase::threadCounts.

Referenced by PagingTestBase::testMultipleThreads(), and BTreeTxnTest::testTxns().

00044 {
00045     bDone = false;
00046 
00047     // materialize default thread counts
00048     std::replace_if(
00049         threadCounts.begin(),
00050         threadCounts.end(),
00051         std::bind2nd(std::equal_to<int>(),-1),
00052         defaultThreadCount);
00053 
00054     // calculate how many threads are needed
00055     int nThreads = std::accumulate(
00056         threadCounts.begin(),
00057         threadCounts.end(),
00058         0);
00059 
00060     // initialize a barrier to make sure they all start at once
00061     pStartBarrier.reset(new boost::barrier(nThreads));
00062 
00063     // fire 'em up
00064     ThreadPool<ThreadedTestBaseTask> threadPool;
00065     threadPool.start(nThreads);
00066 
00067     // and distribute the tasks
00068     for (uint i = 0; i < threadCounts.size(); ++i) {
00069         for (int j = 0; j < threadCounts[i]; ++j) {
00070             ThreadedTestBaseTask task(*this,i);
00071             threadPool.submitTask(task);
00072         }
00073     }
00074 
00075     // run the tests for the requested duration
00076     snooze(nSeconds);
00077 
00078     // tell threads to quit and then wait for them to finish up
00079     bDone = true;
00080     threadPool.stop();
00081 }


Member Data Documentation

StandardTypeDescriptorFactory LcsClusterReplaceExecStreamTest::stdTypeFactory [private]

Definition at line 50 of file LcsClusterReplaceExecStreamTest.cpp.

Referenced by testCaseSetUp().

TupleAttributeDescriptor LcsClusterReplaceExecStreamTest::attrDesc_int64 [private]

Definition at line 51 of file LcsClusterReplaceExecStreamTest.cpp.

Referenced by initClusterAppendParams(), loadCluster(), replaceCluster(), testCaseSetUp(), and verifyCluster().

TupleAttributeDescriptor LcsClusterReplaceExecStreamTest::attrDesc_bitmap [private]

Definition at line 52 of file LcsClusterReplaceExecStreamTest.cpp.

Referenced by testCaseSetUp(), and verifyCluster().

PageId LcsClusterReplaceExecStreamTest::savedRootPageId [private]

Definition at line 54 of file LcsClusterReplaceExecStreamTest.cpp.

Referenced by loadCluster(), replaceCluster(), and testCaseSetUp().

BTreeDescriptor LcsClusterReplaceExecStreamTest::btreeDescriptor [private]

Definition at line 55 of file LcsClusterReplaceExecStreamTest.cpp.

Referenced by initClusterAppendParams(), loadCluster(), replaceCluster(), testCaseTearDown(), and verifyCluster().

SharedExecStreamGraph ExecStreamUnitTestBase::pGraph [protected, inherited]

Definition at line 46 of file ExecStreamUnitTestBase.h.

Referenced by ExecStreamUnitTestBase::prepareConfluenceGraph(), ExecStreamUnitTestBase::prepareConfluenceTransformGraph(), ExecStreamUnitTestBase::prepareDAG(), ExecStreamUnitTestBase::prepareTransformGraph(), ExecStreamUnitTestBase::resetExecStreamTest(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamUnitTestBase::tearDownExecStreamTest(), ExecStreamTestSuite::testBTreeInsertExecStream(), ExecStreamUnitTestBase::testCaseSetUp(), CorrelationJoinExecStreamTestSuite::testCorrelationJoin(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), LbmLoadBitmapTest::testLoad(), ExecStreamTestSuite::testReshapeExecStream(), LbmSearchTest::testScanIdx(), ExecStreamUnitTestBase::verifyBufferedOutput(), ExecStreamUnitTestBase::verifyConstantOutput(), FlatFileExecStreamTest::verifyOutput(), and ExecStreamUnitTestBase::verifyOutput().

SharedExecStreamGraphEmbryo ExecStreamUnitTestBase::pGraphEmbryo [protected, inherited]

Definition at line 47 of file ExecStreamUnitTestBase.h.

Referenced by ExecStreamUnitTestBase::prepareConfluenceGraph(), ExecStreamUnitTestBase::prepareConfluenceTransformGraph(), ExecStreamUnitTestBase::prepareDAG(), ExecStreamUnitTestBase::prepareTransformGraph(), ExecStreamUnitTestBase::resetExecStreamTest(), ExecStreamUnitTestBase::tearDownExecStreamTest(), and ExecStreamUnitTestBase::testCaseSetUp().

const uint ExecStreamTestBase::DefaultCacheReservePercent = 5 [static, protected, inherited]

Definition at line 45 of file ExecStreamTestBase.h.

Referenced by ExecStreamTestBase::testCaseSetUp().

const uint ExecStreamTestBase::DefaultConcurrentStatements = 4 [static, protected, inherited]

Definition at line 47 of file ExecStreamTestBase.h.

Referenced by ExecStreamTestBase::testCaseSetUp().

SharedExecStreamScheduler ExecStreamTestBase::pScheduler [protected, inherited]

Definition at line 49 of file ExecStreamTestBase.h.

Referenced by ExecStreamTestBase::newStreamGraphEmbryo(), ExecStreamUnitTestBase::resetExecStreamTest(), ExecStreamTestBase::testCaseSetUp(), ExecStreamTestBase::testCaseTearDown(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), ExecStreamUnitTestBase::verifyBufferedOutput(), ExecStreamUnitTestBase::verifyConstantOutput(), FlatFileExecStreamTest::verifyOutput(), and ExecStreamUnitTestBase::verifyOutput().

SharedExecStreamGovernor ExecStreamTestBase::pResourceGovernor [protected, inherited]

Definition at line 51 of file ExecStreamTestBase.h.

Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), ExternalSortExecStreamTest::testCaseSetUp(), ExecStreamUnitTestBase::testCaseSetUp(), ExecStreamTestBase::testCaseSetUp(), ExecStreamGovernorTest::testCaseSetUp(), ExecStreamTestBase::testCaseTearDown(), ExecStreamGovernorTest::testMinGreaterAllocation(), ExecStreamUnitTestBase::verifyBufferedOutput(), ExecStreamUnitTestBase::verifyConstantOutput(), FlatFileExecStreamTest::verifyOutput(), and ExecStreamUnitTestBase::verifyOutput().

SharedCacheAccessor ExecStreamTestBase::pCacheAccessor [protected, inherited]

Definition at line 53 of file ExecStreamTestBase.h.

Referenced by ExecStreamTestSuite::testBTreeInsertExecStream(), ExecStreamUnitTestBase::testCaseSetUp(), ExecStreamTestBase::testCaseTearDown(), ExecStreamTestSuite::testMergeImplicitPullInputs(), ExecStreamTestSuite::testSegBufferExecStream(), and ExecStreamTestSuite::testSegBufferReaderWriterExecStream().

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(), 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(), 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(), initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), 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(), testCaseSetUp(), LcsClusterAppendExecStreamTest::testCaseSetUp(), LbmExecStreamTestBase::testCaseSetUp(), 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(), 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(), 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(), initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegmentTestBase::lockPage(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), CacheTestBase::openDevice(), CacheTestBase::openStorage(), 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(), 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().

uint SnapshotSegmentTestBase::nDiskPagesTotal [protected, inherited]

Definition at line 39 of file SnapshotSegmentTestBase.h.

Referenced by SnapshotSegmentTestBase::openSegmentStorage(), and SnapshotSegmentTestBase::SnapshotSegmentTestBase().

PageId SnapshotSegmentTestBase::firstPageId [protected, inherited]

Definition at line 40 of file SnapshotSegmentTestBase.h.

Referenced by SnapshotSegmentTestBase::openSegmentStorage(), SnapshotSegmentTestBase::testAllocateAll(), SnapshotSegmentTest::testDeallocateOld(), and SnapshotSegmentTest::testUncommittedReads().

DeviceId SnapshotSegmentTestBase::tempDeviceId [protected, inherited]

Definition at line 41 of file SnapshotSegmentTestBase.h.

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

SharedRandomAccessDevice SnapshotSegmentTestBase::pTempDevice [protected, inherited]

Definition at line 42 of file SnapshotSegmentTestBase.h.

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

SharedSegment SnapshotSegmentTestBase::pTempSegment [protected, inherited]

Definition at line 43 of file SnapshotSegmentTestBase.h.

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

TxnId SnapshotSegmentTestBase::currCsn [protected, inherited]

Definition at line 44 of file SnapshotSegmentTestBase.h.

Referenced by SnapshotSegmentTestBase::closeStorage(), SnapshotSegmentTest::deallocateOldPages(), SnapshotSegmentTestBase::fillPage(), SnapshotSegmentTestBase::openSegmentStorage(), BackupRestoreTest::testBackupRestore(), SnapshotSegmentTestBase::testCaseSetUp(), testClusterReplace(), SnapshotSegmentTest::testDeallocateOld(), SnapshotSegmentTest::testRollback(), SnapshotSegmentTest::testSnapshotReads(), SnapshotSegmentTest::testUncommittedReads(), and SnapshotSegmentTestBase::verifyPage().

std::vector<TxnId> SnapshotSegmentTestBase::updatedCsns [protected, inherited]

Definition at line 45 of file SnapshotSegmentTestBase.h.

Referenced by BackupRestoreTest::testBackupRestore(), SnapshotSegmentTestBase::testCaseSetUp(), SnapshotSegmentTest::testDeallocateOld(), SnapshotSegmentTest::testSnapshotReads(), SnapshotSegmentTest::testUncommittedReads(), and SnapshotSegmentTestBase::verifyPage().

bool SnapshotSegmentTestBase::commit [protected, inherited]

Definition at line 46 of file SnapshotSegmentTestBase.h.

Referenced by SnapshotSegmentTestBase::commitChanges(), SnapshotSegmentTestBase::testCaseSetUp(), and SnapshotSegmentTest::testRollback().

SharedSegment SnapshotSegmentTestBase::pSnapshotRandomSegment2 [protected, inherited]

Definition at line 47 of file SnapshotSegmentTestBase.h.

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

std::vector<PageId> SegmentTestBase::freeablePages [protected, inherited]

Queue of allocated pages waiting to be freed.

Definition at line 44 of file SegmentTestBase.h.

Referenced by SegmentTestBase::testAllocate(), SegmentTestBase::testDeallocate(), and SegmentTestBase::testSingleThread().

StrictMutex SegmentTestBase::freeablePagesMutex [protected, inherited]

Mutex protecting freeablePages.

Definition at line 49 of file SegmentTestBase.h.

Referenced by SegmentTestBase::testAllocate(), and SegmentTestBase::testDeallocate().

PageOwnerId SegmentTestBase::objId [protected, inherited]

PageOwnerId to use when allocating pages.

Definition at line 54 of file SegmentTestBase.h.

Referenced by SegmentTestBase::lockPage(), SegmentTestBase::SegmentTestBase(), and SegmentTestBase::testAllocate().

uint PagingTestBase::cbPageUsable [protected, inherited]

Portion of each page that should be scribbled on.

Definition at line 49 of file PagingTestBase.h.

Referenced by CacheTest::CacheTest(), PagingTestBase::fillPage(), SegmentTestBase::openStorage(), PagingTestBase::PagingTestBase(), and PagingTestBase::verifyPage().

uint PagingTestBase::nRandomOps [protected, inherited]

Number of random access operations to run per pass.

Definition at line 54 of file PagingTestBase.h.

Referenced by PagingTestBase::PagingTestBase(), SegmentTestBase::testAllocate(), SegmentTestBase::testDeallocate(), PagingTestBase::testRandomOp(), and PagingTestBase::testScratch().

uint PagingTestBase::nSecondsBetweenCheckpoints [protected, inherited]

Checkpoint interval during multi-threaded test.

Definition at line 59 of file PagingTestBase.h.

Referenced by PagingTestBase::PagingTestBase(), and PagingTestBase::testCheckpointGuarded().

StrictMutex PagingTestBase::logMutex [protected, inherited]

Protects output stream.

Definition at line 64 of file PagingTestBase.h.

Referenced by SegmentTestBase::testAllocate(), PagingTestBase::testCacheResize(), PagingTestBase::testCheckpointGuarded(), SegmentTestBase::testDeallocate(), PagingTestBase::testPrefetch(), PagingTestBase::testPrefetchBatch(), PagingTestBase::testRandomOp(), PagingTestBase::testScratch(), PagingTestBase::testSequentialOp(), and PagingTestBase::testSkipOp().

SXMutex PagingTestBase::checkpointMutex [protected, inherited]

SXMutex used to synchronize checkpoints with write actions.

Definition at line 69 of file PagingTestBase.h.

Referenced by PagingTestBase::PagingTestBase(), PagingTestBase::testCheckpointGuarded(), and PagingTestBase::testThreadedOp().

bool PagingTestBase::bTestResize [protected, inherited]

Flag indicating that the cache should be dynamically resized during the multi-threaded portion of the test.

Definition at line 75 of file PagingTestBase.h.

Referenced by PagingTestBase::PagingTestBase().

uint ThreadedTestBase::nSeconds [protected, inherited]

Duration of multi-threaded test.

Definition at line 65 of file ThreadedTestBase.h.

Referenced by BTreeTxnTest::BTreeTxnTest(), PagingTestBase::PagingTestBase(), ThreadedTestBase::runThreadedTestCase(), PagingTestBase::testCacheResize(), and ThreadedTestBase::ThreadedTestBase().

std::vector<int> ThreadedTestBase::threadCounts [protected, inherited]

Number of threads to run for each type of operation.

Definition at line 70 of file ThreadedTestBase.h.

Referenced by BTreeTxnTest::BTreeTxnTest(), CacheTest::CacheTest(), SegmentTestBase::openStorage(), PagingTestBase::PagingTestBase(), ThreadedTestBase::runThreadedTestCase(), and SegmentTestBase::SegmentTestBase().


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