Fennel: LbmSplicerExecStreamTest Class Reference (original) (raw)

Testcase for splicer exec stream. More...

Inheritance diagram for LbmSplicerExecStreamTest:

List of all members.

Public Member Functions
LbmSplicerExecStreamTest ()
void testCaseSetUp ()
Equivalent to JUnit TestCase.setUp; this is called before each test case method is invoked.
void testSpliceRids50 ()
void testSpliceRidsLargeSets ()
void testSpliceRidsSmallSets ()
void testSpliceWithKeys50 ()
void testSpliceWithKeysSmallSpread ()
void testSpliceWithKeysLargeSpread ()
void testMultipleSpliceWithKeysSmallSpread ()
void testMultipleSpliceWithKeysLargeSpread ()
void testLER5968 ()
void testLER6473 ()
virtual void testCaseTearDown ()
Equivalent to JUnit TestCase.tearDown; this is called after each test case method is invoked.
virtual void openStorage (DeviceMode openMode)
virtual void openSegmentStorage (DeviceMode openMode)
virtual void openRandomSegment ()
SharedSegment createLinearDeviceSegment (DeviceId deviceId, uint nPages)
void closeLinearSegment ()
void closeRandomSegment ()
void closeVersionedRandomSegment ()
void closeSnapshotRandomSegment ()
virtual void closeStorage ()
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.
Static Public Member Functions
static void readParams (int argc, char **argv)
Parses the command line.
Static Public Attributes
static ParamName paramTestSuiteName
static ParamName paramTraceFileName
static ParamName paramDictionaryFileName
static ParamName paramTraceLevel
static ParamName paramStatsFileName
static ParamName paramTraceStdout
static ParamName paramDegreeOfParallelism
static ConfigMap configMap
Configuration parameters.
Protected Types
enum VictimPolicy { victimTwoQ, victimLRU, victimRandom }
The available victim policy implementations. More...
Protected Member Functions
void testSpliceRids (uint numSets, uint numRidsPerSet)
Splice multiple sets of random rids into an empty btree.
void generateSeqRidSets (std::vector< std::vector< uint64_t > > &ridSets, uint numSets, uint numRidsPerSet)
Generates multiple sets of rids, each with an equal number of sorted rids.
void generateRidInput (std::vector< uint64_t > const &rids, PBuffer ridBuffer, uint &bufferSize)
Generates a buffer containing the input rids to be passed into the splicer.
void testSpliceWithKeys (uint numRows, uint factor, uint nKeys, bool multipleSplices)
Splice tuples into an empty btree.
void generateRandomRids (std::vector< uint64_t > &rids, uint nRids, uint factor)
Generate N unique, sorted, random rids between 0 and nRids*factor.
void generateTupleInput (std::vector< uint64_t > const &rids, uint &currRidIdx, PBuffer buffer, uint &bufferSize, uint nKeys, bool oneTuple)
Generates a buffer containing one or more tuples to be passed into the splicer.
void spliceInput (boost::shared_array< FixedBuffer > &inputBuffer, uint inputBufSize, uint numRows, BTreeDescriptor const &bTreeDesc)
Splices a buffer of input into a btree, which may already have bitmap entries in it.
void initBTreeParam (BTreeParams &param, BTreeDescriptor const &bTreeDesc)
Initializes BTreeParams structure.
void createBTree (BTreeDescriptor &bTreeDesc, uint nKeys)
Initializes a BTreeDescriptor corresponding to a bitmap index, and creates the btree.
void initBTreeTupleDesc (TupleDescriptor &tupleDesc, uint nKeys)
Initializes a tuple descriptor corresponding to a bitmap index.
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)
Protected Attributes
StandardTypeDescriptorFactory stdTypeFactory
TupleAttributeDescriptor attrDesc_int64
TupleAttributeDescriptor attrDesc_bitmap
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
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.

Detailed Description

Testcase for splicer exec stream.

Definition at line 42 of file LbmSplicerExecStreamTest.cpp.


Member Enumeration Documentation

The available victim policy implementations.

Enumerator:

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

Definition at line 44 of file CacheTestBase.h.


Constructor & Destructor Documentation

| LbmSplicerExecStreamTest::LbmSplicerExecStreamTest | ( | | ) | [inline, explicit] | | -------------------------------------------------- | - | | - | -------------------- |

Definition at line 179 of file LbmSplicerExecStreamTest.cpp.

References testLER5968(), testLER6473(), testMultipleSpliceWithKeysLargeSpread(), testMultipleSpliceWithKeysSmallSpread(), testSpliceRids50(), testSpliceRidsLargeSets(), testSpliceRidsSmallSets(), testSpliceWithKeys50(), testSpliceWithKeysLargeSpread(), and testSpliceWithKeysSmallSpread().

