Fennel: LcsClusterReplaceExecStreamTest Class Reference (original) (raw)

Test class for exercising LcsClusterReplaceExecStream. More...

Inheritance diagram for LcsClusterReplaceExecStreamTest:

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 ()
Cache & getCache ()
virtual SharedCache newCache ()
SharedRandomAccessDevice openDevice (std::string devName, DeviceMode openMode, uint nDevicePages, DeviceId deviceId)
void closeDevice (DeviceId deviceId, SharedRandomAccessDevice &pDevice)
TestSuite * releaseTestSuite ()
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 CachePage * lockPage (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 ExecStreamScheduler * newScheduler ()
Creates a scheduler.
virtual ExecStreamGovernor * newResourceGovernor (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.
TestSuite * pTestSuite
Boost test suite.
boost::shared_ptr< TestBase > pTestObj
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

The available victim policy implementations.

Enumerator:

| victimTwoQ | | | -------------- | | | victimLRU | | | victimRandom | |

Definition at line 44 of file CacheTestBase.h.

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] | | ---------------------------------------------------------------- | - | | - | -------------------- |


Member Function Documentation

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().

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().

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().

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
00388 loadCluster(nCols, totalNumRows, pOrigClusterInputGenerator); 00389 resetExecStreamTest(); 00390 verifyCluster(nCols, totalNumRows, origClusterResultGenerator); 00391 resetExecStreamTest(); 00392 00393
00394
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
00410 replaceCluster(nCols, numReplRows, pReplClusterInputGenerator); 00411 00412
00413
00414
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
00199
00200
00201
00202
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 > > 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 > > columnGenerators; 00320 SharedInt64ColumnGenerator colGenerator; 00321 00322
00323
00324
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
00344
00345
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
00359
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 }

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().

| void LcsClusterReplaceExecStreamTest::testSingleColOddNumRows | ( | | ) | | ------------------------------------------------------------- | - | | - |

| void LcsClusterReplaceExecStreamTest::testSingleColEvenNumRows | ( | | ) | | -------------------------------------------------------------- | - | | - |

| void LcsClusterReplaceExecStreamTest::testSingleColSeqStartAt1 | ( | | ) | | -------------------------------------------------------------- | - | | - |

| void LcsClusterReplaceExecStreamTest::testReplaceAllRows | ( | | ) | | -------------------------------------------------------- | - | | - |

| void LcsClusterReplaceExecStreamTest::testReplaceNoRows | ( | | ) | | ------------------------------------------------------- | - | | - |

| void LcsClusterReplaceExecStreamTest::test3ColClusterReplace | ( | | ) | | ------------------------------------------------------------ | - | | - |

| 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] | | ------------------------------------------------------ | - | | - | ----------- |

| void LcsClusterReplaceExecStreamTest::openRandomSegment | ( | | ) | [virtual] | | ------------------------------------------------------- | - | | - | ----------- |

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 transforms; 00053 transforms.push_back(transformStreamEmbryo); 00054 return prepareTransformGraph(sourceStreamEmbryo, transforms); 00055 }

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::iterator it; 00063 00064
00065 for (it = transforms.begin(); it != transforms.end(); ++it) { 00066 pGraphEmbryo->saveStreamEmbryo(*it); 00067 } 00068 00069
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 }

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 sourceStreamEmbryos; 00095 sourceStreamEmbryos.push_back(sourceStreamEmbryo1); 00096 sourceStreamEmbryos.push_back(sourceStreamEmbryo2); 00097 return prepareConfluenceGraph(sourceStreamEmbryos, confluenceStreamEmbryo); 00098 }

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 > sourceStreamEmbryosList; 00160 std::vector::iterator it; 00161 std::vector 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 }

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
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 }

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 sourceStreamEmbryos; 00107 sourceStreamEmbryos.push_back(sourceStreamEmbryo1); 00108 sourceStreamEmbryos.push_back(sourceStreamEmbryo2); 00109 00110 std::vector::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 transforms; 00128 transforms.push_back(transformStreamEmbryo); 00129 ExecStreamEmbryo& previousStream = confluenceStreamEmbryo; 00130 00131
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 }

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 > listOfList; 00217 00218
00219
00220
00221 for (uint i = 0; i < interStreamEmbryos.size(); i++) { 00222 std::vector 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 }

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
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
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
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 }

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
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
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 }

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
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().

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

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().

void SegStorageTestBase::openSegmentStorage ( DeviceMode openMode ) [virtual, inherited]
SharedSegment SegStorageTestBase::createLinearDeviceSegment ( DeviceId deviceId,
uint nPages
) [inherited]

