Fennel: LhxHashTableTest Class Reference (original) (raw)
Testcase for inserting into hash table. More...
Inheritance diagram for LhxHashTableTest:

| Public Member Functions | |
|---|---|
| LhxHashTableTest () | |
| 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. | |
| void | testInsert1Ka () |
| void | testInsert1Kb () |
| 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 | snooze (uint nSeconds) |
| Protected Attributes | |
| SharedSegmentFactory | pSegmentFactory |
| SharedSegment | pLinearSegment |
| Segment supporting linear page allocation. | |
| SharedSegment | pRandomSegment |
| (Optional) segment supporting random page allocation. | |
| SharedSegment | pVersionedRandomSegment |
| (Optional) segment supporting versioned random page allocation. | |
| SharedSegment | pSnapshotRandomSegment |
| (Optional) segment supporting snapshot random page allocation. | |
| VictimPolicy | victimPolicy |
| VictimPolicy to instantiate. | |
| CacheParams | cacheParams |
| Parameters for cache initialization. | |
| SharedCache | pCache |
| Cache instance being tested. | |
| SharedRandomAccessDevice | pRandomAccessDevice |
| The default cached device. | |
| uint | nMemPages |
| Size of cache in memory pages. | |
| uint | nDiskPages |
| Size of device in disk pages. | |
| uint | cbPageFull |
| Disk page size. | |
| DeviceId | dataDeviceId |
| Fixed ID to assign to data device. | |
| 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 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 | |
| uint | writeHashTable (LhxHashInfo const &hashInfo, LhxHashTable &hashTable, SharedLhxPartition destPartition) |
| uint | readPartition (LhxHashInfo &hashInfo, SharedLhxPartition srcPartition, ostringstream &dataTrace) |
| void | testInsert (uint numRows, uint maxBlockCount, uint partitionLevel, VectorOfUint &repeatSeqValues, uint numKeyCols, uint numAggs, uint numDataCols, bool dumpHashTable, bool writeToPartition, uint recursivePartitioning, string testName) |
| Private Attributes | |
| StandardTypeDescriptorFactory | stdTypeFactory |
| LhxHashInfo | hashInfo |
| uint | buildInputIndex |
Detailed Description
Testcase for inserting into hash table.
Definition at line 41 of file LhxHashTableTest.cpp.
Member Enumeration Documentation
The available victim policy implementations.
Enumerator:
| victimTwoQ | | | -------------- | | | victimLRU | | | victimRandom | |
Definition at line 44 of file CacheTestBase.h.
Constructor & Destructor Documentation
| LhxHashTableTest::LhxHashTableTest | ( | | ) | [inline, explicit] | | ---------------------------------- | - | | - | -------------------- |
Member Function Documentation
Definition at line 137 of file LhxHashTableTest.cpp.
References LhxPartitionReader::close(), TupleData::compute(), LhxPartitionReader::consumeTuple(), LhxPartitionReader::demandData(), EXECBUF_EOS, LhxPartitionReader::getState(), hashInfo, LhxHashInfo::inputDesc, LhxPartitionReader::isTupleConsumptionPending(), LhxPartitionReader::open(), TuplePrinter::print(), and LhxPartitionReader::unmarshalTuple().
Referenced by testInsert().
| void LhxHashTableTest::testInsert | ( | uint | numRows, |
|---|---|---|---|
| uint | maxBlockCount, | ||
| uint | partitionLevel, | ||
| VectorOfUint & | repeatSeqValues, | ||
| uint | numKeyCols, | ||
| uint | numAggs, | ||
| uint | numDataCols, | ||
| bool | dumpHashTable, | ||
| bool | writeToPartition, | ||
| uint | recursivePartitioning, | ||
| string | testName | ||
| ) | [private] |
Definition at line 174 of file LhxHashTableTest.cpp.
References LhxHashTable::addTuple(), LhxHashInfo::aggsProj, LhxHashTable::allocateResources(), LhxHashTableReader::bindKey(), buildInputIndex, LhxHashTable::calculateNumSlots(), LhxHashInfo::cndKeys, TupleData::compute(), LhxPlan::createChildren(), LhxHashInfo::dataProj, LhxHashTableDump::dump(), LhxHashInfo::filterNull, LhxHashInfo::filterNullKeyProj, LhxHashTable::findKey(), LhxPlan::getFirstLeaf(), LhxHashTableReader::getNext(), LhxPlan::getNextLeaf(), LhxPlan::getPartition(), HASH_TRIM_NONE, hashInfo, LhxHashTableReader::init(), LhxHashTable::init(), LhxHashInfo::inputDesc, LhxHashInfo::isKeyColVarChar, LhxHashInfo::keyProj, LhxPlan::LhxChildPartCount, LhxHashInfo::memSegmentAccessor, StandardTypeDescriptorFactory::newDataType(), LhxHashInfo::numCachePages, LhxHashInfo::numRows, TuplePrinter::print(), SegmentAccessor::pSegment, readPartition(), LhxHashTable::releaseResources(), LhxHashInfo::removeDuplicate, STANDARD_TYPE_INT_32, stdTypeFactory, TRACE_INFO, LhxHashInfo::useJoinFilter, and writeHashTable().
Referenced by testInsert1Ka(), and testInsert1Kb().
00186 {
00187 LhxHashTable hashTable;
00188
00189 hashInfo.numCachePages = maxBlockCount;
00190
00191 TupleAttributeDescriptor attrDesc_int32 =
00192 TupleAttributeDescriptor(
00193 stdTypeFactory.newDataType(STANDARD_TYPE_INT_32));
00194 TupleData inputTuple;
00195
00196 uint i, j;
00197
00198
00199
00200
00201 uint numCols = numKeyCols + numAggs + numDataCols;
00202
00203 boost::scoped_array colValues(new uint[numCols]);
00204
00205 TupleDescriptor inputDesc;
00206 TupleProjection keyProj;
00207 TupleProjection dataProj;
00208 std::vector isKeyVarChar;
00209
00210 for (i = 0; i < numCols; i ++) {
00211 inputDesc.push_back(attrDesc_int32);
00212
00213 if (i < numKeyCols) {
00214 keyProj.push_back(i);
00215 isKeyVarChar.push_back(HASH_TRIM_NONE);
00216 } else if (i < numKeyCols + numAggs) {
00217 hashInfo.aggsProj.push_back(i);
00218 } else {
00219 dataProj.push_back(i);
00220 }
00221 }
00222
00223
00224
00225
00226
00227 uint cndKeys = 1;
00228 for (i = 0; i < numKeyCols; i ++) {
00229 cndKeys *= repeatSeqValues[i];
00230 }
00231
00232 uint numInputs = 2;
00233 buildInputIndex = numInputs - 1;
00234 for (i = 0; i < numInputs; i ++) {
00235 hashInfo.inputDesc.push_back(inputDesc);
00236 hashInfo.keyProj.push_back(keyProj);
00237 hashInfo.isKeyColVarChar.push_back(isKeyVarChar);
00238 hashInfo.dataProj.push_back(dataProj);
00239 hashInfo.useJoinFilter.push_back(false);
00240 hashInfo.filterNull.push_back(false);
00241
00242 TupleProjection filterNullKeyProj;
00243 hashInfo.filterNullKeyProj.push_back(filterNullKeyProj);
00244 hashInfo.removeDuplicate.push_back(false);
00245 hashInfo.numRows.push_back(numRows);
00246 hashInfo.cndKeys.push_back(cndKeys);
00247 }
00248
00249 TupleDescriptor &inputTupleDesc = hashInfo.inputDesc.back();
00250 TupleProjection &keyColsProj = hashInfo.keyProj.back();
00251
00252 hashTable.init(partitionLevel, hashInfo, buildInputIndex);
00253
00254 uint usablePageSize =
00255 (hashInfo.memSegmentAccessor.pSegment)->getUsablePageSize();
00256
00257 hashTable.calculateNumSlots(
00258 cndKeys, usablePageSize, hashInfo.numCachePages);
00259
00260 bool status = hashTable.allocateResources();
00261
00262 assert(status);
00263
00264 inputTuple.compute(inputTupleDesc);
00265
00266
00267
00268
00269 for (i = 0; i < numRows; i ++) {
00270 for (j = 0; j < numCols; j++) {
00271 colValues[j] = i % repeatSeqValues[j];
00272 inputTuple[j].pData = (PBuffer)&(colValues[j]);
00273 }
00274
00275 status =
00276 hashTable.addTuple(inputTuple);
00277
00278 assert(status);
00279 }
00280
00281 LhxHashTableReader hashTableReader;
00282 hashTableReader.init(&hashTable, hashInfo, buildInputIndex);
00283 TupleData outputTuple;
00284
00285 outputTuple.compute(inputTupleDesc);
00286
00287 TuplePrinter tuplePrinter;
00288 ostringstream dataTrace;
00289 dataTrace << "All Inserted Tuples:\n";
00290 uint numTuples = 0;
00291
00292
00293
00294
00295 while (hashTableReader.getNext(outputTuple)) {
00296 tuplePrinter.print(dataTrace, inputTupleDesc, outputTuple);
00297 dataTrace << "\n";
00298 numTuples ++;
00299 }
00300 assert (numTuples == numRows);
00301
00302
00303
00304
00305 dataTrace << "All Matched Tuples:\n";
00306 numTuples = 0;
00307
00308
00309
00310
00311
00312
00313 for (i = 0; i < numRows; i ++) {
00314 for (j = 0; j < numCols; j++) {
00315 colValues[j] = i % repeatSeqValues[j];
00316 inputTuple[j].pData = (PBuffer)&(colValues[j]);
00317 }
00318
00319 PBuffer matchingKey =
00320 hashTable.findKey(inputTuple, keyColsProj, true);
00321
00322 if (matchingKey) {
00323 hashTableReader.bindKey(matchingKey);
00324 while (hashTableReader.getNext(outputTuple)) {
00325 tuplePrinter.print(dataTrace, inputTupleDesc, outputTuple);
00326 dataTrace << "\n";
00327 numTuples ++;
00328 }
00329 }
00330 }
00331
00332 assert (numTuples == numRows);
00333
00334 if (dumpHashTable) {
00335 LhxHashTableDump hashTableDump(
00336 TRACE_INFO,
00337 shared_from_this(),
00338 "LhxHashTableTest");
00339 hashTableDump.dump(hashTable);
00340 hashTableDump.dump(dataTrace.str());
00341 }
00342
00343 if (writeToPartition) {
00344 SharedLhxPartition partition =
00345 SharedLhxPartition(new LhxPartition(NULL));
00346 partition->inputIndex = 1;
00347
00348
00349 uint tuplesWritten =
00350 writeHashTable(
00351 (LhxHashInfo const &)hashInfo,
00352 hashTable,
00353 partition);
00354
00355
00356 ostringstream dataTrace;
00357
00358 dataTrace << "[Tuples read from partitions-1]\n";
00359
00360 uint tuplesRead =
00361 readPartition(hashInfo, partition, dataTrace);
00362
00363 if (dumpHashTable) {
00364 LhxHashTableDump hashTableDump(
00365 TRACE_INFO,
00366 shared_from_this(),
00367 "LhxHashTableTest");
00368 hashTableDump.dump(dataTrace.str());
00369 }
00370
00371 assert (tuplesWritten == numRows && tuplesRead == tuplesWritten);
00372 }
00373
00374 if (recursivePartitioning > 0) {
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 std::vector partitions;
00385 uint tuplesWritten[2];
00386
00387
00388 for (int j = 0; j < 2; j ++) {
00389 partitions.push_back(
00390 SharedLhxPartition(new LhxPartition(NULL)));
00391 partitions[j]->inputIndex = 1;
00392 tuplesWritten[j] =
00393 writeHashTable(
00394 (LhxHashInfo const &)hashInfo,
00395 hashTable,
00396 partitions[j]);
00397 }
00398
00399 assert (tuplesWritten[0] == numRows &&
00400 tuplesWritten[0] == tuplesWritten[1]);
00401
00402 uint tuplesRead[2];
00403 SharedLhxPlan plan = SharedLhxPlan(new LhxPlan());
00404
00405 plan->init(WeakLhxPlan(), 0, partitions, false);
00406
00407 LhxPlan *leafPlan;
00408 uint numLeafPlanCreated = 1;
00409 uint numLeafPlanRead = 0;
00410
00411 for (int i = 0; i < recursivePartitioning; i ++) {
00412 numLeafPlanCreated *= LhxPlan::LhxChildPartCount;
00413 numLeafPlanRead = 0;
00414 leafPlan = plan->getFirstLeaf();
00415
00416
00417 while (leafPlan) {
00418 leafPlan->createChildren(hashInfo, false);
00419
00420
00421 leafPlan = leafPlan->getFirstLeaf();
00422 for (int k = 0; k < LhxPlan::LhxChildPartCount; k ++) {
00423 leafPlan = leafPlan->getNextLeaf();
00424 }
00425 }
00426 }
00427
00428
00429
00430
00431
00432 tuplesRead[0] = 0;
00433 tuplesRead[1] = 0;
00434
00435
00436 leafPlan = plan->getFirstLeaf();
00437
00438 while (leafPlan) {
00439 numLeafPlanRead ++;
00440 for (int j = 0; j < 2; j ++) {
00441 ostringstream dataTrace;
00442 dataTrace << "[Tuples read from partitions-2]"
00443 << "recursion depth" << recursivePartitioning
00444 << "inputindex " << j << "\n";
00445 tuplesRead[j] +=
00446 readPartition(
00447 hashInfo,
00448 leafPlan->getPartition(j),
00449 dataTrace);
00450 if (dumpHashTable) {
00451 LhxHashTableDump hashTableDump(
00452 TRACE_INFO,
00453 shared_from_this(),
00454 "LhxHashTableTest");
00455 hashTableDump.dump(dataTrace.str());
00456 }
00457 }
00458 leafPlan = leafPlan->getNextLeaf();
00459 }
00460
00461 assert (numLeafPlanRead == numLeafPlanCreated);
00462 assert ((tuplesRead[0] == tuplesRead[1]) &&
00463 (tuplesRead[0] == numRows));
00464 }
00465
00466 hashTable.releaseResources();
00467 colValues.reset();
00468 }
| void LhxHashTableTest::testCaseSetUp | ( | | ) | [virtual] | | ------------------------------------ | - | | - | ----------- |
Equivalent to JUnit TestCase.setUp; this is called before each test case method is invoked.
Default is no-op.
Reimplemented from TestBase.
Definition at line 84 of file LhxHashTableTest.cpp.
References DeviceMode::createNew, LhxHashInfo::externalSegmentAccessor, hashInfo, LhxHashInfo::memSegmentAccessor, SegStorageTestBase::openRandomSegment(), SegStorageTestBase::openStorage(), CacheTestBase::pCache, SegmentAccessor::pCacheAccessor, SegStorageTestBase::pRandomSegment, SegmentAccessor::pSegment, and SegStorageTestBase::pSegmentFactory.
| void LhxHashTableTest::testCaseTearDown | ( | | ) | [virtual] | | --------------------------------------- | - | | - | ----------- |
Equivalent to JUnit TestCase.tearDown; this is called after each test case method is invoked.
Default is no-op.
Reimplemented from CacheTestBase.
Definition at line 94 of file LhxHashTableTest.cpp.
References LhxHashInfo::aggsProj, LhxHashInfo::dataProj, LhxHashInfo::externalSegmentAccessor, hashInfo, LhxHashInfo::inputDesc, LhxHashInfo::isKeyColVarChar, LhxHashInfo::keyProj, LhxHashInfo::memSegmentAccessor, NULL_PAGE_ID, SegmentAccessor::pSegment, SegmentAccessor::reset(), and CacheTestBase::testCaseTearDown().
| void LhxHashTableTest::testInsert1Ka | ( | | ) | | ------------------------------------ | - | | - |
Definition at line 470 of file LhxHashTableTest.cpp.
References testInsert(), and TestBase::testName.
Referenced by LhxHashTableTest().
00471 {
00472 uint numRows = 100;
00473 uint maxBlockCount = 10;
00474 uint partitionLevel = 0;
00475 VectorOfUint values;
00476 uint numKeyCols = 1;
00477 uint numAggs = 0;
00478 uint numDataCols = 0;
00479 bool dumpHashTable = true;
00480 bool writeToPartition = true;
00481 uint recursivePartitioning = 3;
00482 string testName = "testInsert1K";
00483 uint i;
00484
00485 for (i = 0; i < numKeyCols; i ++) {
00486
00487
00488
00489 values.push_back(i + 10);
00490 }
00491
00492 for (i = 0; i < numAggs; i ++) {
00493 values.push_back(10);
00494 }
00495
00496 for (i = 0; i < numDataCols; i ++) {
00497 values.push_back(i + 1);
00498 }
00499
00500 testInsert(
00501 numRows, maxBlockCount, partitionLevel,
00502 values, numKeyCols, numAggs, numDataCols,
00503 dumpHashTable, writeToPartition, recursivePartitioning,
00504 testName);
00505 }
| void LhxHashTableTest::testInsert1Kb | ( | | ) | | ------------------------------------ | - | | - |
Definition at line 507 of file LhxHashTableTest.cpp.
References testInsert(), and TestBase::testName.
Referenced by LhxHashTableTest().
00508 {
00509 uint numRows = 1000;
00510 uint maxBlockCount = 10;
00511 uint partitionLevel = 0;
00512 VectorOfUint values;
00513 uint numKeyCols = 2;
00514 uint numAggs = 0;
00515 uint numDataCols = 4;
00516 bool dumpHashTable = true;
00517 bool writeToPartition = true;
00518 uint recursivePartitioning = 3;
00519 string testName = "testInsert1K";
00520 uint i;
00521
00522 for (i = 0; i < numKeyCols; i ++) {
00523
00524
00525
00526 values.push_back(i + 10);
00527 }
00528
00529 for (i = 0; i < numAggs; i ++) {
00530 values.push_back(10);
00531 }
00532
00533 for (i = 0; i < numDataCols; i ++) {
00534 values.push_back(i + 1);
00535 }
00536
00537 testInsert(
00538 numRows, maxBlockCount, partitionLevel,
00539 values, numKeyCols, numAggs, numDataCols,
00540 dumpHashTable, writeToPartition, recursivePartitioning,
00541 testName);
00542 }
| 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(), 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 (.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 40 of file SegStorageTestBase.h.
Referenced by BackupRestoreTest::backup(), SegStorageTestBase::createLinearDeviceSegment(), LogicalTxnTest::createRecoveryLog(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), SegStorageTestBase::openRandomSegment(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), BackupRestoreTest::restore(), SegStorageTestBase::SegStorageTestBase(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), 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(), LbmSplicerExecStreamTest::createBTree(), LbmSplicerExecStreamTest::initBTreeParam(), LbmSearchTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeTupleDesc(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegStorageTestBase::openRandomSegment(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), SegmentTestBase::openStorage(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), ExecStreamTestSuite::testBTreeInsertExecStream(), BTreeTest::testBulkLoad(), 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(), LbmSplicerExecStreamTest::createBTree(), SegStorageTestBase::createLinearDeviceSegment(), LogicalTxnTest::createRecoveryLog(), BackupRestoreTest::createSnapshotData(), BackupRestoreTest::executeSnapshotTxn(), CacheTestBase::getCache(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LbmSearchTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegmentTestBase::lockPage(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), CacheTestBase::openDevice(), CacheTestBase::openStorage(), LcsClusterReplaceExecStreamTest::replaceCluster(), BackupRestoreTest::restore(), LbmSplicerExecStreamTest::spliceInput(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), BackupRestoreTest::testBackupCleanup(), ExecStreamTestSuite::testBTreeInsertExecStream(), BTreeTest::testBulkLoad(), 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:
- /home/pub/open/dev/fennel/test/LhxHashTableTest.cpp