00180 { 00181 FENNEL_UNIT_TEST_CASE(LbmSplicerExecStreamTest, testSpliceRids50); 00182 FENNEL_UNIT_TEST_CASE( 00183 LbmSplicerExecStreamTest, testSpliceRidsLargeSets); 00184 FENNEL_UNIT_TEST_CASE( 00185 LbmSplicerExecStreamTest, testSpliceRidsSmallSets); 00186 FENNEL_UNIT_TEST_CASE( 00187 LbmSplicerExecStreamTest, testSpliceWithKeys50); 00188 FENNEL_UNIT_TEST_CASE( 00189 LbmSplicerExecStreamTest, testSpliceWithKeysSmallSpread); 00190 FENNEL_UNIT_TEST_CASE( 00191 LbmSplicerExecStreamTest, testSpliceWithKeysLargeSpread); 00192 FENNEL_UNIT_TEST_CASE( 00193 LbmSplicerExecStreamTest, testMultipleSpliceWithKeysSmallSpread); 00194 FENNEL_UNIT_TEST_CASE( 00195 LbmSplicerExecStreamTest, testMultipleSpliceWithKeysLargeSpread); 00196 FENNEL_UNIT_TEST_CASE(LbmSplicerExecStreamTest, testLER5968); 00197 FENNEL_UNIT_TEST_CASE(LbmSplicerExecStreamTest, testLER6473); 00198 }


Member Function Documentation

void LbmSplicerExecStreamTest::testSpliceRids ( uint numSets,
uint numRidsPerSet
) [protected]

Splice multiple sets of random rids into an empty btree.

Each rid is unique, and the rids within each set are in sort order.

Parameters:

numSets number of sets
numRidsPerSet number of rids per set

Definition at line 254 of file LbmSplicerExecStreamTest.cpp.

References TupleData::compute(), createBTree(), FixedBuffer, generateRidInput(), LbmEntry::generateRIDs(), generateSeqRidSets(), BTreeReader::getTupleAccessorForRead(), opaqueToInt(), ExecStreamUnitTestBase::resetExecStreamTest(), BTreeReader::searchFirst(), BTreeReader::searchNext(), spliceInput(), BTreeDescriptor::tupleDescriptor, and TupleAccessor::unmarshal().

Referenced by testSpliceRids50(), testSpliceRidsLargeSets(), and testSpliceRidsSmallSets().

00257 { 00258
00259 BTreeDescriptor bTreeDesc; 00260 createBTree(bTreeDesc, 0); 00261 00262
00263 uint totalRids = numSets * numRidsPerSet; 00264 std::vector<std::vector > ridSets; 00265 generateSeqRidSets(ridSets, numSets, numRidsPerSet); 00266 00267
00268 for (uint i = 0; i < numSets; i++) { 00269
00270
00271 boost::shared_array ridBuffer; 00272 ridBuffer.reset(new FixedBuffer[numRidsPerSet * 8]); 00273 uint bufferSize = 0; 00274 generateRidInput( 00275 ridSets[i], 00276 ridBuffer.get(), 00277 bufferSize); 00278 00279 spliceInput( 00280 ridBuffer, 00281 bufferSize, 00282 numRidsPerSet, 00283 bTreeDesc); 00284 00285 resetExecStreamTest(); 00286 } 00287 00288
00289
00290
00291 BTreeReader reader(bTreeDesc); 00292 bool rc = reader.searchFirst(); 00293 BOOST_REQUIRE(rc); 00294 TupleData tupleData; 00295 tupleData.compute(bTreeDesc.tupleDescriptor); 00296 LcsRid startRid = LcsRid(0); 00297 while (rc) { 00298 reader.getTupleAccessorForRead().unmarshal(tupleData); 00299 std::vector ridsRead; 00300 LbmEntry::generateRIDs(tupleData, ridsRead); 00301 for (uint i = 0; i < ridsRead.size(); i++) { 00302 BOOST_CHECK_EQUAL( 00303 opaqueToInt(ridsRead[i]), 00304 opaqueToInt(startRid) + i); 00305 } 00306 startRid += ridsRead.size(); 00307 rc = reader.searchNext(); 00308 } 00309 BOOST_CHECK_EQUAL(opaqueToInt(startRid), totalRids); 00310 }

void LbmSplicerExecStreamTest::generateSeqRidSets ( std::vector< std::vector< uint64_t > > & ridSets,
uint numSets,
uint numRidsPerSet
) [protected]

Generates multiple sets of rids, each with an equal number of sorted rids.

The range of rids generated sequences from 0 to N.

Parameters:

ridSets the sets of rids generated
numSets number of sets to generate
numRidsPerSet number of rids per set

Definition at line 312 of file LbmSplicerExecStreamTest.cpp.

Referenced by testSpliceRids().

00316 { 00317
00318
00319
00320 uint totalRids = numSets * numRidsPerSet; 00321 std::vector rids; 00322 rids.resize(totalRids); 00323 for (uint i = 0; i < totalRids; i++) { 00324 rids[i] = i; 00325 } 00326 00327 std::random_shuffle(rids.begin(), rids.end()); 00328 00329 for (uint i = 0; i < numSets; i++) { 00330 std::vector ridSet; 00331 ridSet.resize(numRidsPerSet); 00332 std::copy( 00333 rids.begin() + i * numRidsPerSet, 00334 rids.begin() + (i + 1) * numRidsPerSet, 00335 ridSet.begin()); 00336 std::sort(ridSet.begin(), ridSet.end()); 00337 ridSets.push_back(ridSet); 00338 } 00339 }

void LbmSplicerExecStreamTest::generateRidInput ( std::vector< uint64_t > const & rids,
PBuffer ridBuffer,
uint & bufferSize
) [protected]
void LbmSplicerExecStreamTest::testSpliceWithKeys ( uint numRows,
uint factor,
uint nKeys,
bool multipleSplices
) [protected]