| void SegStorageTestBase::closeLinearSegment | ( | | ) | [inherited] | | ------------------------------------------- | - | | - | ------------- |

| void SegStorageTestBase::closeRandomSegment | ( | | ) | [inherited] | | ------------------------------------------- | - | | - | ------------- |

| void SegStorageTestBase::closeVersionedRandomSegment | ( | | ) | [inherited] | | ---------------------------------------------------- | - | | - | ------------- |

| void SegStorageTestBase::closeSnapshotRandomSegment | ( | | ) | [inherited] | | --------------------------------------------------- | - | | - | ------------- |

| 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().

| Cache & CacheTestBase::getCache | ( | | ) | [inherited] | | -------------------------------------------------- | - | | - | ------------- |

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

void TestBase::snooze ( uint nSeconds ) [protected, inherited]
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") {
00123 permAssert(i + 1 < argc); 00124 runSingle = argv[++i]; 00125 } else if (arg[1] == 't') { 00126 runSingle = arg.substr(2); 00127 } 00128 } else { 00129 int i = arg.find("="); 00130 if ((0 < i) && (i < arg.size())) { 00131
00132 std::string key = arg.substr(0,i); 00133 std::string val = arg.substr(i + 1); 00134 adhocMap.setStringParam(key,val); 00135 } else { 00136
00137 std::ifstream configFile(arg.c_str()); 00138 assert(configFile.good()); 00139 configMap.readParams(configFile); 00140 } 00141 } 00142 } 00143 configMap.mergeFrom(adhocMap); 00144 00145
00146
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] | | ---------------------------------------------------------------------------------------------- | - | | - | ------------- |

void TestBase::beforeTestCase ( std::string testCaseName ) [inherited]
void TestBase::afterTestCase ( std::string testCaseName ) [inherited]
void TestBase::notifyTrace ( std::string source,
TraceLevel level,
std::string message
) [virtual, inherited]
TraceLevel TestBase::getSourceTraceLevel ( std::string source ) [virtual, inherited]
void SnapshotSegmentTestBase::setForceCacheUnmap ( SharedSegment pSegment ) [protected, inherited]
void SnapshotSegmentTestBase::commitChanges ( TxnId commitCsn ) [protected, inherited]
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().

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

void SnapshotSegmentTestBase::verifyPage ( CachePage & page,
uint x
) [virtual, inherited]
void SnapshotSegmentTestBase::fillPage ( CachePage & page,
uint x
) [virtual, inherited]
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().

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.

void SegmentTestBase::unlockPage ( CachePage & page,
LockMode lockMode
) [virtual, inherited]
void SegmentTestBase::prefetchPage ( uint iPage ) [virtual, inherited]
void SegmentTestBase::prefetchBatch ( uint ,
uint
) [virtual, inherited]

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

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

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

| 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().

uint PagingTestBase::generateRandomNumber ( uint iMax ) [protected, inherited]
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().

char const * PagingTestBase::getOpName ( 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().

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

| void PagingTestBase::testScratch | ( | | ) | [inherited] | | -------------------------------- | - | | - | ------------- |

| void PagingTestBase::testPrefetch | ( | | ) | [inherited] | | --------------------------------- | - | | - | ------------- |

| void PagingTestBase::testPrefetchBatch | ( | | ) | [inherited] | | -------------------------------------- | - | | - | ------------- |

| void PagingTestBase::testSequentialRead | ( | | ) | [inherited] | | --------------------------------------- | - | | - | ------------- |

| void PagingTestBase::testSequentialWrite | ( | | ) | [inherited] | | ---------------------------------------- | - | | - | ------------- |

| void PagingTestBase::testRandomRead | ( | | ) | [inherited] | | ----------------------------------- | - | | - | ------------- |

| void PagingTestBase::testRandomWrite | ( | | ) | [inherited] | | ------------------------------------ | - | | - | ------------- |

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

| void PagingTestBase::testCheckpointGuarded | ( | | ) | [inherited] | | ------------------------------------------ | - | | - | ------------- |

| void PagingTestBase::testCacheResize | ( | | ) | [inherited] | | ------------------------------------ | - | | - | ------------- |

| void PagingTestBase::testMultipleThreads | ( | | ) | [inherited] | | ---------------------------------------- | - | | - | ------------- |

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

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

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().

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


Member Data Documentation

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().

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().

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().

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().

(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().

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().

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().

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().

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().


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