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 |
Definition at line 41 of file LhxHashTableTest.cpp.
enum CacheTestBase::VictimPolicy [protected, inherited] |
The available victim policy implementations.
Definition at line 44 of file CacheTestBase.h.
00044 { 00045 victimTwoQ, 00046 victimLRU, 00047 victimRandom 00048 };
LhxHashTableTest::LhxHashTableTest | ( | ) | [inline, explicit] |
Definition at line 71 of file LhxHashTableTest.cpp.
References testInsert1Ka(), and testInsert1Kb().
00072 { 00073 FENNEL_UNIT_TEST_CASE(LhxHashTableTest, testInsert1Ka); 00074 FENNEL_UNIT_TEST_CASE(LhxHashTableTest, testInsert1Kb); 00075 }
uint LhxHashTableTest::writeHashTable | ( | LhxHashInfo const & | hashInfo, | |
LhxHashTable & | hashTable, | |||
SharedLhxPartition | destPartition | |||
) | [private] |
Definition at line 111 of file LhxHashTableTest.cpp.
References LhxHashTableReader::bindKey(), buildInputIndex, LhxPartitionWriter::close(), TupleData::compute(), LhxHashTableReader::getNext(), hashInfo, LhxHashTableReader::init(), LhxHashInfo::inputDesc, LhxPartitionWriter::marshalTuple(), and LhxPartitionWriter::open().
Referenced by testInsert().
00115 { 00116 uint tuplesWritten = 0; 00117 LhxPartitionWriter writer; 00118 00119 LhxHashTableReader hashTableReader; 00120 hashTableReader.init(&hashTable, hashInfo, buildInputIndex); 00121 hashTableReader.bindKey(NULL); 00122 TupleData outputTuple; 00123 00124 outputTuple.compute(hashInfo.inputDesc[destPartition->inputIndex]); 00125 00126 //write to a paritition 00127 writer.open(destPartition, (LhxHashInfo const &)hashInfo); 00128 while (hashTableReader.getNext(outputTuple)) { 00129 writer.marshalTuple(outputTuple); 00130 tuplesWritten ++; 00131 } 00132 writer.close(); 00133 00134 return tuplesWritten; 00135 }
uint LhxHashTableTest::readPartition | ( | LhxHashInfo & | hashInfo, | |
SharedLhxPartition | srcPartition, | |||
ostringstream & | dataTrace | |||
) | [private] |
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().
00141 { 00142 LhxPartitionReader reader; 00143 uint tuplesRead = 0; 00144 TupleData outputTuple; 00145 TuplePrinter tuplePrinter; 00146 TupleDescriptor &inputTupleDesc = hashInfo.inputDesc[1]; 00147 00148 outputTuple.compute(hashInfo.inputDesc[srcPartition->inputIndex]); 00149 00150 reader.open(srcPartition, (LhxHashInfo const &)hashInfo); 00151 00152 for (;;) { 00153 if (!reader.isTupleConsumptionPending()) { 00154 if (reader.getState() == EXECBUF_EOS) { 00155 break; 00156 } 00157 if (!reader.demandData()) { 00158 break; 00159 } 00160 reader.unmarshalTuple(outputTuple); 00161 00162 tuplePrinter.print(dataTrace, inputTupleDesc, outputTuple); 00163 dataTrace << "\n"; 00164 00165 tuplesRead ++; 00166 } 00167 00168 reader.consumeTuple(); 00169 } 00170 reader.close(); 00171 return tuplesRead; 00172 }
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 * Setup hash table. 00200 */ 00201 uint numCols = numKeyCols + numAggs + numDataCols; 00202 00203 boost::scoped_array<uint> colValues(new uint[numCols]); 00204 00205 TupleDescriptor inputDesc; 00206 TupleProjection keyProj; 00207 TupleProjection dataProj; 00208 std::vector<LhxHashTrim> 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 * Calculate key cardinality, assuming there's no correlation between key 00225 * cols. 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 // empty projection : do not filter nulls 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 * Insert some tuples. 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 * verify that the hash table reader can see all the tuples. 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 * Verify that the keys are inserted. 00304 */ 00305 dataTrace << "All Matched Tuples:\n"; 00306 numTuples = 0; 00307 /* 00308 * verify that the hash table reader can see all the unmatched tuples. 00309 * The above search is done in probing mode, so matched keys are 00310 * marked as such. The whole table should be returned when reading 00311 * matched rows. 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 //write to a paritition 00349 uint tuplesWritten = 00350 writeHashTable( 00351 (LhxHashInfo const &)hashInfo, 00352 hashTable, 00353 partition); 00354 00355 //read from the same paritition 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 // verify read/write row count match. 00371 assert (tuplesWritten == numRows && tuplesRead == tuplesWritten); 00372 } 00373 00374 if (recursivePartitioning > 0) { 00375 // Using the same data set(the one from the hash table( for both inputs 00376 // partition all leaf nodes till the tree reaches 00377 // "recursivePartitioning", partition level starts from level 0 which is 00378 // a single partition. For each level, read all the data from the leaf 00379 // partitions and make sure the rwo count remain the same as the rows 00380 // initially written into the single partition. 00381 00382 // First set up the plan at level 0 which conprises of a single 00383 // partition, one from each side. 00384 std::vector<SharedLhxPartition> partitions; 00385 uint tuplesWritten[2]; 00386 00387 // for both input sides. 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 //create leaf plans for the next level 00417 while (leafPlan) { 00418 leafPlan->createChildren(hashInfo, false); 00419 //skip the next numChildPart leaves as they are newly 00420 //created children 00421 leafPlan = leafPlan->getFirstLeaf(); 00422 for (int k = 0; k < LhxPlan::LhxChildPartCount; k ++) { 00423 leafPlan = leafPlan->getNextLeaf(); 00424 } 00425 } 00426 } 00427 00428 // each partition can be read exactly once(since SegStreamAllocation 00429 // deletes the disk content) 00430 // so only verify the leaf level partitions. 00431 00432 tuplesRead[0] = 0; 00433 tuplesRead[1] = 0; 00434 00435 // get the first leaf 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.
00085 { 00086 openStorage(DeviceMode::createNew); 00087 openRandomSegment(); 00088 hashInfo.externalSegmentAccessor.pSegment = pRandomSegment; 00089 hashInfo.externalSegmentAccessor.pCacheAccessor = pCache; 00090 hashInfo.memSegmentAccessor = 00091 pSegmentFactory->newScratchSegment(pCache, 100); 00092 }
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().
00095 { 00096 hashInfo.inputDesc.clear(); 00097 hashInfo.keyProj.clear(); 00098 hashInfo.isKeyColVarChar.clear(); 00099 00100 hashInfo.aggsProj.clear(); 00101 hashInfo.dataProj.clear(); 00102 00103 hashInfo.memSegmentAccessor.pSegment->deallocatePageRange( 00104 NULL_PAGE_ID, 00105 NULL_PAGE_ID); 00106 hashInfo.externalSegmentAccessor.reset(); 00107 hashInfo.memSegmentAccessor.reset(); 00108 SegStorageTestBase::testCaseTearDown(); 00109 }
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 * At least one value, hence + 1. 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 * At least one value, hence + 1. 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().
00032 { 00033 CacheTestBase::openStorage(openMode); 00034 openSegmentStorage(openMode); 00035 }
void SegStorageTestBase::openSegmentStorage | ( | DeviceMode | openMode | ) | [virtual, inherited] |
Reimplemented in LinearViewSegmentTest, SnapshotSegmentTestBase, and VersionedSegmentTest.
Definition at line 37 of file SegStorageTestBase.cpp.
References CacheTestBase::cbPageFull, DeviceMode::create, SegStorageTestBase::createLinearDeviceSegment(), CacheTestBase::dataDeviceId, SegStorageTestBase::pLinearSegment, and CacheTestBase::pRandomAccessDevice.
Referenced by VersionedSegmentTest::openSegmentStorage(), and SegStorageTestBase::openStorage().
00038 { 00039 pLinearSegment = createLinearDeviceSegment( 00040 dataDeviceId, 00041 openMode.create ? 0 00042 : pRandomAccessDevice->getSizeInBytes() / cbPageFull); 00043 }
void SegStorageTestBase::openRandomSegment | ( | ) | [virtual, inherited] |
Reimplemented in LcsClusterReplaceExecStreamTest.
Definition at line 45 of file SegStorageTestBase.cpp.
References SegStorageTestBase::closeStorage(), DeviceMode::load, SegStorageTestBase::openStorage(), SegStorageTestBase::pLinearSegment, SegStorageTestBase::pRandomSegment, and SegStorageTestBase::pSegmentFactory.
Referenced by RandomAllocationSegmentTest::testAllocateAndDeallocate(), testCaseSetUp(), ExecStreamUnitTestBase::testCaseSetUp(), BTreeTest::testCaseSetUp(), and BTreeReadersTest::testCaseSetUp().
00046 { 00047 // reopen will interpret pages as already allocated, which 00048 // is what RandomAllocationSegment expects 00049 closeStorage(); 00050 openStorage(DeviceMode::load); 00051 pRandomSegment = pSegmentFactory->newRandomAllocationSegment( 00052 pLinearSegment, true); 00053 pLinearSegment.reset(); 00054 }
SharedSegment SegStorageTestBase::createLinearDeviceSegment | ( | DeviceId | deviceId, | |
uint | nPages | |||
) | [inherited] |
Definition at line 56 of file SegStorageTestBase.cpp.
References LinearDeviceSegmentParams::firstBlockId, LinearDeviceSegmentParams::nPagesAllocated, LinearDeviceSegmentParams::nPagesMin, CacheTestBase::pCache, SegStorageTestBase::pSegmentFactory, CompoundId::setBlockNum(), and CompoundId::setDeviceId().
Referenced by VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), SegStorageTestBase::openSegmentStorage(), and LinearViewSegmentTest::openSegmentStorage().
00058 { 00059 BlockId blockId(0); 00060 CompoundId::setDeviceId(blockId,deviceId); 00061 CompoundId::setBlockNum(blockId,0); 00062 LinearDeviceSegmentParams deviceParams; 00063 deviceParams.firstBlockId = blockId; 00064 deviceParams.nPagesMin = nPages; 00065 deviceParams.nPagesAllocated = nPages; 00066 return pSegmentFactory->newLinearDeviceSegment( 00067 pCache,deviceParams); 00068 }
void SegStorageTestBase::closeLinearSegment | ( | ) | [inherited] |
Definition at line 70 of file SegStorageTestBase.cpp.
References SegStorageTestBase::pLinearSegment.
Referenced by VersionedSegmentTest::closeStorage(), SnapshotSegmentTestBase::closeStorage(), SegStorageTestBase::closeStorage(), and SnapshotSegmentTest::testUncommittedReads().
00071 { 00072 if (pLinearSegment) { 00073 assert(pLinearSegment.unique()); 00074 pLinearSegment.reset(); 00075 } 00076 }
void SegStorageTestBase::closeRandomSegment | ( | ) | [inherited] |
Definition at line 78 of file SegStorageTestBase.cpp.
References SegStorageTestBase::pRandomSegment.
Referenced by VersionedSegmentTest::closeStorage(), and SegStorageTestBase::closeStorage().
00079 { 00080 if (pRandomSegment) { 00081 assert(pRandomSegment.unique()); 00082 pRandomSegment.reset(); 00083 } 00084 }
void SegStorageTestBase::closeVersionedRandomSegment | ( | ) | [inherited] |
Definition at line 86 of file SegStorageTestBase.cpp.
References SegStorageTestBase::pVersionedRandomSegment.
Referenced by SnapshotSegmentTestBase::closeStorage(), and SegStorageTestBase::closeStorage().
00087 { 00088 if (pVersionedRandomSegment) { 00089 assert(pVersionedRandomSegment.unique()); 00090 pVersionedRandomSegment.reset(); 00091 } 00092 }
void SegStorageTestBase::closeSnapshotRandomSegment | ( | ) | [inherited] |
Definition at line 94 of file SegStorageTestBase.cpp.
References SegStorageTestBase::pSnapshotRandomSegment.
Referenced by SnapshotSegmentTestBase::closeStorage().
00095 { 00096 if (pSnapshotRandomSegment) { 00097 assert(pSnapshotRandomSegment.unique()); 00098 pSnapshotRandomSegment.reset(); 00099 } 00100 }
void SegStorageTestBase::closeStorage | ( | ) | [virtual, inherited] |
Reimplemented from CacheTestBase.
Reimplemented in SnapshotSegmentTestBase, and VersionedSegmentTest.
Definition at line 102 of file SegStorageTestBase.cpp.
References SegStorageTestBase::closeLinearSegment(), SegStorageTestBase::closeRandomSegment(), CacheTestBase::closeStorage(), and SegStorageTestBase::closeVersionedRandomSegment().
Referenced by VersionedSegmentTest::closeStorage(), SnapshotSegmentTestBase::closeStorage(), SegStorageTestBase::openRandomSegment(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), SegStreamTest::testMarkReset(), SegStreamTest::testReadSeg(), SegmentTestBase::testSingleThread(), SegStreamTest::testWriteSeg(), and SegStreamTest::testWriteSpillAndRead().
00103 { 00104 closeLinearSegment(); 00105 closeRandomSegment(); 00106 closeVersionedRandomSegment(); 00107 // TODO: assert pSegmentFactory.unique(), but not here 00108 CacheTestBase::closeStorage(); 00109 }
Cache & CacheTestBase::getCache | ( | ) | [inherited] |
Definition at line 42 of file CacheTestBase.cpp.
References CacheTestBase::pCache.
Referenced by CacheTest::lockPage(), CacheTest::prefetchBatch(), SegmentTestBase::prefetchPage(), CacheTest::prefetchPage(), PagingTestBase::testCacheResize(), PagingTestBase::testCheckpoint(), PagingTestBase::testOp(), PagingTestBase::testScratch(), SegmentTestBase::unlockPage(), and CacheTest::unlockPage().
00043 { 00044 return *pCache; 00045 }
SharedCache CacheTestBase::newCache | ( | ) | [virtual, inherited] |
Definition at line 66 of file CacheTestBase.cpp.
References CacheTestBase::cacheParams, Cache::newCache(), CacheTestBase::victimLRU, CacheTestBase::victimPolicy, CacheTestBase::victimRandom, and CacheTestBase::victimTwoQ.
Referenced by CacheTestBase::openStorage().
00067 { 00068 switch (victimPolicy) { 00069 case victimRandom: 00070 return SharedCache( 00071 new RandomCache(cacheParams), 00072 ClosableObjectDestructor()); 00073 case victimLRU: 00074 return SharedCache( 00075 new LRUCache(cacheParams), 00076 ClosableObjectDestructor()); 00077 case victimTwoQ: 00078 return Cache::newCache(cacheParams); 00079 default: 00080 permAssert(false); 00081 } 00082 }
SharedRandomAccessDevice CacheTestBase::openDevice | ( | std::string | devName, | |
DeviceMode | openMode, | |||
uint | nDevicePages, | |||
DeviceId | deviceId | |||
) | [inherited] |
Definition at line 84 of file CacheTestBase.cpp.
References CacheTestBase::cbPageFull, DeviceMode::create, CacheTestBase::pCache, and FileSystem::remove().
Referenced by VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), and CacheTestBase::openStorage().
00087 { 00088 if (openMode.create) { 00089 FileSystem::remove(devName.c_str()); 00090 } 00091 SharedRandomAccessDevice pDevice( 00092 new RandomAccessFileDevice(devName,openMode)); 00093 if (openMode.create) { 00094 pDevice->setSizeInBytes(nDevicePages*cbPageFull); 00095 } 00096 pCache->registerDevice(deviceId,pDevice); 00097 return pDevice; 00098 }
void CacheTestBase::closeDevice | ( | DeviceId | deviceId, | |
SharedRandomAccessDevice & | pDevice | |||
) | [inherited] |
Definition at line 130 of file CacheTestBase.cpp.
References CHECKPOINT_FLUSH_AND_UNMAP, and CacheTestBase::pCache.
Referenced by VersionedSegmentTest::closeStorage(), SnapshotSegmentTestBase::closeStorage(), and CacheTestBase::closeStorage().
00132 { 00133 if (!pDevice) { 00134 return; 00135 } 00136 DeviceIdPagePredicate pagePredicate(deviceId); 00137 pCache->checkpointPages(pagePredicate,CHECKPOINT_FLUSH_AND_UNMAP); 00138 pCache->unregisterDevice(deviceId); 00139 assert(pDevice.unique()); 00140 pDevice.reset(); 00141 }
void TestBase::snooze | ( | uint | nSeconds | ) | [protected, inherited] |
Definition at line 263 of file TestBase.cpp.
Referenced by DatabaseTest::executeForceTxn(), ThreadedTestBase::runThreadedTestCase(), PagingTestBase::testCacheResize(), BTreeTxnTest::testCheckpoint(), PagingTestBase::testCheckpointGuarded(), PagingTestBase::testPrefetch(), and PagingTestBase::testPrefetchBatch().
00264 { 00265 #ifdef __MSVC__ 00266 ::_sleep(nSeconds*1000); 00267 #else 00268 ::sleep(nSeconds); 00269 #endif 00270 }
void TestBase::readParams | ( | int | argc, | |
char ** | argv | |||
) | [static, inherited] |
Parses the command line.
format: [-v] [-t TEST | -all] {param=val}* [CONFIGFILE | -] Normally, the test program runs the default test cases. With the option "-all", runs the extra test cases as well. With the option "-t TEST", runs only the single test case named TEST. CONFIGFILE is read to load configuration parameters. Configuration parameters can also be set ad hoc, from the command line, as pairs name=val. These take precedence.
Definition at line 108 of file TestBase.cpp.
References TestBase::configMap, ConfigMap::dumpParams(), ConfigMap::isParamSet(), ConfigMap::mergeFrom(), TestBase::paramDictionaryFileName, ConfigMap::readParams(), TestBase::runAll, TestBase::runSingle, ConfigMap::setStringParam(), and verbose.
00109 { 00110 bool verbose = false; 00111 ConfigMap adhocMap; 00112 00113 for (int i = 1; i < argc; ++i) { 00114 std::string arg = argv[i]; 00115 if (argv[i][0] == '-') { 00116 if (arg == "-v") { 00117 verbose = true; 00118 } else if (arg == "-") { 00119 configMap.readParams(std::cin); 00120 } else if (arg == "-all") { 00121 runAll = true; 00122 } else if (arg == "-t") { // -t TEST 00123 permAssert(i + 1 < argc); 00124 runSingle = argv[++i]; 00125 } else if (arg[1] == 't') { // allow -tTEST 00126 runSingle = arg.substr(2); 00127 } 00128 } else { 00129 int i = arg.find("="); 00130 if ((0 < i) && (i < arg.size())) { 00131 // an ad hoc parameter 00132 std::string key = arg.substr(0,i); 00133 std::string val = arg.substr(i + 1); 00134 adhocMap.setStringParam(key,val); 00135 } else { 00136 // a config file name 00137 std::ifstream configFile(arg.c_str()); 00138 assert(configFile.good()); 00139 configMap.readParams(configFile); 00140 } 00141 } 00142 } 00143 configMap.mergeFrom(adhocMap); 00144 00145 // set a default dictionary file location for use by tests that need a 00146 // small non-random sorted data set 00147 if (!configMap.isParamSet(paramDictionaryFileName)) { 00148 std::string dictFileName = "dictWords"; 00149 configMap.setStringParam(paramDictionaryFileName,dictFileName); 00150 } 00151 00152 if (verbose) { 00153 configMap.dumpParams(std::cout); 00154 } 00155 }
TestSuite * TestBase::releaseTestSuite | ( | ) | [inherited] |
Definition at line 157 of file TestBase.cpp.
References TestBase::TestCaseGroup::addAllToTestSuite(), TestBase::defaultTests, TestBase::extraTests, TestBase::TestCaseGroup::findTest(), TestBase::pTestObj, TestBase::pTestSuite, TestBase::runAll, TestBase::runSingle, and TestBase::testName.
00158 { 00159 assert(pTestObj); 00160 assert(pTestObj.use_count() > 1); 00161 00162 // release self-reference now that all test cases have been registered 00163 pTestObj.reset(); 00164 00165 TestSuite* pTestSuite = BOOST_TEST_SUITE(testName.c_str()); 00166 00167 if (runSingle.size()) { 00168 test_unit *p = defaultTests.findTest(runSingle); 00169 if (!p) { 00170 p = extraTests.findTest(runSingle); 00171 } 00172 if (!p) { 00173 std::cerr << "test " << runSingle << " not found\n"; 00174 exit(2); 00175 } 00176 pTestSuite->add(p); 00177 } else { 00178 defaultTests.addAllToTestSuite(pTestSuite); 00179 if (runAll) { 00180 extraTests.addAllToTestSuite(pTestSuite); 00181 } 00182 } 00183 return pTestSuite; 00184 }
void TestBase::beforeTestCase | ( | std::string | testCaseName | ) | [inherited] |
Definition at line 214 of file TestBase.cpp.
References TestBase::configMap, TraceSource::initTraceSource(), AutoBacktrace::install(), TestBase::notifyTrace(), AutoBacktrace::setOutputStream(), AutoBacktrace::setTraceTarget(), TestBase::testName, and TRACE_INFO.
00215 { 00216 notifyTrace(testName,TRACE_INFO,"ENTER: " + testCaseName); 00217 00218 // Install the AutoBacktrace signal handler now, after 00219 // boost::execution_monitor::catch_signals() has installed its own, so that 00220 // on SIGABRT AutoBacktrace goes first, prints the backtrace, then chains 00221 // to boost, which handles the error. 00222 AutoBacktrace::setOutputStream(); 00223 AutoBacktrace::setTraceTarget(shared_from_this()); 00224 AutoBacktrace::install(); 00225 configMap.initTraceSource(shared_from_this(), "testConfig"); 00226 }
void TestBase::afterTestCase | ( | std::string | testCaseName | ) | [inherited] |
Definition at line 228 of file TestBase.cpp.
References TestBase::configMap, TraceSource::disableTracing(), TestBase::notifyTrace(), AutoBacktrace::setTraceTarget(), TestBase::testName, and TRACE_INFO.
00229 { 00230 AutoBacktrace::setTraceTarget(); 00231 configMap.disableTracing(); 00232 notifyTrace(testName,TRACE_INFO,"LEAVE: " + testCaseName); 00233 }
void TestBase::notifyTrace | ( | std::string | source, | |
TraceLevel | level, | |||
std::string | message | |||
) | [virtual, inherited] |
Receives notification when a trace event occurs.
source | the facility from which the message originated | |
level | the trace event severity level | |
message | the text of the message |
Implements TraceTarget.
Definition at line 243 of file TestBase.cpp.
References TestBase::traceFile, TestBase::traceMutex, TestBase::traceStdout, and TestBase::traceStream.
Referenced by TestBase::afterTestCase(), and TestBase::beforeTestCase().
00244 { 00245 if (traceFile || traceStdout) { 00246 StrictMutexGuard traceMutexGuard(traceMutex); 00247 if (traceFile) { 00248 traceStream << "[" << source << "] " << message << std::endl; 00249 traceStream.flush(); 00250 } 00251 if (traceStdout) { 00252 std::cout << "[" << source << "] " << message << std::endl; 00253 std::cout.flush(); 00254 } 00255 } 00256 }
TraceLevel TestBase::getSourceTraceLevel | ( | std::string | source | ) | [virtual, inherited] |
Gets the level at which a particular source should be traced.
source | name of source to be traced |
Implements TraceTarget.
Definition at line 258 of file TestBase.cpp.
References TestBase::traceLevel.
Referenced by LbmExecStreamTestBase::generateBitmaps().
00259 { 00260 return traceLevel; 00261 }
LhxHashInfo LhxHashTableTest::hashInfo [private] |
Definition at line 44 of file LhxHashTableTest.cpp.
Referenced by readPartition(), testCaseSetUp(), testCaseTearDown(), testInsert(), and writeHashTable().
uint LhxHashTableTest::buildInputIndex [private] |
Definition at line 45 of file LhxHashTableTest.cpp.
Referenced by testInsert(), and writeHashTable().
SharedSegmentFactory SegStorageTestBase::pSegmentFactory [protected, inherited] |
Definition at line 40 of file SegStorageTestBase.h.
Referenced by BackupRestoreTest::backup(), SegStorageTestBase::createLinearDeviceSegment(), LogicalTxnTest::createRecoveryLog(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), SegStorageTestBase::openRandomSegment(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), BackupRestoreTest::restore(), SegStorageTestBase::SegStorageTestBase(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), testCaseSetUp(), LcsClusterReplaceExecStreamTest::testClusterReplace(), LhxAggExecStreamTest::testCountImpl(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamGovernorTest::testGovernor(), LhxAggExecStreamTest::testGroupCountImpl(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), BTreeTest::testInserts(), LbmIntersectExecStreamTest::testIntersect(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), LbmEntryTest::testMergeEntry(), BTreeTest::testMultiKeySearches(), BTreeTest::testScan(), ExecStreamTestSuite::testScratchBufferExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), FlatFileExecStreamTest::testStream(), LhxAggExecStreamTest::testSumImpl(), LogicalTxnTest::testTxn(), SnapshotSegmentTest::testUncommittedReads(), LbmUnionExecStreamTest::testUnion(), SegStreamTest::testWriteSpillAndRead(), and LbmEntryTest::testZeroBytes().
SharedSegment SegStorageTestBase::pLinearSegment [protected, inherited] |
Segment supporting linear page allocation.
Definition at line 45 of file SegStorageTestBase.h.
Referenced by SegStorageTestBase::closeLinearSegment(), LogicalTxnTest::createRecoveryLog(), SegmentTestBase::lockPage(), SegStorageTestBase::openRandomSegment(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), SegStorageTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), SegmentTestBase::openStorage(), SegmentTestBase::prefetchPage(), SnapshotSegmentTestBase::testAllocateAll(), LinearViewSegmentTest::testAllocateAll(), VersionedSegmentTest::testCheckpoint(), SegmentTestBase::testCheckpoint(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), SegStreamTest::testMarkReset(), SegStreamTest::testReadSeg(), VersionedSegmentTest::testRecovery(), LogicalTxnTest::testTxn(), SnapshotSegmentTest::testUncommittedReads(), SegStreamTest::testWriteSeg(), and VersionedSegmentTest::verifyPage().
SharedSegment SegStorageTestBase::pRandomSegment [protected, inherited] |
(Optional) segment supporting random page allocation.
Definition at line 50 of file SegStorageTestBase.h.
Referenced by SegStorageTestBase::closeRandomSegment(), SnapshotSegmentTestBase::closeStorage(), LbmSplicerExecStreamTest::createBTree(), LbmSplicerExecStreamTest::initBTreeParam(), LbmSearchTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeTupleDesc(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegStorageTestBase::openRandomSegment(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), SegmentTestBase::openStorage(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), ExecStreamTestSuite::testBTreeInsertExecStream(), BTreeTest::testBulkLoad(), 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().
SharedSegment SegStorageTestBase::pVersionedRandomSegment [protected, inherited] |
(Optional) segment supporting versioned random page allocation.
Definition at line 55 of file SegStorageTestBase.h.
Referenced by BackupRestoreTest::backup(), SnapshotSegmentTestBase::closeStorage(), SegStorageTestBase::closeVersionedRandomSegment(), SnapshotSegmentTest::deallocateOldPages(), SnapshotSegmentTestBase::openSegmentStorage(), BackupRestoreTest::restore(), LcsClusterReplaceExecStreamTest::testClusterReplace(), SnapshotSegmentTest::testRollback(), and SnapshotSegmentTest::testUncommittedReads().
SharedSegment SegStorageTestBase::pSnapshotRandomSegment [protected, inherited] |
(Optional) segment supporting snapshot random page allocation.
Definition at line 60 of file SegStorageTestBase.h.
Referenced by SegStorageTestBase::closeSnapshotRandomSegment(), SnapshotSegmentTestBase::commitChanges(), SnapshotSegmentTestBase::openSegmentStorage(), LcsClusterReplaceExecStreamTest::testClusterReplace(), and SnapshotSegmentTest::testDeallocateOld().
VictimPolicy CacheTestBase::victimPolicy [protected, inherited] |
VictimPolicy to instantiate.
Definition at line 53 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), and CacheTestBase::newCache().
CacheParams CacheTestBase::cacheParams [protected, inherited] |
Parameters for cache initialization.
Definition at line 58 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), CacheTestBase::newCache(), BackupRestoreTest::testBackupCleanup(), BackupRestoreTest::testHeaderBackupRestore(), and SegPageEntryIterTest::testIter().
SharedCache CacheTestBase::pCache [protected, inherited] |
Cache instance being tested.
Definition at line 63 of file CacheTestBase.h.
Referenced by BackupRestoreTest::backup(), CacheTestBase::closeDevice(), CacheTestBase::closeStorage(), LbmSplicerExecStreamTest::createBTree(), SegStorageTestBase::createLinearDeviceSegment(), LogicalTxnTest::createRecoveryLog(), BackupRestoreTest::createSnapshotData(), BackupRestoreTest::executeSnapshotTxn(), CacheTestBase::getCache(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LbmSearchTest::initBTreeParam(), LbmLoadBitmapTest::initBTreeParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsClusterReplaceExecStreamTest::loadCluster(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), SegmentTestBase::lockPage(), LbmMinusExecStreamTest::newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), CacheTestBase::openDevice(), CacheTestBase::openStorage(), LcsClusterReplaceExecStreamTest::replaceCluster(), BackupRestoreTest::restore(), LbmSplicerExecStreamTest::spliceInput(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), BackupRestoreTest::testBackupCleanup(), ExecStreamTestSuite::testBTreeInsertExecStream(), BTreeTest::testBulkLoad(), testCaseSetUp(), ExecStreamUnitTestBase::testCaseSetUp(), BTreeTest::testCaseSetUp(), BTreeReadersTest::testCaseSetUp(), LhxAggExecStreamTest::testCountImpl(), SegmentTestBase::testDeallocate(), SnapshotSegmentTest::testDeallocateOld(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamGovernorTest::testGovernor(), LhxAggExecStreamTest::testGroupCountImpl(), BackupRestoreTest::testHeaderBackupRestore(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), BTreeTest::testInserts(), LbmIntersectExecStreamTest::testIntersect(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), CacheTest::testLargeCacheInit(), CacheTest::testLargeCacheRequest(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), SegStreamTest::testMarkReset(), LbmEntryTest::testMergeEntry(), BTreeTest::testMultiKeySearches(), CacheTest::testQuotaCacheAccessor(), BTreeReadersTest::testReaders(), SegStreamTest::testReadSeg(), BTreeTest::testScan(), LcsRowScanExecStreamTest::testScanOnEmptyCluster(), ExecStreamTestSuite::testScratchBufferExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), FlatFileExecStreamTest::testStream(), LhxAggExecStreamTest::testSumImpl(), LogicalTxnTest::testTxn(), LogicalTxnTest::testTxnIdSequence(), LbmUnionExecStreamTest::testUnion(), SegStreamTest::testWriteSeg(), SegStreamTest::testWriteSpillAndRead(), LbmEntryTest::testZeroBytes(), and BackupRestoreTest::verifySnapshotData().
SharedRandomAccessDevice CacheTestBase::pRandomAccessDevice [protected, inherited] |
The default cached device.
Definition at line 68 of file CacheTestBase.h.
Referenced by BackupRestoreTest::backup(), CacheTestBase::closeStorage(), SegStorageTestBase::openSegmentStorage(), CacheTestBase::openStorage(), and BackupRestoreTest::restore().
uint CacheTestBase::nMemPages [protected, inherited] |
Size of cache in memory pages.
Definition at line 73 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), PagingTestBase::testCacheResize(), and ExecStreamTestBase::testCaseSetUp().
uint CacheTestBase::nDiskPages [protected, inherited] |
Size of device in disk pages.
Definition at line 78 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), LinearViewSegmentTest::LinearViewSegmentTest(), CacheTest::makeBlockId(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), CacheTestBase::openStorage(), SegStreamTest::SegStreamTest(), SnapshotSegmentTestBase::SnapshotSegmentTestBase(), SnapshotSegmentTest::testDeallocateOld(), PagingTestBase::testPrefetch(), PagingTestBase::testPrefetchBatch(), PagingTestBase::testRandomOp(), SnapshotSegmentTest::testRollback(), PagingTestBase::testSequentialOp(), and PagingTestBase::testSkipOp().
uint CacheTestBase::cbPageFull [protected, inherited] |
Disk page size.
Definition at line 83 of file CacheTestBase.h.
Referenced by CacheTest::CacheTest(), CacheTestBase::CacheTestBase(), CacheTestBase::openDevice(), and SegStorageTestBase::openSegmentStorage().
DeviceId CacheTestBase::dataDeviceId [protected, inherited] |
Fixed ID to assign to data device.
Definition at line 88 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), CacheTestBase::closeStorage(), CacheTest::makeBlockId(), SnapshotSegmentTestBase::openSegmentStorage(), SegStorageTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), CacheTestBase::openStorage(), and PagingTestBase::testCheckpoint().
TestSuite* TestBase::pTestSuite [protected, inherited] |
Boost test suite.
Definition at line 59 of file TestBase.h.
Referenced by TestBase::releaseTestSuite().
boost::shared_ptr<TestBase> TestBase::pTestObj [protected, inherited] |
Definition at line 61 of file TestBase.h.
Referenced by TestBase::releaseTestSuite(), and TestBase::TestBase().
std::ofstream TestBase::traceStream [protected, inherited] |
Output file stream for tracing.
Definition at line 66 of file TestBase.h.
Referenced by TestBase::notifyTrace(), TestBase::TestBase(), and TestBase::~TestBase().
StrictMutex TestBase::traceMutex [protected, inherited] |
Protects traceStream.
Definition at line 71 of file TestBase.h.
Referenced by TestBase::notifyTrace().
std::string TestBase::testName [protected, inherited] |
Name of test.
Definition at line 76 of file TestBase.h.
Referenced by TestBase::afterTestCase(), TestBase::beforeTestCase(), TestBase::releaseTestSuite(), TestBase::TestBase(), testInsert1Ka(), and testInsert1Kb().
TraceLevel TestBase::traceLevel [protected, inherited] |
Level at which to trace test execution.
Definition at line 81 of file TestBase.h.
Referenced by TestBase::getSourceTraceLevel(), and TestBase::TestBase().
FileStatsTarget TestBase::statsTarget [protected, inherited] |
StatsTimer TestBase::statsTimer [protected, inherited] |
Timer for stats collection.
Definition at line 91 of file TestBase.h.
Referenced by CacheTestBase::closeStorage(), CacheTestBase::openStorage(), BTreeTxnTest::testCaseSetUp(), BTreeTxnTest::testCaseTearDown(), and BTreeTxnTest::testTxns().
bool TestBase::traceStdout [protected, inherited] |
Copy trace output to stdout.
Definition at line 99 of file TestBase.h.
Referenced by TestBase::notifyTrace(), and TestBase::TestBase().
bool TestBase::traceFile [protected, inherited] |
Copy trace output to file.
Definition at line 104 of file TestBase.h.
Referenced by TestBase::notifyTrace(), and TestBase::TestBase().
bool TestBase::runAll [static, protected, inherited] |
Run all test cases, including the extra tests.
(static, since set by readParams())
Definition at line 110 of file TestBase.h.
Referenced by TestBase::readParams(), and TestBase::releaseTestSuite().
std::string TestBase::runSingle [static, protected, inherited] |
Run only the test case of this name.
(static, since set by readParams())
Definition at line 116 of file TestBase.h.
Referenced by TestBase::readParams(), and TestBase::releaseTestSuite().
TestCaseGroup TestBase::defaultTests [protected, inherited] |
TestCaseGroup TestBase::extraTests [protected, inherited] |
ParamName TestBase::paramTestSuiteName [static, inherited] |
ParamName TestBase::paramTraceFileName [static, inherited] |
ParamName TestBase::paramDictionaryFileName [static, inherited] |
Definition at line 145 of file TestBase.h.
Referenced by TestBase::readParams(), SegStreamTest::testRead(), and SegStreamTest::testWrite().
ParamName TestBase::paramTraceLevel [static, inherited] |
ParamName TestBase::paramStatsFileName [static, inherited] |
Definition at line 147 of file TestBase.h.
ParamName TestBase::paramTraceStdout [static, inherited] |
ParamName TestBase::paramDegreeOfParallelism [static, inherited] |
Definition at line 149 of file TestBase.h.
Referenced by ParallelExecStreamSchedulerTest::ParallelExecStreamSchedulerTest().
ConfigMap TestBase::configMap [static, inherited] |
Configuration parameters.
The reason this is static is so that no constructor parameters (which burden virtual bases) are needed.
Definition at line 155 of file TestBase.h.
Referenced by TestBase::afterTestCase(), TestBase::beforeTestCase(), BTreeTxnTest::BTreeTxnTest(), CacheTestBase::CacheTestBase(), BackupRestoreTest::createSnapshotData(), DatabaseTest::DatabaseTest(), TestOptionsTest::extra(), DatabaseTest::loadDatabase(), SparseBitmapTest::openStorage(), PagingTestBase::PagingTestBase(), ParallelExecStreamSchedulerTest::ParallelExecStreamSchedulerTest(), RandomAccessFileDeviceTest::RandomAccessFileDeviceTest(), TestBase::readParams(), SegStorageTestBase::SegStorageTestBase(), TestOptionsTest::test1(), TestOptionsTest::test2(), BackupRestoreTest::testBackupCleanup(), TestBase::TestBase(), BTreeTxnTest::testCaseSetUp(), BTreeTxnTest::testCheckpoint(), DatabaseTest::testCreateEmpty(), DatabaseTest::testForceTxns(), BackupRestoreTest::testHeaderBackupRestore(), SegPageEntryIterTest::testIter(), SegStreamTest::testRead(), BTreeTxnTest::testTxns(), SegStreamTest::testWrite(), ThreadedTestBase::ThreadedTestBase(), and TestBase::~TestBase().