Splice tuples into an empty btree.

The rids represented in the tuples are unique, random rid between 0 and "numRows" * "factor". The tuples are randomly represented as either singletons or bitmaps with three rids set. Each key value within the tuple is the same.

Parameters:

numRows number of rows to be inserted
factor factor that determines the spread of random rid values generated
nKeys number of keys in the index, excluding the startRid
multipleSplices if true, splice one tuple at a time rather than passing multiple tuples into a single invocation of the splicer exec stream

Definition at line 361 of file LbmSplicerExecStreamTest.cpp.

References TupleData::compute(), createBTree(), FixedBuffer, generateRandomRids(), LbmEntry::generateRIDs(), generateTupleInput(), BTreeReader::getTupleAccessorForRead(), opaqueToInt(), ExecStreamUnitTestBase::resetExecStreamTest(), BTreeReader::searchFirst(), BTreeReader::searchNext(), spliceInput(), BTreeDescriptor::tupleDescriptor, and TupleAccessor::unmarshal().

Referenced by testMultipleSpliceWithKeysLargeSpread(), testMultipleSpliceWithKeysSmallSpread(), testSpliceWithKeys50(), testSpliceWithKeysLargeSpread(), and testSpliceWithKeysSmallSpread().

00366 { 00367
00368 BTreeDescriptor bTreeDesc; 00369 createBTree(bTreeDesc, nKeys); 00370 00371
00372 std::vector rids; 00373 generateRandomRids(rids, numRows, factor); 00374 00375
00376 boost::shared_array buffer; 00377 buffer.reset(new FixedBuffer[(nKeys + 2) * numRows * 8]); 00378 uint currRidIdx = 0; 00379 do { 00380 uint bufferSize = 0; 00381 generateTupleInput( 00382 rids, 00383 currRidIdx, 00384 buffer.get(), 00385 bufferSize, 00386 nKeys, 00387 multipleSplices); 00388 assert(bufferSize <= (nKeys + 2) * numRows * 8); 00389 00390 spliceInput( 00391 buffer, 00392 bufferSize, 00393 numRows, 00394 bTreeDesc); 00395 00396 resetExecStreamTest(); 00397 } while (currRidIdx < rids.size()); 00398 00399
00400
00401 BTreeReader reader(bTreeDesc); 00402 bool rc = reader.searchFirst(); 00403 BOOST_REQUIRE(rc); 00404 TupleData tupleData; 00405 tupleData.compute(bTreeDesc.tupleDescriptor); 00406 uint currIdx = 0; 00407 while (rc) { 00408 reader.getTupleAccessorForRead().unmarshal(tupleData); 00409 std::vector ridsRead; 00410 LbmEntry::generateRIDs(tupleData, ridsRead); 00411 for (uint i = 0; i < ridsRead.size(); i++) { 00412 BOOST_CHECK_EQUAL( 00413 opaqueToInt(ridsRead[i]), 00414 opaqueToInt(rids[currIdx])); 00415 currIdx++; 00416 } 00417 rc = reader.searchNext(); 00418 } 00419 BOOST_CHECK_EQUAL(currIdx, numRows); 00420 }

void LbmSplicerExecStreamTest::generateRandomRids ( std::vector< uint64_t > & rids,
uint nRids,
uint factor
) [protected]

Generate N unique, sorted, random rids between 0 and nRids*factor.

Parameters:

rids rids generated
nRids number of rids to be generated
factor factor that determines the spread of random rid values generated

Definition at line 693 of file LbmSplicerExecStreamTest.cpp.

Referenced by testSpliceWithKeys().

00697 { 00698
00699 std::hash_set ridsGenerated; 00700 uint numGenerated = 0; 00701 while (numGenerated < nRids) { 00702 uint64_t rid = uint64_t(((double) rand() / RAND_MAX) * nRids * factor); 00703 if (ridsGenerated.find(rid) == ridsGenerated.end()) { 00704 rids.push_back(rid); 00705 ridsGenerated.insert(rid); 00706 numGenerated++; 00707 } 00708 } 00709 std::sort(rids.begin(), rids.end()); 00710 }

void LbmSplicerExecStreamTest::generateTupleInput ( std::vector< uint64_t > const & rids,
uint & currRidIdx,
PBuffer buffer,
uint & bufferSize,
uint nKeys,
bool oneTuple
) [protected]

Generates a buffer containing one or more tuples to be passed into the splicer.

Each tuple is either a singleton or a bitmap with 3 rids. The method randomly picks between the two.

Parameters:

rids rids that will be represented in the tuples generated
currRidIdx index into the the rids vector corresponding to the next rid to be inserted into the tuple
buffer the buffer to be populated
bufferSize size of the buffer after it has been populated
nKeys number of keys in the index to be spliced
oneTuple if true, generate only a single tuple

Definition at line 712 of file LbmSplicerExecStreamTest.cpp.

References TupleData::compute(), TupleAccessor::compute(), FixedBuffer, TupleAccessor::getCurrentByteCount(), LbmEntry::init(), initBTreeTupleDesc(), TupleAccessor::marshal(), LbmEntry::produceEntryTuple(), LbmEntry::setEntryTuple(), and LbmEntry::setRID().

Referenced by testSpliceWithKeys().

00719 { 00720 TupleDescriptor tupleDesc; 00721 initBTreeTupleDesc(tupleDesc, nKeys); 00722 00723 TupleAccessor tupleAccessor; 00724 tupleAccessor.compute(tupleDesc); 00725 00726 TupleData tupleData; 00727 tupleData.compute(tupleDesc); 00728 00729
00730 for (uint i = 0; i < nKeys; i++) { 00731 uint64_t keyVal = i; 00732 tupleData[i].pData = (PConstBuffer) &keyVal; 00733 } 00734 00735 LbmEntry lbmEntry; 00736 boost::scoped_array entryBuf; 00737 uint entryBufSize = (nKeys + 1) * 8 + 4 * 3; 00738 entryBuf.reset(new FixedBuffer[entryBufSize]); 00739 lbmEntry.init(entryBuf.get(), NULL, entryBufSize, tupleDesc); 00740 00741 uint numRids = rids.size(); 00742 while (currRidIdx < numRids) { 00743 tupleData[nKeys].pData = (PConstBuffer) &rids[currRidIdx]; 00744 tupleData[nKeys + 1].pData = NULL; 00745 tupleData[nKeys + 1].cbData = 0; 00746 tupleData[nKeys + 2].pData = NULL; 00747 tupleData[nKeys + 2].cbData = 0; 00748 00749
00750
00751 uint bitmapType; 00752 if (currRidIdx >= numRids - 3) { 00753 bitmapType = 0; 00754 } else { 00755 bitmapType = rand() % 2; 00756 } 00757 if (bitmapType == 0) { 00758 currRidIdx++; 00759 } else { 00760 lbmEntry.setEntryTuple(tupleData); 00761 bool rc = lbmEntry.setRID(LcsRid(rids[currRidIdx + 1])); 00762 BOOST_REQUIRE(rc); 00763 rc = lbmEntry.setRID(LcsRid(rids[currRidIdx + 2])); 00764 BOOST_REQUIRE(rc); 00765 tupleData = lbmEntry.produceEntryTuple(); 00766 currRidIdx += 3; 00767 } 00768 00769 tupleAccessor.marshal(tupleData, buffer + bufferSize); 00770 bufferSize += tupleAccessor.getCurrentByteCount(); 00771 if (oneTuple) { 00772 break; 00773 } 00774 } 00775 }

void LbmSplicerExecStreamTest::spliceInput ( boost::shared_array< FixedBuffer > & inputBuffer,
uint inputBufSize,
uint numRows,
BTreeDescriptor const & bTreeDesc
) [protected]

Splices a buffer of input into a btree, which may already have bitmap entries in it.

Parameters:

inputBuffer buffer containing input into splicer
inputBufSize size of the input buffer
numRows number of rows to be spliced
bTreeDesc descriptor of the btree being spliced into

Definition at line 777 of file LbmSplicerExecStreamTest.cpp.

References attrDesc_bitmap, attrDesc_int64, LbmSplicerExecStreamParams::bTreeParams, ValuesExecStreamParams::bufSize, TupleDatum::cbData, LbmSplicerExecStreamParams::createNewIndex, ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), initBTreeParam(), LbmSplicerExecStreamParams::insertRowCountParamId, BTreeDescriptor::keyProjection, DiffluenceExecStreamParams::outputTupleDesc, SingleOutputExecStreamParams::outputTupleDesc, CacheTestBase::pCache, TupleDatum::pData, ExecStreamUnitTestBase::pGraph, ExecStreamUnitTestBase::prepareTransformGraph(), SegStorageTestBase::pSegmentFactory, ValuesExecStreamParams::pTupleBuffer, ExecStreamUnitTestBase::verifyOutput(), and LbmSplicerExecStreamParams::writeRowCountParamId.

Referenced by testLER5968(), testLER6473(), testSpliceRids(), and testSpliceWithKeys().

00782 { 00783
00784
00785
00786 uint nKeys = bTreeDesc.keyProjection.size(); 00787 ValuesExecStreamParams valuesParams; 00788 for (uint i = 0; i < nKeys; i++) { 00789 valuesParams.outputTupleDesc.push_back(attrDesc_int64); 00790 } 00791 if (nKeys > 1) { 00792 valuesParams.outputTupleDesc.push_back(attrDesc_bitmap); 00793 valuesParams.outputTupleDesc.push_back(attrDesc_bitmap); 00794 } 00795 valuesParams.pTupleBuffer = inputBuffer, 00796 valuesParams.bufSize = inputBufSize; 00797 00798 ExecStreamEmbryo valuesStreamEmbryo; 00799 valuesStreamEmbryo.init(new ValuesExecStream(), valuesParams); 00800 valuesStreamEmbryo.getStream()->setName("ValuesExecStream"); 00801 00802
00803 LbmSplicerExecStreamParams splicerParams; 00804 splicerParams.createNewIndex = false; 00805 splicerParams.scratchAccessor = 00806 pSegmentFactory->newScratchSegment(pCache, 15); 00807 splicerParams.pCacheAccessor = pCache; 00808 BTreeParams bTreeParams; 00809 initBTreeParam(bTreeParams, bTreeDesc); 00810 splicerParams.bTreeParams.push_back(bTreeParams); 00811 splicerParams.outputTupleDesc.push_back(attrDesc_int64); 00812 splicerParams.writeRowCountParamId = DynamicParamId(0); 00813 00814
00815
00816
00817 if (nKeys == 1) { 00818 splicerParams.insertRowCountParamId = DynamicParamId(0); 00819 } else { 00820 splicerParams.insertRowCountParamId = DynamicParamId(1); 00821 SharedDynamicParamManager pDynamicParamManager = 00822 pGraph->getDynamicParamManager(); 00823 pDynamicParamManager->createParam(DynamicParamId(1), attrDesc_int64); 00824 TupleDatum paramValDatum; 00825 uint64_t rowCount = numRows; 00826 paramValDatum.pData = (PConstBuffer) &rowCount; 00827 paramValDatum.cbData = 8; 00828 pDynamicParamManager->writeParam(DynamicParamId(1), paramValDatum); 00829 } 00830 00831 ExecStreamEmbryo splicerStreamEmbryo; 00832 splicerStreamEmbryo.init(new LbmSplicerExecStream(), splicerParams); 00833 splicerStreamEmbryo.getStream()->setName("LbmSplicerExecStream"); 00834 00835 SharedExecStream pOutputStream = 00836 prepareTransformGraph(valuesStreamEmbryo, splicerStreamEmbryo); 00837 00838
00839 RampExecStreamGenerator expectedResultGenerator(numRows); 00840 00841 verifyOutput(*pOutputStream, 1, expectedResultGenerator); 00842 }

Initializes BTreeParams structure.

Parameters:

Definition at line 844 of file LbmSplicerExecStreamTest.cpp.

References BTreeParams::keyProj, BTreeDescriptor::keyProjection, BTreeDescriptor::pageOwnerId, BTreeParams::pageOwnerId, SegStorageTestBase::pRandomSegment, BTreeParams::pRootMap, BTreeParams::pSegment, BTreeDescriptor::rootPageId, BTreeParams::rootPageId, BTreeDescriptor::segmentId, BTreeParams::segmentId, BTreeParams::tupleDesc, and BTreeDescriptor::tupleDescriptor.

Referenced by spliceInput().

void LbmSplicerExecStreamTest::createBTree ( BTreeDescriptor & bTreeDesc,
uint nKeys
) [protected]

Initializes a BTreeDescriptor corresponding to a bitmap index, and creates the btree.

Parameters:

bTreeDesc BTreeDescriptor to be initialized
nKeys number of keys in the bitmap index; excludes the startRid

Definition at line 857 of file LbmSplicerExecStreamTest.cpp.

References BTreeBuilder::createEmptyRoot(), BTreeAccessBase::getRootPageId(), initBTreeTupleDesc(), BTreeDescriptor::keyProjection, NULL_PAGE_ID, CacheTestBase::pCache, SegmentAccessor::pCacheAccessor, SegStorageTestBase::pRandomSegment, SegmentAccessor::pSegment, BTreeDescriptor::rootPageId, BTreeDescriptor::segmentAccessor, and BTreeDescriptor::tupleDescriptor.

Referenced by testLER5968(), testLER6473(), testSpliceRids(), and testSpliceWithKeys().

void LbmSplicerExecStreamTest::initBTreeTupleDesc ( TupleDescriptor & tupleDesc,
uint nKeys
) [protected]

| void LbmSplicerExecStreamTest::testCaseSetUp | ( | | ) | [virtual] | | -------------------------------------------- | - | | - | ----------- |

| void LbmSplicerExecStreamTest::testSpliceRids50 | ( | | ) | | ----------------------------------------------- | - | | - |

| void LbmSplicerExecStreamTest::testSpliceRidsLargeSets | ( | | ) | | ------------------------------------------------------ | - | | - |

| void LbmSplicerExecStreamTest::testSpliceRidsSmallSets | ( | | ) | | ------------------------------------------------------ | - | | - |

| void LbmSplicerExecStreamTest::testSpliceWithKeys50 | ( | | ) | | --------------------------------------------------- | - | | - |

| void LbmSplicerExecStreamTest::testSpliceWithKeysSmallSpread | ( | | ) | | ------------------------------------------------------------ | - | | - |

| void LbmSplicerExecStreamTest::testSpliceWithKeysLargeSpread | ( | | ) | | ------------------------------------------------------------ | - | | - |

| void LbmSplicerExecStreamTest::testMultipleSpliceWithKeysSmallSpread | ( | | ) | | -------------------------------------------------------------------- | - | | - |

| void LbmSplicerExecStreamTest::testMultipleSpliceWithKeysLargeSpread | ( | | ) | | -------------------------------------------------------------------- | - | | - |

| void LbmSplicerExecStreamTest::testLER5968 | ( | | ) | | ------------------------------------------ | - | | - |

Definition at line 422 of file LbmSplicerExecStreamTest.cpp.

References TupleData::compute(), TupleAccessor::compute(), createBTree(), FixedBuffer, LbmEntry::generateRIDs(), TupleAccessor::getCurrentByteCount(), BTreeReader::getTupleAccessorForRead(), LbmEntry::init(), initBTreeTupleDesc(), TupleAccessor::marshal(), opaqueToInt(), LbmEntry::produceEntryTuple(), ExecStreamUnitTestBase::resetExecStreamTest(), BTreeReader::searchFirst(), BTreeReader::searchNext(), LbmEntry::setEntryTuple(), LbmEntry::setRID(), spliceInput(), BTreeDescriptor::tupleDescriptor, and TupleAccessor::unmarshal().

Referenced by LbmSplicerExecStreamTest().

00423 { 00424 TupleDescriptor tupleDesc; 00425 initBTreeTupleDesc(tupleDesc, 1); 00426 00427
00428 BTreeDescriptor bTreeDesc; 00429 createBTree(bTreeDesc, 1); 00430 00431 TupleAccessor tupleAccessor; 00432 tupleAccessor.compute(tupleDesc); 00433 00434
00435 uint64_t keyVal = 1; 00436 TupleData tupleData; 00437 tupleData.compute(bTreeDesc.tupleDescriptor); 00438 tupleData[0].pData = (PConstBuffer) &keyVal; 00439 00440 LbmEntry lbmEntry; 00441 boost::scoped_array entryBuf; 00442 uint entryBufSize = tupleDesc[2].cbStorage + 8 + 8; 00443 entryBuf.reset(new FixedBuffer[entryBufSize]); 00444 lbmEntry.init(entryBuf.get(), NULL, entryBufSize, tupleDesc); 00445 00446 std::vector rids; 00447 00448
00449 uint64_t rid = 0; 00450 rids.push_back(rid); 00451 tupleData[1].pData = (PConstBuffer) &rid; 00452 tupleData[2].pData = NULL; 00453 tupleData[2].cbData = 0; 00454 tupleData[3].pData = NULL; 00455 tupleData[3].cbData = 0; 00456 lbmEntry.setEntryTuple(tupleData); 00457 tupleData = lbmEntry.produceEntryTuple(); 00458 boost::shared_array buffer; 00459 buffer.reset(new FixedBuffer[1024]); 00460 uint bufferSize = 0; 00461 tupleAccessor.marshal(tupleData, buffer.get() + bufferSize); 00462 bufferSize += tupleAccessor.getCurrentByteCount(); 00463 00464
00465 rid = 5984; 00466 rids.push_back(rid); 00467 tupleData[1].pData = (PConstBuffer) &rid; 00468 tupleData[2].pData = NULL; 00469 tupleData[2].cbData = 0; 00470 tupleData[3].pData = NULL; 00471 tupleData[3].cbData = 0; 00472 lbmEntry.setEntryTuple(tupleData); 00473 uint numRids = 1; 00474 do { 00475 bool rc = lbmEntry.setRID(LcsRid(rid + numRids * 16)); 00476 if (!rc) { 00477 break; 00478 } 00479 numRids++; 00480 } while (true); 00481 00482
00483
00484
00485
00486 tupleData[1].pData = (PConstBuffer) &rid; 00487 tupleData[2].pData = NULL; 00488 tupleData[2].cbData = 0; 00489 tupleData[3].pData = NULL; 00490 tupleData[3].cbData = 0; 00491 lbmEntry.setEntryTuple(tupleData); 00492 for (int i = 0; i < numRids - 2; i++) { 00493 rid += 16; 00494 bool rc = lbmEntry.setRID(LcsRid(rid)); 00495 BOOST_REQUIRE(rc); 00496 rids.push_back(rid); 00497 } 00498 tupleData = lbmEntry.produceEntryTuple(); 00499 tupleAccessor.marshal(tupleData, buffer.get() + bufferSize); 00500 bufferSize += tupleAccessor.getCurrentByteCount(); 00501 00502
00503 rid = 10000; 00504 rids.push_back(rid); 00505 tupleData[1].pData = (PConstBuffer) &rid; 00506 tupleData[2].pData = NULL; 00507 tupleData[2].cbData = 0; 00508 tupleData[3].pData = NULL; 00509 tupleData[3].cbData = 0; 00510 lbmEntry.setEntryTuple(tupleData); 00511 tupleData = lbmEntry.produceEntryTuple(); 00512 tupleAccessor.marshal(tupleData, buffer.get() + bufferSize); 00513 bufferSize += tupleAccessor.getCurrentByteCount(); 00514 00515
00516
00517
00518 rid = 16984; 00519 rids.push_back(rid); 00520 tupleData[1].pData = (PConstBuffer) &rid; 00521 tupleData[2].pData = NULL; 00522 tupleData[2].cbData = 0; 00523 tupleData[3].pData = NULL; 00524 tupleData[3].cbData = 0; 00525 lbmEntry.setEntryTuple(tupleData); 00526 for (int i = 0; i < numRids - 1; i++) { 00527 rid += 16; 00528 bool rc = lbmEntry.setRID(LcsRid(rid)); 00529 BOOST_REQUIRE(rc); 00530 rids.push_back(rid); 00531 } 00532 rid += 8; 00533 bool rc = lbmEntry.setRID(LcsRid(rid)); 00534 rids.push_back(rid); 00535 tupleData = lbmEntry.produceEntryTuple(); 00536 tupleAccessor.marshal(tupleData, buffer.get() + bufferSize); 00537 bufferSize += tupleAccessor.getCurrentByteCount(); 00538 00539
00540
00541
00542
00543 spliceInput( 00544 buffer, 00545 bufferSize, 00546 rids.size(), 00547 bTreeDesc); 00548 resetExecStreamTest(); 00549 00550
00551
00552
00553 BTreeReader reader(bTreeDesc); 00554 rc = reader.searchFirst(); 00555 BOOST_REQUIRE(rc); 00556 uint currIdx = 0; 00557 uint numEntries = 0; 00558 while (rc) { 00559 numEntries++; 00560 reader.getTupleAccessorForRead().unmarshal(tupleData); 00561 std::vector ridsRead; 00562 LbmEntry::generateRIDs(tupleData, ridsRead); 00563 for (uint i = 0; i < ridsRead.size(); i++) { 00564 BOOST_CHECK_EQUAL( 00565 opaqueToInt(ridsRead[i]), 00566 opaqueToInt(rids[currIdx])); 00567 currIdx++; 00568 } 00569 rc = reader.searchNext(); 00570 } 00571 BOOST_CHECK_EQUAL(currIdx, rids.size()); 00572 BOOST_REQUIRE(numEntries == 3); 00573 }

| void LbmSplicerExecStreamTest::testLER6473 | ( | | ) | | ------------------------------------------ | - | | - |

Definition at line 575 of file LbmSplicerExecStreamTest.cpp.

References TupleData::compute(), TupleAccessor::compute(), createBTree(), FixedBuffer, LbmEntry::generateRIDs(), TupleAccessor::getCurrentByteCount(), BTreeReader::getTupleAccessorForRead(), LbmEntry::init(), initBTreeTupleDesc(), TupleAccessor::marshal(), opaqueToInt(), LbmEntry::produceEntryTuple(), ExecStreamUnitTestBase::resetExecStreamTest(), BTreeReader::searchFirst(), BTreeReader::searchNext(), LbmEntry::setEntryTuple(), LbmEntry::setRID(), spliceInput(), BTreeDescriptor::tupleDescriptor, and TupleAccessor::unmarshal().

Referenced by LbmSplicerExecStreamTest().

00576 { 00577 TupleDescriptor tupleDesc; 00578 initBTreeTupleDesc(tupleDesc, 1); 00579 00580
00581 BTreeDescriptor bTreeDesc; 00582 createBTree(bTreeDesc, 1); 00583 00584 TupleAccessor tupleAccessor; 00585 tupleAccessor.compute(tupleDesc); 00586 00587
00588 uint64_t keyVal = 1; 00589 TupleData tupleData; 00590 tupleData.compute(bTreeDesc.tupleDescriptor); 00591 tupleData[0].pData = (PConstBuffer) &keyVal; 00592 00593 LbmEntry lbmEntry; 00594 boost::scoped_array entryBuf; 00595 uint entryBufSize = tupleDesc[2].cbStorage + 8 + 8; 00596 entryBuf.reset(new FixedBuffer[entryBufSize]); 00597 lbmEntry.init(entryBuf.get(), NULL, entryBufSize, tupleDesc); 00598 00599 std::vector rids; 00600 00601
00602 uint64_t rid = 0; 00603 tupleData[1].pData = (PConstBuffer) &rid; 00604 tupleData[2].pData = NULL; 00605 tupleData[2].cbData = 0; 00606 tupleData[3].pData = NULL; 00607 tupleData[3].cbData = 0; 00608 lbmEntry.setEntryTuple(tupleData); 00609 for (;; rid += 16) { 00610 bool rc = lbmEntry.setRID(LcsRid(rid)); 00611 if (!rc) { 00612 break; 00613 } 00614 rids.push_back(rid); 00615 } 00616 tupleData = lbmEntry.produceEntryTuple(); 00617 00618 boost::shared_array buffer; 00619 buffer.reset(new FixedBuffer[1024]); 00620 uint bufferSize = 0; 00621 tupleAccessor.marshal(tupleData, buffer.get() + bufferSize); 00622 bufferSize += tupleAccessor.getCurrentByteCount(); 00623 00624
00625 rid += 64 + 1; 00626 rids.push_back(rid); 00627 tupleData[1].pData = (PConstBuffer) &rid; 00628 tupleData[2].pData = NULL; 00629 tupleData[2].cbData = 0; 00630 tupleData[3].pData = NULL; 00631 tupleData[3].cbData = 0; 00632 lbmEntry.setEntryTuple(tupleData); 00633 tupleData = lbmEntry.produceEntryTuple(); 00634 tupleAccessor.marshal(tupleData, buffer.get() + bufferSize); 00635 bufferSize += tupleAccessor.getCurrentByteCount(); 00636 00637
00638 spliceInput( 00639 buffer, 00640 bufferSize, 00641 rids.size(), 00642 bTreeDesc); 00643 resetExecStreamTest(); 00644 00645
00646 rid += 1; 00647 rids.push_back(rid); 00648 tupleData[1].pData = (PConstBuffer) &rid; 00649 tupleData[2].pData = NULL; 00650 tupleData[2].cbData = 0; 00651 tupleData[3].pData = NULL; 00652 tupleData[3].cbData = 0; 00653 lbmEntry.setEntryTuple(tupleData); 00654 for (uint i = 0; i < 5; i++) { 00655 rid += 8; 00656 rids.push_back(rid); 00657 bool rc = lbmEntry.setRID(LcsRid(rid)); 00658 BOOST_REQUIRE(rc); 00659 } 00660 tupleData = lbmEntry.produceEntryTuple(); 00661 bufferSize = 0; 00662 tupleAccessor.marshal(tupleData, buffer.get() + bufferSize); 00663 bufferSize += tupleAccessor.getCurrentByteCount(); 00664 00665
00666 spliceInput( 00667 buffer, 00668 bufferSize, 00669 5, 00670 bTreeDesc); 00671 00672
00673
00674 BTreeReader reader(bTreeDesc); 00675 bool rc = reader.searchFirst(); 00676 BOOST_REQUIRE(rc); 00677 uint currIdx = 0; 00678 while (rc) { 00679 reader.getTupleAccessorForRead().unmarshal(tupleData); 00680 std::vector ridsRead; 00681 LbmEntry::generateRIDs(tupleData, ridsRead); 00682 for (uint i = 0; i < ridsRead.size(); i++) { 00683 BOOST_CHECK_EQUAL( 00684 opaqueToInt(ridsRead[i]), 00685 opaqueToInt(rids[currIdx])); 00686 currIdx++; 00687 } 00688 rc = reader.searchNext(); 00689 } 00690 BOOST_CHECK_EQUAL(currIdx, rids.size()); 00691 }

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 LcsClusterReplaceExecStreamTest::loadCluster(), LcsRowScanExecStreamTest::loadOneCluster(), ExecStreamUnitTestBase::prepareSourceGraph(), LcsClusterReplaceExecStreamTest::replaceCluster(), LcsMultiClusterAppendTest::scanCols(), 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 LcsClusterReplaceExecStreamTest::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 LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), LcsClusterReplaceExecStreamTest::replaceCluster(), LcsMultiClusterAppendTest::scanCols(), 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 LcsClusterReplaceExecStreamTest::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(), LcsClusterReplaceExecStreamTest::testClusterReplace(), LcsRowScanExecStreamTest::testCompressedFiltering(), testLER5968(), 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(), testSpliceRids(), testSpliceWithKeys(), and LcsRowScanExecStreamTest::testSystemSampling().

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

| void ExecStreamTestBase::testCaseTearDown | ( | | ) | [virtual, inherited] | | ----------------------------------------- | - | | - | ---------------------- |

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

Default is no-op.

Reimplemented from CacheTestBase.

Reimplemented in LbmLoadBitmapTest, LbmSearchTest, LcsClusterAppendExecStreamTest, LcsClusterReplaceExecStreamTest, LcsMultiClusterAppendTest, and LcsRowScanExecStreamTest.

Definition at line 82 of file ExecStreamTestBase.cpp.

References ExecStreamTestBase::pCacheAccessor, ExecStreamTestBase::pResourceGovernor, ExecStreamTestBase::pScheduler, ExecStreamTestBase::tearDownExecStreamTest(), and CacheTestBase::testCaseTearDown().

Referenced by LcsRowScanExecStreamTest::testCaseTearDown(), LcsMultiClusterAppendTest::testCaseTearDown(), LcsClusterReplaceExecStreamTest::testCaseTearDown(), LcsClusterAppendExecStreamTest::testCaseTearDown(), LbmSearchTest::testCaseTearDown(), and LbmLoadBitmapTest::testCaseTearDown().

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]

| void SegStorageTestBase::openRandomSegment | ( | | ) | [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]

Member Data Documentation

Definition at line 46 of file ExecStreamUnitTestBase.h.

Referenced by ExecStreamUnitTestBase::prepareConfluenceGraph(), ExecStreamUnitTestBase::prepareConfluenceTransformGraph(), ExecStreamUnitTestBase::prepareDAG(), ExecStreamUnitTestBase::prepareTransformGraph(), ExecStreamUnitTestBase::resetExecStreamTest(), 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(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), SegStorageTestBase::openRandomSegment(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), BackupRestoreTest::restore(), SegStorageTestBase::SegStorageTestBase(), spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), LhxHashTableTest::testCaseSetUp(), LcsClusterReplaceExecStreamTest::testClusterReplace(), LhxAggExecStreamTest::testCountImpl(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamGovernorTest::testGovernor(), LhxAggExecStreamTest::testGroupCountImpl(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), BTreeTest::testInserts(), LbmIntersectExecStreamTest::testIntersect(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), LbmEntryTest::testMergeEntry(), BTreeTest::testMultiKeySearches(), BTreeTest::testScan(), ExecStreamTestSuite::testScratchBufferExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), FlatFileExecStreamTest::testStream(), LhxAggExecStreamTest::testSumImpl(), LogicalTxnTest::testTxn(), SnapshotSegmentTest::testUncommittedReads(), LbmUnionExecStreamTest::testUnion(), SegStreamTest::testWriteSpillAndRead(), and LbmEntryTest::testZeroBytes().

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

Cache instance being tested.

Definition at line 63 of file CacheTestBase.h.

Referenced by BackupRestoreTest::backup(), CacheTestBase::closeDevice(), CacheTestBase::closeStorage(), createBTree(), SegStorageTestBase::createLinearDeviceSegment(), LogicalTxnTest::createRecoveryLog(), BackupRestoreTest::createSnapshotData(), BackupRestoreTest::executeSnapshotTxn(), CacheTestBase::getCache(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LbmSearchTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegmentTestBase::lockPage(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), CacheTestBase::openDevice(), CacheTestBase::openStorage(), LcsClusterReplaceExecStreamTest::replaceCluster(), BackupRestoreTest::restore(), 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().


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


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