Inheritance diagram for LbmMinusExecStreamTest:
Public Member Functions | |
LbmMinusExecStreamTest () | |
void | test2Inputs () |
void | test3Inputs () |
void | testLargeOutput () |
This testcase exercises building up a large number segments in the resultant bitmaps. | |
void | testAnchorLarger1 () |
This testcase exercises the case where the anchor input has more rids than its children; input 1 exhausts before input 2. | |
void | testAnchorLarger2 () |
This testcase also exercises the case where the anchor input has more rids than its children, but both inputs exhaust at same point. | |
void | testChildrenLarger () |
This testcase exercises the case where the children input are larger than the anchor, and none of the bits overlap. | |
void | testEvens () |
void | testNines () |
void | testClose () |
void | testLowCardinalityRestart () |
void | testCaseSetUp () |
Equivalent to JUnit TestCase.setUp; this is called before each test case method is invoked. | |
virtual void | testCaseTearDown () |
Equivalent to JUnit TestCase.tearDown; this is called after each test case method is invoked. | |
virtual void | 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 uint | getTupleInterval (std::vector< int > const &repeatSeqValues, uint nKeys=0) |
Find the interval for which an entire tuple's sequence repeats. | |
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 | initBitmapInput (BitmapInput &bmInput, uint nRows, InputData const &inputData) |
void | initBitmapInput (BitmapInput &bmInput, uint nRows, LbmNumberStreamInput input) |
void | generateBitmaps (uint nRows, LbmNumberStreamInput input, BitmapInput &bmInput) |
void | generateBitmaps (uint nRows, uint start, uint skipRows, PBuffer pBuf, uint &bufSize, uint fullBufSize, uint &nBitmaps, bool includeKeys=false) |
Generate bitmaps to used in verifying result of bitmap index scan. | |
void | produceEntry (LbmEntry &lbmEntry, TupleAccessor &bitmapTupleAccessor, BitmapInput &bmInput) |
void | produceEntry (LbmEntry &lbmEntry, TupleAccessor &bitmapTupleAccessor, PBuffer pBuf, uint &bufSize, uint &nBitmaps, bool includeKeys) |
void | initValuesExecStream (uint idx, ValuesExecStreamParams &valuesParams, ExecStreamEmbryo &valuesStreamEmbryo, BitmapInput &bmInput) |
void | initSorterExecStream (ExternalSortExecStreamParams ¶ms, ExecStreamEmbryo &embryo, TupleDescriptor const &outputDesc, uint nKeys=1) |
void | initNormalizerExecStream (LbmNormalizerExecStreamParams ¶ms, ExecStreamEmbryo &embryo, uint nKeys) |
uint | resultBitmapSize (uint start, uint end) |
Calculates size of result bitmap. | |
uint | resultBitmapSize (uint nRids) |
void | initKeyBitmap (uint nRows, std::vector< int > const &repeatSeqValues) |
Initialize bitmaps with keys. | |
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) |
Static Protected Member Functions | |
static const std::string & | getTraceName () |
Protected Attributes | |
StandardTypeDescriptorFactory | stdTypeFactory |
TupleAttributeDescriptor | attrDesc_int64 |
TupleAttributeDescriptor | attrDesc_bitmap |
uint | bitmapColSize |
Size of bitmap columns. | |
TupleDescriptor | bitmapTupleDesc |
Tuple descriptor, tupledata, and accessor for a bitmap segment: (rid, segment descriptor, bitmap segments). | |
TupleData | bitmapTupleData |
TupleAccessor | bitmapTupleAccessor |
TupleDescriptor | keyBitmapTupleDesc |
Tuple descriptor, data, and accessor for key-containting bitmaps (keys, srid, segment descriptor, bitmap segments). | |
TupleData | keyBitmapTupleData |
TupleAccessor | keyBitmapTupleAccessor |
boost::shared_array< FixedBuffer > | keyBitmapBuf |
uint | keyBitmapBufSize |
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. | |
Private Member Functions | |
void | testMinus (uint nInputs, uint nRows, std::vector< InputData > const &inputData) |
void | testRestartingMinus (uint nRows, std::vector< int > const &repeatSeqValues, uint subtrahendInterval) |
Perform [minuend] - [subtrahend] where minuend is based on repeatSeqValues and subtrahend is 0, n, 2n, 3n, . | |
void | newMinusStream (LbmMinusExecStreamParams ¶ms, ExecStreamEmbryo &embryo, TupleDescriptor const &outputDesc) |
Definition at line 34 of file LbmMinusExecStreamTest.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 };
LbmMinusExecStreamTest::LbmMinusExecStreamTest | ( | ) | [inline, explicit] |
Definition at line 54 of file LbmMinusExecStreamTest.cpp.
References test2Inputs(), test3Inputs(), testAnchorLarger1(), testAnchorLarger2(), testChildrenLarger(), testClose(), testEvens(), testLargeOutput(), testLowCardinalityRestart(), and testNines().
00055 { 00056 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, test2Inputs); 00057 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, test3Inputs); 00058 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, testLargeOutput); 00059 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, testAnchorLarger1); 00060 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, testAnchorLarger2); 00061 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, testChildrenLarger); 00062 00063 // tests for restarting minus 00064 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, testEvens); 00065 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, testNines); 00066 FENNEL_UNIT_TEST_CASE(LbmMinusExecStreamTest, testClose); 00067 FENNEL_UNIT_TEST_CASE( 00068 LbmMinusExecStreamTest, testLowCardinalityRestart); 00069 }
void LbmMinusExecStreamTest::testMinus | ( | uint | nInputs, | |
uint | nRows, | |||
std::vector< InputData > const & | inputData | |||
) | [private] |
Definition at line 506 of file LbmMinusExecStreamTest.cpp.
References LbmExecStreamTestBase::bitmapTupleDesc, LbmExecStreamTestBase::initBitmapInput(), LbmExecStreamTestBase::initValuesExecStream(), newMinusStream(), ExecStreamUnitTestBase::prepareConfluenceGraph(), and ExecStreamUnitTestBase::verifyBufferedOutput().
Referenced by test2Inputs(), test3Inputs(), testAnchorLarger1(), testAnchorLarger2(), testChildrenLarger(), and testLargeOutput().
00508 { 00509 boost::scoped_array<BitmapInput> bmInputs; 00510 boost::scoped_array<ValuesExecStreamParams> valuesParams; 00511 std::vector<ExecStreamEmbryo> valuesStreamEmbryoList; 00512 ExecStreamEmbryo valuesStreamEmbryo; 00513 00514 // +1 is for expected result 00515 assert(inputData.size() == nInputs + 1); 00516 00517 bmInputs.reset(new BitmapInput[nInputs + 1]); 00518 valuesParams.reset(new ValuesExecStreamParams[nInputs]); 00519 00520 // setup values exec stream for each input 00521 for (uint i = 0; i < nInputs; i++) { 00522 initBitmapInput(bmInputs[i], nRows, inputData[i]); 00523 initValuesExecStream( 00524 i, valuesParams[i], valuesStreamEmbryo, bmInputs[i]); 00525 valuesStreamEmbryoList.push_back(valuesStreamEmbryo); 00526 } 00527 // set up expected result 00528 if (inputData[nInputs].bitmapSize > 0) { 00529 initBitmapInput(bmInputs[nInputs], nRows, inputData[nInputs]); 00530 } else { 00531 bmInputs[nInputs].bufArray.reset(); 00532 bmInputs[nInputs].nBitmaps = 0; 00533 } 00534 00535 LbmMinusExecStreamParams minusParams; 00536 ExecStreamEmbryo minusEmbryo; 00537 newMinusStream(minusParams, minusEmbryo, bitmapTupleDesc); 00538 00539 SharedExecStream pOutputStream = prepareConfluenceGraph( 00540 valuesStreamEmbryoList, minusEmbryo); 00541 00542 verifyBufferedOutput( 00543 *pOutputStream, bitmapTupleDesc, bmInputs[nInputs].nBitmaps, 00544 bmInputs[nInputs].bufArray.get()); 00545 }
void LbmMinusExecStreamTest::testRestartingMinus | ( | uint | nRows, | |
std::vector< int > const & | repeatSeqValues, | |||
uint | subtrahendInterval | |||
) | [private] |
Perform [minuend] - [subtrahend] where minuend is based on repeatSeqValues and subtrahend is 0, n, 2n, 3n, .
..
Definition at line 547 of file LbmMinusExecStreamTest.cpp.
References InputData::bitmapSize, ValuesExecStreamParams::bufSize, RestartingMinusExecStreamGenerator::getRowCount(), ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), LbmExecStreamTestBase::initBitmapInput(), LbmExecStreamTestBase::initKeyBitmap(), LbmExecStreamTestBase::initNormalizerExecStream(), LbmExecStreamTestBase::initValuesExecStream(), LbmExecStreamTestBase::keyBitmapBuf, LbmExecStreamTestBase::keyBitmapBufSize, LbmExecStreamTestBase::keyBitmapTupleDesc, newMinusStream(), SingleOutputExecStreamParams::outputTupleDesc, ExecStreamUnitTestBase::prepareConfluenceTransformGraph(), ValuesExecStreamParams::pTupleBuffer, InputData::skipRows, InputData::startRid, and ExecStreamUnitTestBase::verifyOutput().
Referenced by testClose(), testEvens(), testLowCardinalityRestart(), and testNines().
00551 { 00552 uint nKeys = repeatSeqValues.size(); 00553 00554 // initialize minuend [ (keys), (bitmaps) ] 00555 initKeyBitmap(nRows, repeatSeqValues); 00556 ValuesExecStreamParams valuesParams; 00557 valuesParams.outputTupleDesc = keyBitmapTupleDesc; 00558 valuesParams.pTupleBuffer = keyBitmapBuf; 00559 valuesParams.bufSize = keyBitmapBufSize; 00560 00561 ExecStreamEmbryo minuendEmbryo; 00562 minuendEmbryo.init(new ValuesExecStream(), valuesParams); 00563 minuendEmbryo.getStream()->setName("MinuendValuesExecStream"); 00564 00565 // initialize subtrahend [ (bitmaps) ] 00566 InputData subtrahendData; 00567 subtrahendData.startRid = LcsRid(0); 00568 subtrahendData.skipRows = subtrahendInterval; 00569 subtrahendData.bitmapSize = 8; 00570 00571 BitmapInput bmInput; 00572 initBitmapInput(bmInput, nRows, subtrahendData); 00573 00574 ValuesExecStreamParams subtrahendParams; 00575 ExecStreamEmbryo subtrahendEmbryo; 00576 initValuesExecStream(0, subtrahendParams, subtrahendEmbryo, bmInput); 00577 00578 // initialize the minus stream 00579 LbmMinusExecStreamParams minusParams; 00580 ExecStreamEmbryo minusEmbryo; 00581 newMinusStream(minusParams, minusEmbryo, keyBitmapTupleDesc); 00582 00583 // initialize normalizer 00584 ExecStreamEmbryo normalizerEmbryo; 00585 LbmNormalizerExecStreamParams normalizerParams; 00586 initNormalizerExecStream(normalizerParams, normalizerEmbryo, nKeys); 00587 00588 // build inputs -> minus stream -> normalizer transforms 00589 SharedExecStream pOutputStream = prepareConfluenceTransformGraph( 00590 minuendEmbryo, subtrahendEmbryo, minusEmbryo, normalizerEmbryo); 00591 RestartingMinusExecStreamGenerator 00592 verifier(nRows, repeatSeqValues, subtrahendInterval); 00593 verifyOutput( 00594 *pOutputStream, 00595 verifier.getRowCount(), 00596 verifier); 00597 }
void LbmMinusExecStreamTest::newMinusStream | ( | LbmMinusExecStreamParams & | params, | |
ExecStreamEmbryo & | embryo, | |||
TupleDescriptor const & | outputDesc | |||
) | [private] |
Definition at line 599 of file LbmMinusExecStreamTest.cpp.
References ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), CacheTestBase::pCache, and SegStorageTestBase::pSegmentFactory.
Referenced by testMinus(), and testRestartingMinus().
00603 { 00604 params.rowLimitParamId = DynamicParamId(1); 00605 params.startRidParamId = DynamicParamId(2); 00606 params.outputTupleDesc = outputDesc; 00607 params.scratchAccessor = 00608 pSegmentFactory->newScratchSegment(pCache, 10); 00609 00610 embryo.init(new LbmMinusExecStream(), params); 00611 embryo.getStream()->setName("MinusExecStream"); 00612 }
void LbmMinusExecStreamTest::test2Inputs | ( | ) |
Definition at line 169 of file LbmMinusExecStreamTest.cpp.
References InputData::bitmapSize, LbmExecStreamTestBase::resultBitmapSize(), InputData::skipRows, InputData::startRid, and testMinus().
Referenced by LbmMinusExecStreamTest().
00170 { 00171 uint nInputs = 2; 00172 uint nRows = 1000; 00173 std::vector<InputData> inputData; 00174 InputData input; 00175 00176 // bitmap input 1 -- all bits set 00177 input.bitmapSize = 4; 00178 input.startRid = LcsRid(10); 00179 input.skipRows = 1; 00180 inputData.push_back(input); 00181 00182 // bitmap input 2 -- every other bit set 00183 input.bitmapSize = 8; 00184 input.startRid = LcsRid(0); 00185 input.skipRows = 2; 00186 inputData.push_back(input); 00187 00188 // expected result -- every other bit set, starting at 11 00189 input.bitmapSize = resultBitmapSize(11, nRows); 00190 input.startRid = LcsRid(11); 00191 input.skipRows = 2; 00192 inputData.push_back(input); 00193 00194 testMinus(nInputs, nRows, inputData); 00195 }
void LbmMinusExecStreamTest::test3Inputs | ( | ) |
Definition at line 197 of file LbmMinusExecStreamTest.cpp.
References InputData::bitmapSize, LbmExecStreamTestBase::resultBitmapSize(), InputData::skipRows, InputData::startRid, and testMinus().
Referenced by LbmMinusExecStreamTest().
00198 { 00199 uint nInputs = 3; 00200 uint nRows = 1000; 00201 std::vector<InputData> inputData; 00202 InputData input; 00203 00204 // bitmap input 1 -- every rid set, starting at 22 00205 input.bitmapSize = 9; 00206 input.startRid = LcsRid(22); 00207 input.skipRows = 1; 00208 inputData.push_back(input); 00209 00210 // bitmap input 2 -- every 3 rids set, starting at 2 00211 input.bitmapSize = 8; 00212 input.startRid = LcsRid(2); 00213 input.skipRows = 3; 00214 inputData.push_back(input); 00215 00216 // bitmap input 3 -- every 3 set, starting at 3 00217 input.bitmapSize = 10; 00218 input.startRid = LcsRid(3); 00219 input.skipRows = 3; 00220 inputData.push_back(input); 00221 00222 // expected result -- every 3 rids set, starting at 22 00223 input.bitmapSize = resultBitmapSize(22, nRows); 00224 input.startRid = LcsRid(22); 00225 input.skipRows = 3; 00226 inputData.push_back(input); 00227 00228 testMinus(nInputs, nRows, inputData); 00229 }
void LbmMinusExecStreamTest::testLargeOutput | ( | ) |
This testcase exercises building up a large number segments in the resultant bitmaps.
Definition at line 235 of file LbmMinusExecStreamTest.cpp.
References InputData::bitmapSize, LbmExecStreamTestBase::resultBitmapSize(), InputData::skipRows, InputData::startRid, and testMinus().
Referenced by LbmMinusExecStreamTest().
00236 { 00237 uint nInputs = 16; 00238 uint nRows = 100000; 00239 std::vector<InputData> inputData; 00240 InputData input; 00241 00242 // bitmap input 1 -- all bits set 00243 input.bitmapSize = 1; 00244 input.startRid = LcsRid(0); 00245 input.skipRows = 1; 00246 inputData.push_back(input); 00247 00248 // bitmap input 2 -- every 16 bits set, starting at 1 00249 input.bitmapSize = 1; 00250 input.startRid = LcsRid(1); 00251 input.skipRows = 16; 00252 inputData.push_back(input); 00253 00254 // bitmap input 3 -- every 16 bits set, starting at 2 00255 input.bitmapSize = 1; 00256 input.startRid = LcsRid(2); 00257 input.skipRows = 16; 00258 inputData.push_back(input); 00259 00260 // bitmap input 4 -- every 16 bits set, starting at 3 00261 input.bitmapSize = 1; 00262 input.startRid = LcsRid(3); 00263 input.skipRows = 16; 00264 inputData.push_back(input); 00265 00266 // bitmap input 5 -- every 16 bits set, starting at 4 00267 input.bitmapSize = 1; 00268 input.startRid = LcsRid(4); 00269 input.skipRows = 16; 00270 inputData.push_back(input); 00271 00272 // bitmap input 6 -- every 16 bits set, starting at 5 00273 input.bitmapSize = 1; 00274 input.startRid = LcsRid(5); 00275 input.skipRows = 16; 00276 inputData.push_back(input); 00277 00278 // bitmap input 7 -- every 16 bits set, starting at 6 00279 input.bitmapSize = 1; 00280 input.startRid = LcsRid(6); 00281 input.skipRows = 16; 00282 inputData.push_back(input); 00283 00284 // bitmap input 8 -- every 16 bits set, starting at 7 00285 input.bitmapSize = 1; 00286 input.startRid = LcsRid(7); 00287 input.skipRows = 16; 00288 inputData.push_back(input); 00289 00290 // bitmap input 9 -- every 16 bits set, starting at 8 00291 input.bitmapSize = 1; 00292 input.startRid = LcsRid(8); 00293 input.skipRows = 16; 00294 inputData.push_back(input); 00295 00296 // bitmap input 10 -- every 16 bits set, starting at 9 00297 input.bitmapSize = 1; 00298 input.startRid = LcsRid(9); 00299 input.skipRows = 16; 00300 inputData.push_back(input); 00301 00302 // bitmap input 11 -- every 16 bits set, starting at 10 00303 input.bitmapSize = 1; 00304 input.startRid = LcsRid(10); 00305 input.skipRows = 16; 00306 inputData.push_back(input); 00307 00308 // bitmap input 12 -- every 16 bits set, starting at 11 00309 input.bitmapSize = 1; 00310 input.startRid = LcsRid(11); 00311 input.skipRows = 16; 00312 inputData.push_back(input); 00313 00314 // bitmap input 13 -- every 16 bits set, starting at 12 00315 input.bitmapSize = 1; 00316 input.startRid = LcsRid(12); 00317 input.skipRows = 16; 00318 inputData.push_back(input); 00319 00320 // bitmap input 14 -- every 16 bits set, starting at 13 00321 input.bitmapSize = 1; 00322 input.startRid = LcsRid(13); 00323 input.skipRows = 16; 00324 inputData.push_back(input); 00325 00326 // bitmap input 15 -- every 16 bits set, starting at 14 00327 input.bitmapSize = 1; 00328 input.startRid = LcsRid(14); 00329 input.skipRows = 16; 00330 inputData.push_back(input); 00331 00332 // bitmap input 16 -- every 16 bits set, starting at 15 00333 input.bitmapSize = 1; 00334 input.startRid = LcsRid(15); 00335 input.skipRows = 16; 00336 inputData.push_back(input); 00337 00338 // expected result -- every 16 bits set, starting at 0 00339 input.bitmapSize = resultBitmapSize(0, nRows); 00340 input.startRid = LcsRid(0); 00341 input.skipRows = 16; 00342 inputData.push_back(input); 00343 00344 testMinus(nInputs, nRows, inputData); 00345 }
void LbmMinusExecStreamTest::testAnchorLarger1 | ( | ) |
This testcase exercises the case where the anchor input has more rids than its children; input 1 exhausts before input 2.
Definition at line 351 of file LbmMinusExecStreamTest.cpp.
References InputData::bitmapSize, LbmExecStreamTestBase::resultBitmapSize(), InputData::skipRows, InputData::startRid, and testMinus().
Referenced by LbmMinusExecStreamTest().
00352 { 00353 uint nInputs = 3; 00354 uint nRows = 100; 00355 std::vector<InputData> inputData; 00356 InputData input; 00357 00358 // bitmap input 1 -- every 17 bits set (0, 17, ..., 85) 00359 input.bitmapSize = 10; 00360 input.startRid = LcsRid(0); 00361 input.skipRows = 17; 00362 inputData.push_back(input); 00363 00364 // bitmap input 2 -- every 60 bits (0, 60) 00365 input.bitmapSize = 10; 00366 input.startRid = LcsRid(0); 00367 input.skipRows = 60; 00368 inputData.push_back(input); 00369 00370 // bitmap input 3 -- every 70 bits set (0, 70) 00371 input.bitmapSize = 10; 00372 input.startRid = LcsRid(0); 00373 input.skipRows = 70; 00374 inputData.push_back(input); 00375 00376 // expected result -- every 17 bits set, starting at 17 00377 input.bitmapSize = resultBitmapSize(17, nRows); 00378 input.startRid = LcsRid(17); 00379 input.skipRows = 17; 00380 inputData.push_back(input); 00381 00382 testMinus(nInputs, nRows, inputData); 00383 }
void LbmMinusExecStreamTest::testAnchorLarger2 | ( | ) |
This testcase also exercises the case where the anchor input has more rids than its children, but both inputs exhaust at same point.
Definition at line 389 of file LbmMinusExecStreamTest.cpp.
References InputData::bitmapSize, LbmExecStreamTestBase::resultBitmapSize(), InputData::skipRows, InputData::startRid, and testMinus().
Referenced by LbmMinusExecStreamTest().
00390 { 00391 uint nInputs = 3; 00392 uint nRows = 100; 00393 std::vector<InputData> inputData; 00394 InputData input; 00395 00396 // bitmap input 1 -- every 17 bits set (0, 17, ..., 85) 00397 input.bitmapSize = 10; 00398 input.startRid = LcsRid(0); 00399 input.skipRows = 17; 00400 inputData.push_back(input); 00401 00402 // bitmap input 2 -- every 60 bits (0, 60) 00403 input.bitmapSize = 10; 00404 input.startRid = LcsRid(0); 00405 input.skipRows = 60; 00406 inputData.push_back(input); 00407 00408 // bitmap input 3 -- every 61 bits set (0, 61) 00409 input.bitmapSize = 10; 00410 input.startRid = LcsRid(0); 00411 input.skipRows = 61; 00412 inputData.push_back(input); 00413 00414 // expected result -- every 17 bits set, starting at 17 00415 input.bitmapSize = resultBitmapSize(17, nRows); 00416 input.startRid = LcsRid(17); 00417 input.skipRows = 17; 00418 inputData.push_back(input); 00419 00420 testMinus(nInputs, nRows, inputData); 00421 }
void LbmMinusExecStreamTest::testChildrenLarger | ( | ) |
This testcase exercises the case where the children input are larger than the anchor, and none of the bits overlap.
Definition at line 427 of file LbmMinusExecStreamTest.cpp.
References InputData::bitmapSize, LbmExecStreamTestBase::resultBitmapSize(), InputData::skipRows, InputData::startRid, and testMinus().
Referenced by LbmMinusExecStreamTest().
00428 { 00429 uint nInputs = 3; 00430 uint nRows = 100; 00431 std::vector<InputData> inputData; 00432 InputData input; 00433 00434 // bitmap input 1 -- (0, 60) 00435 input.bitmapSize = 10; 00436 input.startRid = LcsRid(0); 00437 input.skipRows = 60; 00438 inputData.push_back(input); 00439 00440 // bitmap input 2 -- only bit 70 set 00441 input.bitmapSize = 10; 00442 input.startRid = LcsRid(70); 00443 input.skipRows = 70; 00444 inputData.push_back(input); 00445 00446 // bitmap input 3 -- only bit 80 set 00447 input.bitmapSize = 10; 00448 input.startRid = LcsRid(80); 00449 input.skipRows = 80; 00450 inputData.push_back(input); 00451 00452 // expected result -- (0, 60) 00453 input.bitmapSize = resultBitmapSize(0, nRows); 00454 input.startRid = LcsRid(0); 00455 input.skipRows = 60; 00456 inputData.push_back(input); 00457 00458 testMinus(nInputs, nRows, inputData); 00459 }
void LbmMinusExecStreamTest::testEvens | ( | ) |
Definition at line 461 of file LbmMinusExecStreamTest.cpp.
References testRestartingMinus().
Referenced by LbmMinusExecStreamTest().
00462 { 00463 uint nRows = 100000; 00464 std::vector<int> repeatSeqValues; 00465 repeatSeqValues.push_back(1); 00466 repeatSeqValues.push_back(5); 00467 repeatSeqValues.push_back(9); 00468 uint subtrahendInterval = 2; 00469 00470 testRestartingMinus(nRows, repeatSeqValues, subtrahendInterval); 00471 }
void LbmMinusExecStreamTest::testNines | ( | ) |
Definition at line 473 of file LbmMinusExecStreamTest.cpp.
References testRestartingMinus().
Referenced by LbmMinusExecStreamTest().
00474 { 00475 uint nRows = 1000; 00476 std::vector<int> repeatSeqValues; 00477 repeatSeqValues.push_back(1); 00478 repeatSeqValues.push_back(5); 00479 repeatSeqValues.push_back(9); 00480 uint subtrahendInterval = 9; 00481 00482 testRestartingMinus(nRows, repeatSeqValues, subtrahendInterval); 00483 }
void LbmMinusExecStreamTest::testClose | ( | ) |
Definition at line 485 of file LbmMinusExecStreamTest.cpp.
References testRestartingMinus().
Referenced by LbmMinusExecStreamTest().
00486 { 00487 uint nRows = 1000; 00488 std::vector<int> repeatSeqValues; 00489 repeatSeqValues.push_back(2); 00490 repeatSeqValues.push_back(3); 00491 uint subtrahendInterval = 4; 00492 00493 testRestartingMinus(nRows, repeatSeqValues, subtrahendInterval); 00494 }
void LbmMinusExecStreamTest::testLowCardinalityRestart | ( | ) |
Definition at line 496 of file LbmMinusExecStreamTest.cpp.
References testRestartingMinus().
Referenced by LbmMinusExecStreamTest().
00497 { 00498 uint nRows = 10000; 00499 std::vector<int> repeatSeqValues; 00500 repeatSeqValues.push_back(2); 00501 uint subtrahendInterval = 21; 00502 00503 testRestartingMinus(nRows, repeatSeqValues, subtrahendInterval); 00504 }
static const std::string& LbmExecStreamTestBase::getTraceName | ( | ) | [inline, static, protected, inherited] |
Definition at line 300 of file LbmExecStreamTestBase.h.
References traceName.
Referenced by LbmExecStreamTestBase::generateBitmaps().
00301 { 00302 return traceName; 00303 }
void LbmExecStreamTestBase::initBitmapInput | ( | BitmapInput & | bmInput, | |
uint | nRows, | |||
InputData const & | inputData | |||
) | [protected, inherited] |
Definition at line 27 of file LbmExecStreamTestBase.cpp.
References NumberStream::BIG_NUMBER, InputData::bitmapSize, LbmNumberStreamInput::bitmapSize, opaqueToInt(), LbmNumberStreamInput::pStream, InputData::skipRows, and InputData::startRid.
Referenced by LbmIntersectExecStreamTest::testIntersect(), testMinus(), testRestartingMinus(), and LbmUnionExecStreamTest::testUnion().
00029 { 00030 LbmNumberStreamInput input; 00031 SharedNumberStream pNumberStream( 00032 new SkipNumberStream( 00033 opaqueToInt(inputData.startRid), 00034 NumberStream::BIG_NUMBER, inputData.skipRows)); 00035 input.pStream = pNumberStream; 00036 input.bitmapSize = inputData.bitmapSize; 00037 00038 initBitmapInput(bmInput, nRows, input); 00039 }
void LbmExecStreamTestBase::initBitmapInput | ( | BitmapInput & | bmInput, | |
uint | nRows, | |||
LbmNumberStreamInput | input | |||
) | [protected, inherited] |
Definition at line 41 of file LbmExecStreamTestBase.cpp.
References BitmapInput::bufArray, BitmapInput::currBufSize, FixedBuffer, BitmapInput::fullBufSize, LbmExecStreamTestBase::generateBitmaps(), BitmapInput::nBitmaps, and LbmNumberStreamInput::pStream.
00043 { 00044 bmInput.fullBufSize = input.pStream->getMaxRowCount(nRows) * 16; 00045 bmInput.bufArray.reset(new FixedBuffer[bmInput.fullBufSize]); 00046 bmInput.nBitmaps = 0; 00047 bmInput.currBufSize = 0; 00048 generateBitmaps(nRows, input, bmInput); 00049 }
void LbmExecStreamTestBase::generateBitmaps | ( | uint | nRows, | |
LbmNumberStreamInput | input, | |||
BitmapInput & | bmInput | |||
) | [protected, inherited] |
Definition at line 51 of file LbmExecStreamTestBase.cpp.
References LbmExecStreamTestBase::bitmapColSize, LbmNumberStreamInput::bitmapSize, LbmExecStreamTestBase::bitmapTupleAccessor, LbmExecStreamTestBase::bitmapTupleData, LbmExecStreamTestBase::bitmapTupleDesc, BitmapInput::currBufSize, FixedBuffer, BitmapInput::fullBufSize, LbmEntry::getScratchBufferSize(), TestBase::getSourceTraceLevel(), LbmExecStreamTestBase::getTraceName(), LbmEntry::init(), opaqueToInt(), LbmExecStreamTestBase::produceEntry(), LbmNumberStreamInput::pStream, LbmEntry::setEntryTuple(), LbmEntry::setRID(), and TRACE_FINER.
Referenced by LbmExecStreamTestBase::initBitmapInput(), LbmExecStreamTestBase::initKeyBitmap(), LbmSearchTest::testMultipleRanges(), LbmSearchTest::testScanFullKey(), and LbmSearchTest::testScanPartialKey().
00053 { 00054 LbmEntry lbmEntry; 00055 boost::scoped_array<FixedBuffer> entryBuf; 00056 LcsRid rid = LcsRid(input.pStream->getNext()); 00057 00058 // setup an LbmEntry with the initial rid value 00059 uint scratchBufSize = LbmEntry::getScratchBufferSize(bitmapColSize); 00060 entryBuf.reset(new FixedBuffer[scratchBufSize]); 00061 lbmEntry.init(entryBuf.get(), NULL, scratchBufSize, bitmapTupleDesc); 00062 bitmapTupleData[0].pData = (PConstBuffer) &rid; 00063 lbmEntry.setEntryTuple(bitmapTupleData); 00064 TraceLevel level = getSourceTraceLevel(getTraceName()); 00065 if (level <= TRACE_FINER) { 00066 std::cout << "Set root: " << rid << std::endl; 00067 } 00068 00069 // add on the remaining rids 00070 while (input.pStream->hasNext()) { 00071 rid = LcsRid(input.pStream->getNext()); 00072 if (rid >= LcsRid(nRows)) { 00073 break; 00074 } 00075 if (level <= TRACE_FINER) { 00076 std::cout << "Set value: " << rid << std::endl; 00077 } 00078 if ((rid > LcsRid(0) && 00079 opaqueToInt(rid % (input.bitmapSize*8)) == 0) || 00080 !lbmEntry.setRID(LcsRid(rid))) 00081 { 00082 // either hit desired number of rids per bitmap segment or 00083 // exhausted buffer space, so write the tuple to the output 00084 // buffer and reset LbmEntry 00085 produceEntry(lbmEntry, bitmapTupleAccessor, bmInput); 00086 lbmEntry.setEntryTuple(bitmapTupleData); 00087 } 00088 } 00089 // write out the last LbmEntry 00090 produceEntry(lbmEntry, bitmapTupleAccessor, bmInput); 00091 00092 assert(bmInput.currBufSize <= bmInput.fullBufSize); 00093 }
void LbmExecStreamTestBase::generateBitmaps | ( | uint | nRows, | |
uint | start, | |||
uint | skipRows, | |||
PBuffer | pBuf, | |||
uint & | bufSize, | |||
uint | fullBufSize, | |||
uint & | nBitmaps, | |||
bool | includeKeys = false | |||
) | [protected, inherited] |
Generate bitmaps to used in verifying result of bitmap index scan.
nRows | number of rows in index | |
start | initial rid value | |
skipRows | generate rids every "skipRows" rows; i.e., if skipRows == 1, there are no gaps in the rids | |
pBuf | buffer where bitmap segment tuples will be marshalled | |
bufSize | amount of space currently used within pBuf | |
fullBufSize | size of pBuf | |
nBitmaps | returns number of bitmaps generated | |
includeKeys | if true, include the keys in the generated bitmap entry |
Definition at line 163 of file LbmExecStreamTestBase.cpp.
References LbmExecStreamTestBase::bitmapColSize, LbmExecStreamTestBase::bitmapTupleAccessor, LbmExecStreamTestBase::bitmapTupleData, LbmExecStreamTestBase::bitmapTupleDesc, FixedBuffer, LbmEntry::getScratchBufferSize(), LbmEntry::init(), LbmExecStreamTestBase::produceEntry(), LbmEntry::setEntryTuple(), and LbmEntry::setRID().
00166 { 00167 LbmEntry lbmEntry; 00168 boost::scoped_array<FixedBuffer> entryBuf; 00169 LcsRid rid = LcsRid(start); 00170 00171 // setup an LbmEntry with the initial rid value 00172 uint scratchBufSize = LbmEntry::getScratchBufferSize(bitmapColSize); 00173 entryBuf.reset(new FixedBuffer[scratchBufSize]); 00174 lbmEntry.init(entryBuf.get(), NULL, scratchBufSize, bitmapTupleDesc); 00175 bitmapTupleData[0].pData = (PConstBuffer) &rid; 00176 lbmEntry.setEntryTuple(bitmapTupleData); 00177 00178 // add on the remaining rids 00179 for (rid = LcsRid(start + skipRows); rid < LcsRid(nRows); rid += skipRows) { 00180 if (!lbmEntry.setRID(LcsRid(rid))) { 00181 // exhausted buffer space, so write the tuple to the output 00182 // buffer and reset LbmEntry 00183 produceEntry( 00184 lbmEntry, bitmapTupleAccessor, 00185 pBuf, bufSize, nBitmaps, includeKeys); 00186 lbmEntry.setEntryTuple(bitmapTupleData); 00187 } 00188 } 00189 // write out the last LbmEntry 00190 produceEntry( 00191 lbmEntry, bitmapTupleAccessor, pBuf, bufSize, nBitmaps, includeKeys); 00192 00193 assert(bufSize <= fullBufSize); 00194 }
void LbmExecStreamTestBase::produceEntry | ( | LbmEntry & | lbmEntry, | |
TupleAccessor & | bitmapTupleAccessor, | |||
BitmapInput & | bmInput | |||
) | [protected, inherited] |
Definition at line 95 of file LbmExecStreamTestBase.cpp.
References LbmExecStreamTestBase::bitmapTupleAccessor, BitmapInput::bufArray, BitmapInput::currBufSize, TupleAccessor::getCurrentByteCount(), TupleAccessor::marshal(), BitmapInput::nBitmaps, and LbmEntry::produceEntryTuple().
Referenced by LbmExecStreamTestBase::generateBitmaps().
00098 { 00099 TupleData bitmapTuple = lbmEntry.produceEntryTuple(); 00100 bitmapTupleAccessor.marshal( 00101 bitmapTuple, bmInput.bufArray.get() + bmInput.currBufSize); 00102 bmInput.currBufSize += bitmapTupleAccessor.getCurrentByteCount(); 00103 ++bmInput.nBitmaps; 00104 }
void LbmExecStreamTestBase::produceEntry | ( | LbmEntry & | lbmEntry, | |
TupleAccessor & | bitmapTupleAccessor, | |||
PBuffer | pBuf, | |||
uint & | bufSize, | |||
uint & | nBitmaps, | |||
bool | includeKeys | |||
) | [protected, inherited] |
Definition at line 196 of file LbmExecStreamTestBase.cpp.
References LbmExecStreamTestBase::bitmapTupleAccessor, LbmExecStreamTestBase::bitmapTupleData, TupleAccessor::getCurrentByteCount(), LbmExecStreamTestBase::keyBitmapTupleAccessor, LbmExecStreamTestBase::keyBitmapTupleData, TupleAccessor::marshal(), and LbmEntry::produceEntryTuple().
00199 { 00200 TupleData bitmapTuple = lbmEntry.produceEntryTuple(); 00201 if (includeKeys) { 00202 int nKeys = keyBitmapTupleData.size() - bitmapTuple.size(); 00203 assert(nKeys > 0); 00204 for (uint i = 0; i < bitmapTupleData.size(); i++) { 00205 keyBitmapTupleData[nKeys + i] = bitmapTuple[i]; 00206 } 00207 keyBitmapTupleAccessor.marshal(keyBitmapTupleData, pBuf + bufSize); 00208 bufSize += keyBitmapTupleAccessor.getCurrentByteCount(); 00209 } else { 00210 bitmapTupleAccessor.marshal(bitmapTuple, pBuf + bufSize); 00211 bufSize += bitmapTupleAccessor.getCurrentByteCount(); 00212 } 00213 ++nBitmaps; 00214 }
void LbmExecStreamTestBase::initValuesExecStream | ( | uint | idx, | |
ValuesExecStreamParams & | valuesParams, | |||
ExecStreamEmbryo & | valuesStreamEmbryo, | |||
BitmapInput & | bmInput | |||
) | [protected, inherited] |
Definition at line 106 of file LbmExecStreamTestBase.cpp.
References LbmExecStreamTestBase::bitmapTupleDesc, BitmapInput::bufArray, ValuesExecStreamParams::bufSize, BitmapInput::currBufSize, ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), SingleOutputExecStreamParams::outputTupleDesc, and ValuesExecStreamParams::pTupleBuffer.
Referenced by LbmIntersectExecStreamTest::testIntersect(), testMinus(), testRestartingMinus(), and LbmUnionExecStreamTest::testUnion().
00109 { 00110 valuesParams.outputTupleDesc = bitmapTupleDesc; 00111 valuesParams.pTupleBuffer = bmInput.bufArray; 00112 valuesParams.bufSize = bmInput.currBufSize; 00113 00114 valuesStreamEmbryo.init(new ValuesExecStream(), valuesParams); 00115 std::ostringstream oss; 00116 oss << "InputValuesExecStream" << "#" << idx; 00117 valuesStreamEmbryo.getStream()->setName(oss.str()); 00118 }
void LbmExecStreamTestBase::initSorterExecStream | ( | ExternalSortExecStreamParams & | params, | |
ExecStreamEmbryo & | embryo, | |||
TupleDescriptor const & | outputDesc, | |||
uint | nKeys = 1 | |||
) | [protected, inherited] |
Definition at line 120 of file LbmExecStreamTestBase.cpp.
References ExternalSortExecStreamParams::distinctness, DUP_ALLOW, ExternalSortExecStreamParams::earlyClose, ExternalSortExecStreamParams::estimatedNumRows, ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), ExternalSortExecStreamParams::keyProj, MAXU, ExternalSortExecStream::newExternalSortExecStream(), CacheTestBase::pCache, SegStorageTestBase::pRandomSegment, SegStorageTestBase::pSegmentFactory, ExternalSortExecStreamParams::pTempSegment, and ExternalSortExecStreamParams::storeFinalRun.
Referenced by LbmSortedAggExecStreamTest::testSortedAgg(), and LbmUnionExecStreamTest::testUnion().
00125 { 00126 params.outputTupleDesc = outputDesc; 00127 params.distinctness = DUP_ALLOW; 00128 params.pTempSegment = pRandomSegment; 00129 params.pCacheAccessor = pCache; 00130 params.scratchAccessor = 00131 pSegmentFactory->newScratchSegment(pCache, 10); 00132 params.keyProj.clear(); 00133 for (uint i = 0; i < nKeys; i++) { 00134 params.keyProj.push_back(i); 00135 } 00136 params.storeFinalRun = false; 00137 params.estimatedNumRows = MAXU; 00138 params.earlyClose = false; 00139 00140 embryo.init(ExternalSortExecStream::newExternalSortExecStream(), params); 00141 embryo.getStream()->setName("SorterExecStream"); 00142 }
void LbmExecStreamTestBase::initNormalizerExecStream | ( | LbmNormalizerExecStreamParams & | params, | |
ExecStreamEmbryo & | embryo, | |||
uint | nKeys | |||
) | [protected, inherited] |
Definition at line 144 of file LbmExecStreamTestBase.cpp.
References ExecStreamEmbryo::getStream(), ExecStreamEmbryo::init(), LbmExecStreamTestBase::keyBitmapTupleDesc, LbmNormalizerExecStreamParams::keyProj, and TupleDescriptor::projectFrom().
Referenced by LbmNormalizerExecStreamTest::testNormalizer(), and testRestartingMinus().
00148 { 00149 TupleProjection keyProj; 00150 for (int i = 0; i < nKeys; i++) { 00151 keyProj.push_back(i); 00152 } 00153 params.keyProj = keyProj; 00154 00155 TupleDescriptor keyDesc; 00156 keyDesc.projectFrom(keyBitmapTupleDesc, keyProj); 00157 params.outputTupleDesc = keyDesc; 00158 00159 embryo.init(new LbmNormalizerExecStream(), params); 00160 embryo.getStream()->setName("Normalizer"); 00161 }
uint LbmExecStreamTestBase::resultBitmapSize | ( | uint | start, | |
uint | end | |||
) | [inline, protected, inherited] |
Calculates size of result bitmap.
start | start of result range, inclusive | |
end | end of result range, exclusive |
Definition at line 339 of file LbmExecStreamTestBase.h.
Referenced by test2Inputs(), LbmIntersectExecStreamTest::test2Inputs(), test3Inputs(), LbmIntersectExecStreamTest::test3Inputs(), testAnchorLarger1(), testAnchorLarger2(), testChildrenLarger(), LbmIntersectExecStreamTest::testGaps(), LbmIntersectExecStreamTest::testLargeInputs(), testLargeOutput(), LbmIntersectExecStreamTest::testLargeOutput(), LbmIntersectExecStreamTest::testSingleBitmaps(), LbmUnionExecStreamTest::testUnion(), and LbmIntersectExecStreamTest::testZeros().
00340 { 00341 return resultBitmapSize(end - start); 00342 }
Definition at line 344 of file LbmExecStreamTestBase.h.
00345 { 00346 // the result bitmap should be large enough for all rids in range, 00347 // nRids/8, plus extra space that allows the segment builder some 00348 // breathing room to operate 00349 uint extraSpace = 16; 00350 return (nRids / 8) + extraSpace; 00351 }
void LbmExecStreamTestBase::initKeyBitmap | ( | uint | nRows, | |
std::vector< int > const & | repeatSeqValues | |||
) | [protected, inherited] |
Initialize bitmaps with keys.
Definition at line 216 of file LbmExecStreamTestBase.cpp.
References LbmExecStreamTestBase::attrDesc_int64, LbmExecStreamTestBase::bitmapTupleDesc, TupleData::compute(), TupleAccessor::compute(), FixedBuffer, LbmExecStreamTestBase::generateBitmaps(), TupleAccessor::getMaxByteCount(), LbmExecStreamTestBase::getTupleInterval(), LbmExecStreamTestBase::keyBitmapBuf, LbmExecStreamTestBase::keyBitmapBufSize, LbmExecStreamTestBase::keyBitmapTupleAccessor, LbmExecStreamTestBase::keyBitmapTupleData, and LbmExecStreamTestBase::keyBitmapTupleDesc.
Referenced by LbmNormalizerExecStreamTest::testNormalizer(), testRestartingMinus(), and LbmSortedAggExecStreamTest::testSortedAgg().
00219 { 00220 // find the interval for which the entire tuple's sequence repeats 00221 uint skipRows = getTupleInterval(repeatSeqValues); 00222 00223 // generate a key bitmap for each distinct input value... 00224 // configure descriptor 00225 uint nInputKeys = repeatSeqValues.size(); 00226 keyBitmapTupleDesc.clear(); 00227 for (uint i = 0; i < nInputKeys; i++) { 00228 keyBitmapTupleDesc.push_back(attrDesc_int64); 00229 } 00230 for (uint i = 0; i < bitmapTupleDesc.size(); i++) { 00231 keyBitmapTupleDesc.push_back(bitmapTupleDesc[i]); 00232 } 00233 00234 // configure accessor and key data (bitmap data handled elsewhere) 00235 keyBitmapTupleAccessor.compute(keyBitmapTupleDesc); 00236 keyBitmapTupleData.compute(keyBitmapTupleDesc); 00237 boost::scoped_array<uint64_t> vals(new uint64_t[nInputKeys]); 00238 for (uint i = 0; i < nInputKeys; i++) { 00239 keyBitmapTupleData[i].pData = (PConstBuffer) &vals[i]; 00240 } 00241 00242 uint fullBufSize = nRows * keyBitmapTupleAccessor.getMaxByteCount(); 00243 keyBitmapBuf.reset(new FixedBuffer[fullBufSize]); 00244 PBuffer pBuf = keyBitmapBuf.get(); 00245 keyBitmapBufSize = 0; 00246 uint nBitmaps = 0; 00247 for (uint i = 0; i < skipRows; i++) { 00248 // generate input keys 00249 for (uint j = 0; j < nInputKeys; j++) { 00250 vals[j] = i % repeatSeqValues[j]; 00251 } 00252 generateBitmaps( 00253 nRows, i, skipRows, pBuf, keyBitmapBufSize, 00254 fullBufSize, nBitmaps, true); 00255 } 00256 }
void LbmExecStreamTestBase::testCaseSetUp | ( | ) | [virtual, inherited] |
Equivalent to JUnit TestCase.setUp; this is called before each test case method is invoked.
Default is no-op.
Reimplemented from ExecStreamUnitTestBase.
Reimplemented in LbmSearchTest.
Definition at line 274 of file LbmExecStreamTestBase.cpp.
References LbmExecStreamTestBase::attrDesc_bitmap, LbmExecStreamTestBase::attrDesc_int64, LbmExecStreamTestBase::bitmapColSize, LbmExecStreamTestBase::bitmapTupleAccessor, LbmExecStreamTestBase::bitmapTupleData, LbmExecStreamTestBase::bitmapTupleDesc, TupleAccessor::compute(), TupleData::compute(), StandardTypeDescriptorFactory::newDataType(), SegStorageTestBase::pRandomSegment, STANDARD_TYPE_INT_64, STANDARD_TYPE_VARBINARY, LbmExecStreamTestBase::stdTypeFactory, and ExecStreamUnitTestBase::testCaseSetUp().
Referenced by LbmSearchTest::testCaseSetUp().
00275 { 00276 ExecStreamUnitTestBase::testCaseSetUp(); 00277 00278 bitmapColSize = pRandomSegment->getUsablePageSize() / 8; 00279 attrDesc_bitmap = TupleAttributeDescriptor( 00280 stdTypeFactory.newDataType(STANDARD_TYPE_VARBINARY), 00281 true, bitmapColSize); 00282 attrDesc_int64 = TupleAttributeDescriptor( 00283 stdTypeFactory.newDataType(STANDARD_TYPE_INT_64)); 00284 00285 bitmapTupleDesc.clear(); 00286 bitmapTupleDesc.push_back(attrDesc_int64); 00287 bitmapTupleDesc.push_back(attrDesc_bitmap); 00288 bitmapTupleDesc.push_back(attrDesc_bitmap); 00289 00290 bitmapTupleData.compute(bitmapTupleDesc); 00291 bitmapTupleData[1].pData = NULL; 00292 bitmapTupleData[1].cbData = 0; 00293 bitmapTupleData[2].pData = NULL; 00294 bitmapTupleData[2].cbData = 0; 00295 00296 bitmapTupleAccessor.compute(bitmapTupleDesc); 00297 }
uint LbmExecStreamTestBase::getTupleInterval | ( | std::vector< int > const & | repeatSeqValues, | |
uint | nKeys = 0 | |||
) | [static, inherited] |
Find the interval for which an entire tuple's sequence repeats.
Definition at line 261 of file LbmExecStreamTestBase.cpp.
Referenced by LbmExecStreamTestBase::initKeyBitmap(), NormalizerExecStreamGenerator::NormalizerExecStreamGenerator(), RestartingMinusExecStreamGenerator::RestartingMinusExecStreamGenerator(), SortedAggExecStreamGenerator::SortedAggExecStreamGenerator(), and LbmSortedAggExecStreamTest::testSortedAgg().
00263 { 00264 if (nKeys == 0) { 00265 nKeys = repeatSeqValues.size(); 00266 } 00267 uint interval = 1; 00268 for (uint i = 0; i < nKeys; i++) { 00269 interval *= repeatSeqValues[i]; 00270 } 00271 return interval; 00272 }
SharedExecStream ExecStreamUnitTestBase::prepareSourceGraph | ( | ExecStreamEmbryo & | sourceStreamEmbryo | ) | [protected, inherited] |
Defines and prepares a graph consisting of one source stream.
sourceStreamEmbryo | embryonic source stream which produces tuples |
Definition at line 41 of file ExecStreamUnitTestBase.cpp.
References ExecStreamUnitTestBase::prepareTransformGraph().
Referenced by FlatFileExecStreamTest::testStream().
00043 { 00044 std::vector<ExecStreamEmbryo> transforms; 00045 return prepareTransformGraph(sourceStreamEmbryo, transforms); 00046 }
SharedExecStream ExecStreamUnitTestBase::prepareTransformGraph | ( | ExecStreamEmbryo & | sourceStreamEmbryo, | |
ExecStreamEmbryo & | transformStreamEmbryo | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of one source stream and one transform stream.
sourceStreamEmbryo | embryonic source stream which produces tuples | |
transformStreamEmbryo | embryonic transform stream which processes tuples produced by sourceStreamEmbryo |
Definition at line 48 of file ExecStreamUnitTestBase.cpp.
Referenced by LcsClusterReplaceExecStreamTest::loadCluster(), LcsRowScanExecStreamTest::loadOneCluster(), ExecStreamUnitTestBase::prepareSourceGraph(), LcsClusterReplaceExecStreamTest::replaceCluster(), LcsMultiClusterAppendTest::scanCols(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), CollectExecStreamTestSuite::testCollectCollectUncollectUncollect(), CollectExecStreamTestSuite::testCollectInts(), CollectExecStreamTestSuite::testCollectUncollect(), CalcExecStreamTestSuite::testConstant(), ExecStreamTestSuite::testCopyExecStream(), ExecStreamTestSuite::testCountAggExecStream(), LhxAggExecStreamTest::testCountImpl(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamTestSuite::testGroupAggExecStreamNrows(), LhxAggExecStreamTest::testGroupCountImpl(), ExternalSortExecStreamTest::testImpl(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), LbmNormalizerExecStreamTest::testNormalizer(), ExecStreamTestSuite::testReshapeExecStream(), LcsRowScanExecStreamTest::testSampleScanCols(), LcsRowScanExecStreamTest::testScanCols(), LbmSearchTest::testScanIdx(), LcsClusterAppendExecStreamTest::testScanMultiCol(), LcsClusterAppendExecStreamTest::testScanSingleCol(), ExecStreamTestSuite::testScratchBufferExecStream(), ExecStreamTestSuite::testSegBufferExecStream(), ExecStreamTestSuite::testSingleValueAggExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), LbmSortedAggExecStreamTest::testSortedAgg(), ExecStreamTestSuite::testSumAggExecStream(), LhxAggExecStreamTest::testSumImpl(), LbmUnionExecStreamTest::testUnion(), and LcsClusterReplaceExecStreamTest::verifyCluster().
00051 { 00052 std::vector<ExecStreamEmbryo> transforms; 00053 transforms.push_back(transformStreamEmbryo); 00054 return prepareTransformGraph(sourceStreamEmbryo, transforms); 00055 }
SharedExecStream ExecStreamUnitTestBase::prepareTransformGraph | ( | ExecStreamEmbryo & | sourceStreamEmbryo, | |
std::vector< ExecStreamEmbryo > & | transforms | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of one source stream and one or multiple transform streams.
sourceStreamEmbryo | embryonic source stream which produces tuples | |
transforms | embryonic transform streams which process tuples produced by sourceStreamEmbryo or a child stream |
Definition at line 57 of file ExecStreamUnitTestBase.cpp.
References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.
00060 { 00061 pGraphEmbryo->saveStreamEmbryo(sourceStreamEmbryo); 00062 std::vector<ExecStreamEmbryo>::iterator it; 00063 00064 // save all transforms 00065 for (it = transforms.begin(); it != transforms.end(); ++it) { 00066 pGraphEmbryo->saveStreamEmbryo(*it); 00067 } 00068 00069 // connect streams in a cascade 00070 ExecStreamEmbryo& previousStream = sourceStreamEmbryo; 00071 for (it = transforms.begin(); it != transforms.end(); ++it) { 00072 pGraphEmbryo->addDataflow( 00073 previousStream.getStream()->getName(), 00074 (*it).getStream()->getName()); 00075 previousStream = *it; 00076 } 00077 00078 SharedExecStream pAdaptedStream = 00079 pGraphEmbryo->addAdapterFor( 00080 previousStream.getStream()->getName(), 00081 0, 00082 BUFPROV_PRODUCER); 00083 pGraph->addOutputDataflow(pAdaptedStream->getStreamId()); 00084 00085 pGraphEmbryo->prepareGraph(shared_from_this(), ""); 00086 return pAdaptedStream; 00087 }
SharedExecStream ExecStreamUnitTestBase::prepareConfluenceGraph | ( | ExecStreamEmbryo & | sourceStreamEmbryo1, | |
ExecStreamEmbryo & | sourceStreamEmbryo2, | |||
ExecStreamEmbryo & | confluenceStreamEmbryo | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of two source streams and one confluence stream.
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 |
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(), testMinus(), and ExecStreamTestSuite::testNestedLoopJoinExecStream().
00093 { 00094 std::vector<ExecStreamEmbryo> sourceStreamEmbryos; 00095 sourceStreamEmbryos.push_back(sourceStreamEmbryo1); 00096 sourceStreamEmbryos.push_back(sourceStreamEmbryo2); 00097 return prepareConfluenceGraph(sourceStreamEmbryos, confluenceStreamEmbryo); 00098 }
SharedExecStream ExecStreamUnitTestBase::prepareConfluenceGraph | ( | std::vector< ExecStreamEmbryo > & | sourceStreamEmbryos, | |
ExecStreamEmbryo & | confluenceStreamEmbryo | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of a list of source streams and one confluence stream.
sourceStreamEmbryos | list of embryonic source streams that produce tuples | |
confluenceStreamEmbryo | embryonic confluence stream which processes tuples produced by the sourceStreamEmbryos |
Definition at line 155 of file ExecStreamUnitTestBase.cpp.
References ExecStreamUnitTestBase::prepareConfluenceGraph().
00158 { 00159 std::vector<std::vector<ExecStreamEmbryo> > sourceStreamEmbryosList; 00160 std::vector<ExecStreamEmbryo>::iterator it; 00161 std::vector<ExecStreamEmbryo> sourceStreamList; 00162 for (it = sourceStreamEmbryos.begin(); it != sourceStreamEmbryos.end(); 00163 it++) 00164 { 00165 sourceStreamList.clear(); 00166 sourceStreamList.push_back(*it); 00167 sourceStreamEmbryosList.push_back(sourceStreamList); 00168 } 00169 00170 return 00171 prepareConfluenceGraph(sourceStreamEmbryosList, confluenceStreamEmbryo); 00172 }
SharedExecStream ExecStreamUnitTestBase::prepareConfluenceGraph | ( | std::vector< std::vector< ExecStreamEmbryo > > & | sourceStreamEmbryosList, | |
ExecStreamEmbryo & | confluenceStreamEmbryo | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of one or more source streams and one confluence stream.
Each source stream can be a list of streams.
sourceStreamEmbryosList | list of embryonic source streams which produce tuples | |
confluenceStreamEmbryo | embryonic confluence stream which processes tuples produced by the source streams |
Definition at line 174 of file ExecStreamUnitTestBase.cpp.
References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.
00177 { 00178 pGraphEmbryo->saveStreamEmbryo(confluenceStreamEmbryo); 00179 00180 for (int i = 0; i < sourceStreamEmbryosList.size(); i++) { 00181 for (int j = 0; j < sourceStreamEmbryosList[i].size(); j++) { 00182 pGraphEmbryo->saveStreamEmbryo(sourceStreamEmbryosList[i][j]); 00183 } 00184 00185 // connect streams in each sourceStreamEmbryos list in a cascade 00186 for (int j = 1; j < sourceStreamEmbryosList[i].size(); j++) { 00187 pGraphEmbryo->addDataflow( 00188 sourceStreamEmbryosList[i][j - 1].getStream()->getName(), 00189 sourceStreamEmbryosList[i][j].getStream()->getName()); 00190 } 00191 pGraphEmbryo->addDataflow( 00192 sourceStreamEmbryosList[i].back().getStream()->getName(), 00193 confluenceStreamEmbryo.getStream()->getName()); 00194 } 00195 00196 SharedExecStream pAdaptedStream = 00197 pGraphEmbryo->addAdapterFor( 00198 confluenceStreamEmbryo.getStream()->getName(), 0, 00199 BUFPROV_PRODUCER); 00200 pGraph->addOutputDataflow( 00201 pAdaptedStream->getStreamId()); 00202 00203 pGraphEmbryo->prepareGraph(shared_from_this(), ""); 00204 00205 return pAdaptedStream; 00206 }
SharedExecStream ExecStreamUnitTestBase::prepareConfluenceTransformGraph | ( | ExecStreamEmbryo & | sourceStreamEmbryo1, | |
ExecStreamEmbryo & | sourceStreamEmbryo2, | |||
ExecStreamEmbryo & | confluenceStreamEmbryo, | |||
ExecStreamEmbryo & | transformStreamEmbryo | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of two source streams, one confluence stream, and one transform stream.
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 |
Definition at line 100 of file ExecStreamUnitTestBase.cpp.
References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.
Referenced by LhxJoinExecStreamTest::testImpl(), and testRestartingMinus().
00105 { 00106 std::vector<ExecStreamEmbryo> sourceStreamEmbryos; 00107 sourceStreamEmbryos.push_back(sourceStreamEmbryo1); 00108 sourceStreamEmbryos.push_back(sourceStreamEmbryo2); 00109 00110 std::vector<ExecStreamEmbryo>::iterator it; 00111 00112 for (it = sourceStreamEmbryos.begin(); it != sourceStreamEmbryos.end(); 00113 ++it) 00114 { 00115 pGraphEmbryo->saveStreamEmbryo(*it); 00116 } 00117 pGraphEmbryo->saveStreamEmbryo(confluenceStreamEmbryo); 00118 00119 for (it = sourceStreamEmbryos.begin(); it != sourceStreamEmbryos.end(); 00120 ++it) 00121 { 00122 pGraphEmbryo->addDataflow( 00123 (*it).getStream()->getName(), 00124 confluenceStreamEmbryo.getStream()->getName()); 00125 } 00126 00127 std::vector<ExecStreamEmbryo> transforms; 00128 transforms.push_back(transformStreamEmbryo); 00129 ExecStreamEmbryo& previousStream = confluenceStreamEmbryo; 00130 00131 // save all transforms 00132 for (it = transforms.begin(); it != transforms.end(); ++it) { 00133 pGraphEmbryo->saveStreamEmbryo(*it); 00134 } 00135 00136 for (it = transforms.begin(); it != transforms.end(); ++it) { 00137 pGraphEmbryo->addDataflow( 00138 previousStream.getStream()->getName(), 00139 (*it).getStream()->getName()); 00140 previousStream = *it; 00141 } 00142 00143 00144 SharedExecStream pAdaptedStream = 00145 pGraphEmbryo->addAdapterFor( 00146 previousStream.getStream()->getName(), 00147 0, 00148 BUFPROV_PRODUCER); 00149 pGraph->addOutputDataflow(pAdaptedStream->getStreamId()); 00150 00151 pGraphEmbryo->prepareGraph(shared_from_this(), ""); 00152 return pAdaptedStream; 00153 }
SharedExecStream ExecStreamUnitTestBase::prepareDAG | ( | ExecStreamEmbryo & | srcStreamEmbryo, | |
ExecStreamEmbryo & | splitterStreamEmbryo, | |||
std::vector< ExecStreamEmbryo > & | interStreamEmbryos, | |||
ExecStreamEmbryo & | destStreamEmbryo, | |||
bool | createSink = true , |
|||
bool | saveSrc = true | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of a source, a splitter, and one or more parallel transform streams which flow together into a confluence stream.
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 |
Definition at line 208 of file ExecStreamUnitTestBase.cpp.
Referenced by LcsMultiClusterAppendTest::loadClusters(), LbmSearchTest::loadTableAndIndex(), LbmLoadBitmapTest::testLoad(), ExecStreamTestSuite::testMergeImplicitPullInputs(), ExecStreamTestSuite::testSegBufferReaderWriterExecStream(), and ExecStreamTestSuite::testSplitterPlusBarrier().
00215 { 00216 std::vector<std::vector<ExecStreamEmbryo> > listOfList; 00217 00218 // Convert interStreamEmbryos to a vector of vectors. E.g., if 00219 // interStreamEmbryos contains (1, 2, 3), it will get converted to: 00220 // ((1)) ((2)) ((3)) 00221 for (uint i = 0; i < interStreamEmbryos.size(); i++) { 00222 std::vector<ExecStreamEmbryo> interStreamEmbryoList; 00223 00224 interStreamEmbryoList.push_back(interStreamEmbryos[i]); 00225 listOfList.push_back(interStreamEmbryoList); 00226 } 00227 return prepareDAG( 00228 srcStreamEmbryo, splitterStreamEmbryo, listOfList, destStreamEmbryo, 00229 createSink, saveSrc); 00230 }
SharedExecStream ExecStreamUnitTestBase::prepareDAG | ( | ExecStreamEmbryo & | srcStreamEmbryo, | |
ExecStreamEmbryo & | splitterStreamEmbryo, | |||
std::vector< std::vector< ExecStreamEmbryo > > & | interStreamEmbryosList, | |||
ExecStreamEmbryo & | destStreamEmbryo, | |||
bool | createSink = true , |
|||
bool | saveSrc = true | |||
) | [protected, inherited] |
Defines and prepares a graph consisting of a source, a splitter, and one or more parallel transform streams which flow together into a confluence stream.
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 |
Definition at line 232 of file ExecStreamUnitTestBase.cpp.
References BUFPROV_PRODUCER, ExecStreamEmbryo::getStream(), ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.
00239 { 00240 if (saveSrc) { 00241 pGraphEmbryo->saveStreamEmbryo(srcStreamEmbryo); 00242 } 00243 pGraphEmbryo->saveStreamEmbryo(splitterStreamEmbryo); 00244 00245 // save all intermediate stream embryos 00246 for (int i = 0; i < interStreamEmbryos.size(); i++) { 00247 for (int j = 0; j < interStreamEmbryos[i].size(); j++) { 00248 pGraphEmbryo->saveStreamEmbryo(interStreamEmbryos[i][j]); 00249 } 00250 00251 // connect streams in each interStreamEmbryos list in a cascade 00252 for (int j = 1; j < interStreamEmbryos[i].size(); j++) { 00253 pGraphEmbryo->addDataflow( 00254 interStreamEmbryos[i][j - 1].getStream()->getName(), 00255 interStreamEmbryos[i][j].getStream()->getName()); 00256 } 00257 } 00258 00259 pGraphEmbryo->saveStreamEmbryo(destStreamEmbryo); 00260 00261 pGraphEmbryo->addDataflow( 00262 srcStreamEmbryo.getStream()->getName(), 00263 splitterStreamEmbryo.getStream()->getName()); 00264 00265 // connect all inter streams to src and dest 00266 for (int i = 0; i < interStreamEmbryos.size(); i++) { 00267 pGraphEmbryo->addDataflow( 00268 splitterStreamEmbryo.getStream()->getName(), 00269 interStreamEmbryos[i][0].getStream()->getName()); 00270 pGraphEmbryo->addDataflow( 00271 interStreamEmbryos[i].back().getStream()->getName(), 00272 destStreamEmbryo.getStream()->getName()); 00273 } 00274 00275 SharedExecStream pAdaptedStream; 00276 00277 if (createSink) { 00278 pAdaptedStream = pGraphEmbryo->addAdapterFor( 00279 destStreamEmbryo.getStream()->getName(), 0, 00280 BUFPROV_PRODUCER); 00281 pGraph->addOutputDataflow(pAdaptedStream->getStreamId()); 00282 00283 pGraphEmbryo->prepareGraph(shared_from_this(), ""); 00284 } 00285 00286 return pAdaptedStream; 00287 }
void ExecStreamUnitTestBase::verifyOutput | ( | ExecStream & | stream, | |
uint | nRowsExpected, | |||
MockProducerExecStreamGenerator & | verifier, | |||
bool | stopEarly = false | |||
) | [protected, inherited] |
Executes the prepared stream graph and verifies that its output matches that produced by a value generator.
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(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamTestSuite::testBTreeInsertExecStream(), CollectExecStreamTestSuite::testCollectCollectUncollectUncollect(), CollectExecStreamTestSuite::testCollectUncollect(), CorrelationJoinExecStreamTestSuite::testCorrelationJoin(), ExecStreamTestSuite::testCountAggExecStream(), LhxAggExecStreamTest::testCountImpl(), ExecStreamTestSuite::testDoubleBufferExecStream(), LcsRowScanExecStreamTest::testFilterCols(), ExecStreamTestSuite::testGroupAggExecStreamNrows(), LhxAggExecStreamTest::testGroupCountImpl(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), ExecStreamTestSuite::testMergeImplicitPullInputs(), ExecStreamTestSuite::testNestedLoopJoinExecStream(), LbmNormalizerExecStreamTest::testNormalizer(), ExecStreamTestSuite::testReshapeExecStream(), 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 // TODO: assertions about output tuple 00332 00333 pResourceGovernor->requestResources(*pGraph); 00334 pGraph->open(); 00335 pScheduler->start(); 00336 uint nRows = 0; 00337 for (;;) { 00338 ExecStreamBufAccessor &bufAccessor = 00339 pScheduler->readStream(stream); 00340 if (bufAccessor.getState() == EXECBUF_EOS) { 00341 break; 00342 } 00343 BOOST_REQUIRE(bufAccessor.isConsumptionPossible()); 00344 const uint nCol = 00345 bufAccessor.getConsumptionTupleAccessor().size(); 00346 BOOST_REQUIRE(nCol == bufAccessor.getTupleDesc().size()); 00347 BOOST_REQUIRE(nCol >= 1); 00348 TupleData inputTuple; 00349 inputTuple.compute(bufAccessor.getTupleDesc()); 00350 for (;;) { 00351 if (!bufAccessor.demandData()) { 00352 break; 00353 } 00354 BOOST_REQUIRE(nRows < nRowsExpected); 00355 bufAccessor.unmarshalTuple(inputTuple); 00356 for (int col = 0; col < nCol; ++col) { 00357 int64_t actualValue = 00358 *reinterpret_cast<int64_t const *>(inputTuple[col].pData); 00359 int64_t expectedValue = generator.generateValue(nRows, col); 00360 if (actualValue != expectedValue) { 00361 std::cout << "(Row, Col) = (" << nRows << ", " << col <<")" 00362 << std::endl; 00363 BOOST_CHECK_EQUAL(expectedValue,actualValue); 00364 return; 00365 } 00366 } 00367 bufAccessor.consumeTuple(); 00368 ++nRows; 00369 if (stopEarly && nRows == nRowsExpected) { 00370 return; 00371 } 00372 } 00373 } 00374 BOOST_CHECK_EQUAL(nRowsExpected,nRows); 00375 }
void ExecStreamUnitTestBase::verifyConstantOutput | ( | ExecStream & | stream, | |
const TupleData & | expectedTuple, | |||
uint | nRowsExpected | |||
) | [protected, inherited] |
Executes the prepared stream graph and verifies that all output tuples matche an expected and given one.
stream | output stream from which to read | |
expectedTuple | ||
nRowsExpected |
Definition at line 377 of file ExecStreamUnitTestBase.cpp.
References TupleData::compute(), EXECBUF_EOS, ExecStreamUnitTestBase::pGraph, ExecStreamTestBase::pResourceGovernor, TuplePrinter::print(), and ExecStreamTestBase::pScheduler.
Referenced by ExecStreamTestSuite::testCartesianJoinExecStream(), CollectExecStreamTestSuite::testCollectInts(), CalcExecStreamTestSuite::testConstant(), ExecStreamTestSuite::testCopyExecStream(), ExecStreamGovernorTest::testGovernor(), ExecStreamTestSuite::testMergeExecStream(), ExecStreamTestSuite::testSegBufferExecStream(), and ExecStreamTestSuite::testSegBufferReaderWriterExecStream().
00381 { 00382 // TODO: assertions about output tuple 00383 00384 pResourceGovernor->requestResources(*pGraph); 00385 pGraph->open(); 00386 pScheduler->start(); 00387 uint nRows = 0; 00388 for (;;) { 00389 ExecStreamBufAccessor &bufAccessor = 00390 pScheduler->readStream(stream); 00391 if (bufAccessor.getState() == EXECBUF_EOS) { 00392 break; 00393 } 00394 BOOST_REQUIRE(bufAccessor.isConsumptionPossible()); 00395 00396 if (!bufAccessor.demandData()) { 00397 break; 00398 } 00399 BOOST_REQUIRE(nRows < nRowsExpected); 00400 00401 TupleData actualTuple; 00402 actualTuple.compute(bufAccessor.getTupleDesc()); 00403 bufAccessor.unmarshalTuple(actualTuple); 00404 00405 int c = bufAccessor.getTupleDesc().compareTuples( 00406 expectedTuple, actualTuple); 00407 bufAccessor.consumeTuple(); 00408 ++nRows; 00409 if (c) { 00410 #if 1 00411 TupleDescriptor statusDesc = bufAccessor.getTupleDesc(); 00412 TuplePrinter tuplePrinter; 00413 tuplePrinter.print(std::cout, statusDesc, actualTuple); 00414 tuplePrinter.print(std::cout, statusDesc, expectedTuple); 00415 std::cout << std::endl; 00416 #endif 00417 BOOST_CHECK_EQUAL(0,c); 00418 break; 00419 } 00420 } 00421 BOOST_CHECK_EQUAL(nRowsExpected, nRows); 00422 }
void ExecStreamUnitTestBase::verifyBufferedOutput | ( | ExecStream & | stream, | |
TupleDescriptor | outputTupleDesc, | |||
uint | nRowsExpected, | |||
PBuffer | expectedBuffer | |||
) | [protected, inherited] |
Executes the prepared stream graph and verifies the resultant tuples against a set of tuples supplied in an input buffer.
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(), testMinus(), LbmSearchTest::testScanIdx(), and LbmUnionExecStreamTest::testUnion().
00429 { 00430 // TODO: assertions about output tuple 00431 00432 TupleAccessor expectedOutputAccessor; 00433 expectedOutputAccessor.compute(outputTupleDesc); 00434 TupleData expectedTuple(outputTupleDesc); 00435 uint bufOffset = 0; 00436 pResourceGovernor->requestResources(*pGraph); 00437 pGraph->open(); 00438 pScheduler->start(); 00439 uint nRows = 0; 00440 for (;;) { 00441 ExecStreamBufAccessor &bufAccessor = 00442 pScheduler->readStream(stream); 00443 if (bufAccessor.getState() == EXECBUF_EOS) { 00444 break; 00445 } 00446 BOOST_REQUIRE(bufAccessor.getTupleDesc() == outputTupleDesc); 00447 BOOST_REQUIRE(bufAccessor.isConsumptionPossible()); 00448 const uint nCol = 00449 bufAccessor.getConsumptionTupleAccessor().size(); 00450 BOOST_REQUIRE(nCol == bufAccessor.getTupleDesc().size()); 00451 BOOST_REQUIRE(nCol >= 1); 00452 TupleData inputTuple; 00453 inputTuple.compute(bufAccessor.getTupleDesc()); 00454 for (;;) { 00455 if (!bufAccessor.demandData()) { 00456 break; 00457 } 00458 BOOST_REQUIRE(nRows < nRowsExpected); 00459 bufAccessor.unmarshalTuple(inputTuple); 00460 expectedOutputAccessor.setCurrentTupleBuf( 00461 expectedBuffer + bufOffset); 00462 expectedOutputAccessor.unmarshal(expectedTuple); 00463 int c = outputTupleDesc.compareTuples(inputTuple, expectedTuple); 00464 if (c) { 00465 std::cout << "(Row) = (" << nRows << ")" 00466 << " -- Tuples don't match"<< std::endl; 00467 BOOST_CHECK_EQUAL(0,c); 00468 return; 00469 } 00470 bufAccessor.consumeTuple(); 00471 bufOffset += expectedOutputAccessor.getCurrentByteCount(); 00472 ++nRows; 00473 } 00474 } 00475 BOOST_CHECK_EQUAL(nRowsExpected,nRows); 00476 }
void ExecStreamUnitTestBase::resetExecStreamTest | ( | ) | [protected, inherited] |
Reset stream graph so multiple iterations of a method can be called within a single testcase.
Definition at line 305 of file ExecStreamUnitTestBase.cpp.
References ExecStreamTestBase::newScheduler(), ExecStreamTestBase::newStreamGraph(), ExecStreamTestBase::newStreamGraphEmbryo(), ExecStreamUnitTestBase::pGraph, ExecStreamUnitTestBase::pGraphEmbryo, ExecStreamTestBase::pResourceGovernor, ExecStreamTestBase::pScheduler, and ExecStreamUnitTestBase::tearDownExecStreamTest().
Referenced by LcsRowScanExecStreamTest::loadClusters(), LbmLoadBitmapTest::testAppend(), LcsRowScanExecStreamTest::testBernoulliSampling(), LcsClusterReplaceExecStreamTest::testClusterReplace(), LcsRowScanExecStreamTest::testCompressedFiltering(), LbmSplicerExecStreamTest::testLER5968(), LbmSplicerExecStreamTest::testLER6473(), LcsMultiClusterAppendTest::testLoad(), LcsClusterAppendExecStreamTest::testMultiColConstNewRoot(), LcsClusterAppendExecStreamTest::testMultiColConstOldRoot(), LcsClusterAppendExecStreamTest::testMultiColNoDupNewRoot(), LcsClusterAppendExecStreamTest::testMultiColNoDupOldRoot(), LcsClusterAppendExecStreamTest::testMultiColStairNewRoot(), LcsClusterAppendExecStreamTest::testMultiColStairOldRoot(), LbmSearchTest::testMultipleRanges(), ExecStreamGovernorTest::testReturnResources(), LbmSearchTest::testScanIdx(), LcsRowScanExecStreamTest::testScanPastEndOfCluster(), LcsRowScanExecStreamTest::testScans(), LcsClusterAppendExecStreamTest::testSingleColConstNewRoot(), LcsClusterAppendExecStreamTest::testSingleColConstOldRoot(), LcsClusterAppendExecStreamTest::testSingleColNoDupNewRoot(), LcsClusterAppendExecStreamTest::testSingleColNoDupOldRoot(), LcsClusterAppendExecStreamTest::testSingleColStairNewRoot(), LcsClusterAppendExecStreamTest::testSingleColStairOldRoot(), LbmSplicerExecStreamTest::testSpliceRids(), LbmSplicerExecStreamTest::testSpliceWithKeys(), and LcsRowScanExecStreamTest::testSystemSampling().
00306 { 00307 if (pScheduler) { 00308 pScheduler->stop(); 00309 } 00310 tearDownExecStreamTest(); 00311 00312 pScheduler.reset(newScheduler()); 00313 pGraph = newStreamGraph(); 00314 pGraphEmbryo = newStreamGraphEmbryo(pGraph); 00315 pGraph->setResourceGovernor(pResourceGovernor); 00316 }
void ExecStreamUnitTestBase::tearDownExecStreamTest | ( | ) | [protected, virtual, inherited] |
ExecStream-specific handler called from testCaseTearDown.
Reimplemented from ExecStreamTestBase.
Definition at line 319 of file ExecStreamUnitTestBase.cpp.
References ExecStreamUnitTestBase::pGraph, and ExecStreamUnitTestBase::pGraphEmbryo.
Referenced by ExecStreamUnitTestBase::resetExecStreamTest().
00320 { 00321 pGraph.reset(); 00322 pGraphEmbryo.reset(); 00323 }
SharedExecStreamGraph ExecStreamTestBase::newStreamGraph | ( | ) | [protected, virtual, inherited] |
Creates a stream graph.
Definition at line 37 of file ExecStreamTestBase.cpp.
References ExecStreamGraph::newExecStreamGraph().
Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), and ExecStreamUnitTestBase::testCaseSetUp().
00038 { 00039 SharedExecStreamGraph pGraph = ExecStreamGraph::newExecStreamGraph(); 00040 pGraph->enableDummyTxnId(true); 00041 return pGraph; 00042 }
SharedExecStreamGraphEmbryo ExecStreamTestBase::newStreamGraphEmbryo | ( | SharedExecStreamGraph | ) | [protected, virtual, inherited] |
Creates an embryo for a stream graph.
Definition at line 45 of file ExecStreamTestBase.cpp.
References CacheTestBase::pCache, ExecStreamTestBase::pScheduler, and SegStorageTestBase::pSegmentFactory.
Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), and ExecStreamUnitTestBase::testCaseSetUp().
00046 { 00047 return SharedExecStreamGraphEmbryo( 00048 new ExecStreamGraphEmbryo( 00049 g, pScheduler, pCache, pSegmentFactory)); 00050 }
ExecStreamScheduler * ExecStreamTestBase::newScheduler | ( | ) | [protected, virtual, inherited] |
Creates a scheduler.
Reimplemented in ParallelExecStreamSchedulerTest.
Definition at line 52 of file ExecStreamTestBase.cpp.
Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), and ExecStreamTestBase::testCaseSetUp().
00053 { 00054 return new DfsTreeExecStreamScheduler( 00055 shared_from_this(), 00056 "DfsTreeExecStreamScheduler"); 00057 }
ExecStreamGovernor * ExecStreamTestBase::newResourceGovernor | ( | ExecStreamResourceKnobs const & | knobSettings, | |
ExecStreamResourceQuantity const & | resourcesAvailable | |||
) | [protected, virtual, inherited] |
Creates the resource governor.
Definition at line 59 of file ExecStreamTestBase.cpp.
Referenced by ExecStreamTestBase::testCaseSetUp().
00062 { 00063 return new SimpleExecStreamGovernor( 00064 knobSettings, resourcesAvailable, shared_from_this(), 00065 "SimpleExecStreamGovernor"); 00066 }
void 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().
00083 { 00084 // first stop the scheduler 00085 if (pScheduler) { 00086 pScheduler->stop(); 00087 } 00088 pCacheAccessor.reset(); 00089 // destroy the graph 00090 tearDownExecStreamTest(); 00091 // free the scheduler last, since an ExecStreamGraph holds a raw Scheduler 00092 // ptr 00093 pScheduler.reset(); 00094 assert(pResourceGovernor.unique()); 00095 pResourceGovernor.reset(); 00096 SegStorageTestBase::testCaseTearDown(); 00097 }
void SegStorageTestBase::openStorage | ( | DeviceMode | openMode | ) | [virtual, inherited] |
Reimplemented from CacheTestBase.
Reimplemented in SegmentTestBase.
Definition at line 31 of file SegStorageTestBase.cpp.
References SegStorageTestBase::openSegmentStorage(), and CacheTestBase::openStorage().
Referenced by SegStorageTestBase::openRandomSegment(), SegmentTestBase::openStorage(), LhxHashTableTest::testCaseSetUp(), ExecStreamTestBase::testCaseSetUp(), BTreeTest::testCaseSetUp(), BTreeReadersTest::testCaseSetUp(), LbmEntryTest::testCaseSetUp(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), SegStreamTest::testMarkReset(), SegStreamTest::testReadSeg(), LogicalTxnTest::testTxn(), SegStreamTest::testWriteSeg(), and SegStreamTest::testWriteSpillAndRead().
00032 { 00033 CacheTestBase::openStorage(openMode); 00034 openSegmentStorage(openMode); 00035 }
void SegStorageTestBase::openSegmentStorage | ( | DeviceMode | openMode | ) | [virtual, inherited] |
Reimplemented in LinearViewSegmentTest, SnapshotSegmentTestBase, and VersionedSegmentTest.
Definition at line 37 of file SegStorageTestBase.cpp.
References CacheTestBase::cbPageFull, DeviceMode::create, SegStorageTestBase::createLinearDeviceSegment(), CacheTestBase::dataDeviceId, SegStorageTestBase::pLinearSegment, and CacheTestBase::pRandomAccessDevice.
Referenced by VersionedSegmentTest::openSegmentStorage(), and SegStorageTestBase::openStorage().
00038 { 00039 pLinearSegment = createLinearDeviceSegment( 00040 dataDeviceId, 00041 openMode.create ? 0 00042 : pRandomAccessDevice->getSizeInBytes() / cbPageFull); 00043 }
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(), LhxHashTableTest::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 }
StandardTypeDescriptorFactory LbmExecStreamTestBase::stdTypeFactory [protected, inherited] |
Definition at line 273 of file LbmExecStreamTestBase.h.
Referenced by LbmSearchTest::testCaseSetUp(), and LbmExecStreamTestBase::testCaseSetUp().
TupleAttributeDescriptor LbmExecStreamTestBase::attrDesc_int64 [protected, inherited] |
Definition at line 274 of file LbmExecStreamTestBase.h.
Referenced by LbmSearchTest::initBTreeTupleDesc(), LbmExecStreamTestBase::initKeyBitmap(), LbmSearchTest::loadTableAndIndex(), LbmExecStreamTestBase::testCaseSetUp(), LbmSearchTest::testScanIdx(), and LbmSortedAggExecStreamTest::testSortedAgg().
TupleAttributeDescriptor LbmExecStreamTestBase::attrDesc_bitmap [protected, inherited] |
Definition at line 275 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::testCaseSetUp().
uint LbmExecStreamTestBase::bitmapColSize [protected, inherited] |
Size of bitmap columns.
Definition at line 280 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::generateBitmaps(), and LbmExecStreamTestBase::testCaseSetUp().
TupleDescriptor LbmExecStreamTestBase::bitmapTupleDesc [protected, inherited] |
Tuple descriptor, tupledata, and accessor for a bitmap segment: (rid, segment descriptor, bitmap segments).
Definition at line 286 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::generateBitmaps(), LbmSearchTest::initBTreeTupleDesc(), LbmExecStreamTestBase::initKeyBitmap(), LbmExecStreamTestBase::initValuesExecStream(), LbmExecStreamTestBase::testCaseSetUp(), LbmIntersectExecStreamTest::testIntersect(), testMinus(), LbmSearchTest::testScanIdx(), LbmReaderTest::testSingleTupleReader(), and LbmUnionExecStreamTest::testUnion().
TupleData LbmExecStreamTestBase::bitmapTupleData [protected, inherited] |
Definition at line 287 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::generateBitmaps(), LbmExecStreamTestBase::produceEntry(), LbmExecStreamTestBase::testCaseSetUp(), and LbmReaderTest::testSingleTupleReader().
TupleAccessor LbmExecStreamTestBase::bitmapTupleAccessor [protected, inherited] |
Definition at line 288 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::generateBitmaps(), LbmExecStreamTestBase::produceEntry(), LbmExecStreamTestBase::testCaseSetUp(), LbmSearchTest::testScanIdx(), and LbmUnionExecStreamTest::testUnion().
TupleDescriptor LbmExecStreamTestBase::keyBitmapTupleDesc [protected, inherited] |
Tuple descriptor, data, and accessor for key-containting bitmaps (keys, srid, segment descriptor, bitmap segments).
Definition at line 294 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::initKeyBitmap(), LbmExecStreamTestBase::initNormalizerExecStream(), LbmNormalizerExecStreamTest::testNormalizer(), testRestartingMinus(), and LbmSortedAggExecStreamTest::testSortedAgg().
TupleData LbmExecStreamTestBase::keyBitmapTupleData [protected, inherited] |
Definition at line 295 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::initKeyBitmap(), and LbmExecStreamTestBase::produceEntry().
TupleAccessor LbmExecStreamTestBase::keyBitmapTupleAccessor [protected, inherited] |
Definition at line 296 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::initKeyBitmap(), and LbmExecStreamTestBase::produceEntry().
boost::shared_array<FixedBuffer> LbmExecStreamTestBase::keyBitmapBuf [protected, inherited] |
Definition at line 297 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::initKeyBitmap(), LbmNormalizerExecStreamTest::testNormalizer(), testRestartingMinus(), and LbmSortedAggExecStreamTest::testSortedAgg().
uint LbmExecStreamTestBase::keyBitmapBufSize [protected, inherited] |
Definition at line 298 of file LbmExecStreamTestBase.h.
Referenced by LbmExecStreamTestBase::initKeyBitmap(), LbmNormalizerExecStreamTest::testNormalizer(), testRestartingMinus(), and LbmSortedAggExecStreamTest::testSortedAgg().
SharedExecStreamGraph ExecStreamUnitTestBase::pGraph [protected, inherited] |
Definition at line 46 of file ExecStreamUnitTestBase.h.
Referenced by ExecStreamUnitTestBase::prepareConfluenceGraph(), ExecStreamUnitTestBase::prepareConfluenceTransformGraph(), ExecStreamUnitTestBase::prepareDAG(), ExecStreamUnitTestBase::prepareTransformGraph(), ExecStreamUnitTestBase::resetExecStreamTest(), LbmSplicerExecStreamTest::spliceInput(), ExecStreamUnitTestBase::tearDownExecStreamTest(), ExecStreamTestSuite::testBTreeInsertExecStream(), ExecStreamUnitTestBase::testCaseSetUp(), CorrelationJoinExecStreamTestSuite::testCorrelationJoin(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), LbmLoadBitmapTest::testLoad(), ExecStreamTestSuite::testReshapeExecStream(), LbmSearchTest::testScanIdx(), ExecStreamUnitTestBase::verifyBufferedOutput(), ExecStreamUnitTestBase::verifyConstantOutput(), FlatFileExecStreamTest::verifyOutput(), and ExecStreamUnitTestBase::verifyOutput().
SharedExecStreamGraphEmbryo ExecStreamUnitTestBase::pGraphEmbryo [protected, inherited] |
Definition at line 47 of file ExecStreamUnitTestBase.h.
Referenced by ExecStreamUnitTestBase::prepareConfluenceGraph(), ExecStreamUnitTestBase::prepareConfluenceTransformGraph(), ExecStreamUnitTestBase::prepareDAG(), ExecStreamUnitTestBase::prepareTransformGraph(), ExecStreamUnitTestBase::resetExecStreamTest(), ExecStreamUnitTestBase::tearDownExecStreamTest(), and ExecStreamUnitTestBase::testCaseSetUp().
const uint ExecStreamTestBase::DefaultCacheReservePercent = 5 [static, protected, inherited] |
Definition at line 45 of file ExecStreamTestBase.h.
Referenced by ExecStreamTestBase::testCaseSetUp().
const uint ExecStreamTestBase::DefaultConcurrentStatements = 4 [static, protected, inherited] |
Definition at line 47 of file ExecStreamTestBase.h.
Referenced by ExecStreamTestBase::testCaseSetUp().
SharedExecStreamScheduler ExecStreamTestBase::pScheduler [protected, inherited] |
Definition at line 49 of file ExecStreamTestBase.h.
Referenced by ExecStreamTestBase::newStreamGraphEmbryo(), ExecStreamUnitTestBase::resetExecStreamTest(), ExecStreamTestBase::testCaseSetUp(), ExecStreamTestBase::testCaseTearDown(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), ExecStreamUnitTestBase::verifyBufferedOutput(), ExecStreamUnitTestBase::verifyConstantOutput(), FlatFileExecStreamTest::verifyOutput(), and ExecStreamUnitTestBase::verifyOutput().
SharedExecStreamGovernor ExecStreamTestBase::pResourceGovernor [protected, inherited] |
Definition at line 51 of file ExecStreamTestBase.h.
Referenced by ExecStreamUnitTestBase::resetExecStreamTest(), ExternalSortExecStreamTest::testCaseSetUp(), ExecStreamUnitTestBase::testCaseSetUp(), ExecStreamTestBase::testCaseSetUp(), ExecStreamGovernorTest::testCaseSetUp(), ExecStreamTestBase::testCaseTearDown(), ExecStreamGovernorTest::testMinGreaterAllocation(), ExecStreamUnitTestBase::verifyBufferedOutput(), ExecStreamUnitTestBase::verifyConstantOutput(), FlatFileExecStreamTest::verifyOutput(), and ExecStreamUnitTestBase::verifyOutput().
SharedCacheAccessor ExecStreamTestBase::pCacheAccessor [protected, inherited] |
Definition at line 53 of file ExecStreamTestBase.h.
Referenced by ExecStreamTestSuite::testBTreeInsertExecStream(), ExecStreamUnitTestBase::testCaseSetUp(), ExecStreamTestBase::testCaseTearDown(), ExecStreamTestSuite::testMergeImplicitPullInputs(), ExecStreamTestSuite::testSegBufferExecStream(), and ExecStreamTestSuite::testSegBufferReaderWriterExecStream().
SharedSegmentFactory SegStorageTestBase::pSegmentFactory [protected, inherited] |
Definition at line 40 of file SegStorageTestBase.h.
Referenced by BackupRestoreTest::backup(), SegStorageTestBase::createLinearDeviceSegment(), LogicalTxnTest::createRecoveryLog(), LbmSearchTest::initBTreeExecStreamParam(), LbmLoadBitmapTest::initBTreeExecStreamParam(), LcsClusterReplaceExecStreamTest::initClusterAppendParams(), LbmExecStreamTestBase::initSorterExecStream(), LcsMultiClusterAppendTest::loadClusters(), LcsRowScanExecStreamTest::loadOneCluster(), LbmSearchTest::loadTableAndIndex(), newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), SegStorageTestBase::openRandomSegment(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), BackupRestoreTest::restore(), SegStorageTestBase::SegStorageTestBase(), LbmSplicerExecStreamTest::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().
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(), 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().
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(), newMinusStream(), ExecStreamTestBase::newStreamGraphEmbryo(), CacheTestBase::openDevice(), CacheTestBase::openStorage(), LcsClusterReplaceExecStreamTest::replaceCluster(), BackupRestoreTest::restore(), LbmSplicerExecStreamTest::spliceInput(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), BackupRestoreTest::testBackupCleanup(), ExecStreamTestSuite::testBTreeInsertExecStream(), BTreeTest::testBulkLoad(), LhxHashTableTest::testCaseSetUp(), ExecStreamUnitTestBase::testCaseSetUp(), BTreeTest::testCaseSetUp(), BTreeReadersTest::testCaseSetUp(), LhxAggExecStreamTest::testCountImpl(), SegmentTestBase::testDeallocate(), SnapshotSegmentTest::testDeallocateOld(), ExecStreamTestSuite::testDoubleBufferExecStream(), ExecStreamGovernorTest::testGovernor(), LhxAggExecStreamTest::testGroupCountImpl(), BackupRestoreTest::testHeaderBackupRestore(), LhxJoinExecStreamTest::testImpl(), ExternalSortExecStreamTest::testImpl(), BTreeTest::testInserts(), LbmIntersectExecStreamTest::testIntersect(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), CacheTest::testLargeCacheInit(), CacheTest::testLargeCacheRequest(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmLoadBitmapTest::testLoad(), LcsClusterAppendExecStreamTest::testLoadMultiCol(), LcsClusterAppendExecStreamTest::testLoadSingleCol(), SegStreamTest::testMarkReset(), LbmEntryTest::testMergeEntry(), BTreeTest::testMultiKeySearches(), CacheTest::testQuotaCacheAccessor(), BTreeReadersTest::testReaders(), SegStreamTest::testReadSeg(), BTreeTest::testScan(), LcsRowScanExecStreamTest::testScanOnEmptyCluster(), ExecStreamTestSuite::testScratchBufferExecStream(), LhxAggExecStreamTest::testSingleValueImpl(), FlatFileExecStreamTest::testStream(), LhxAggExecStreamTest::testSumImpl(), LogicalTxnTest::testTxn(), LogicalTxnTest::testTxnIdSequence(), LbmUnionExecStreamTest::testUnion(), SegStreamTest::testWriteSeg(), SegStreamTest::testWriteSpillAndRead(), LbmEntryTest::testZeroBytes(), and BackupRestoreTest::verifySnapshotData().
SharedRandomAccessDevice CacheTestBase::pRandomAccessDevice [protected, inherited] |
The default cached device.
Definition at line 68 of file CacheTestBase.h.
Referenced by BackupRestoreTest::backup(), CacheTestBase::closeStorage(), SegStorageTestBase::openSegmentStorage(), CacheTestBase::openStorage(), and BackupRestoreTest::restore().
uint CacheTestBase::nMemPages [protected, inherited] |
Size of cache in memory pages.
Definition at line 73 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), PagingTestBase::testCacheResize(), and ExecStreamTestBase::testCaseSetUp().
uint CacheTestBase::nDiskPages [protected, inherited] |
Size of device in disk pages.
Definition at line 78 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), LinearViewSegmentTest::LinearViewSegmentTest(), CacheTest::makeBlockId(), VersionedSegmentTest::openSegmentStorage(), SnapshotSegmentTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), CacheTestBase::openStorage(), SegStreamTest::SegStreamTest(), SnapshotSegmentTestBase::SnapshotSegmentTestBase(), SnapshotSegmentTest::testDeallocateOld(), PagingTestBase::testPrefetch(), PagingTestBase::testPrefetchBatch(), PagingTestBase::testRandomOp(), SnapshotSegmentTest::testRollback(), PagingTestBase::testSequentialOp(), and PagingTestBase::testSkipOp().
uint CacheTestBase::cbPageFull [protected, inherited] |
Disk page size.
Definition at line 83 of file CacheTestBase.h.
Referenced by CacheTest::CacheTest(), CacheTestBase::CacheTestBase(), CacheTestBase::openDevice(), and SegStorageTestBase::openSegmentStorage().
DeviceId CacheTestBase::dataDeviceId [protected, inherited] |
Fixed ID to assign to data device.
Definition at line 88 of file CacheTestBase.h.
Referenced by CacheTestBase::CacheTestBase(), CacheTestBase::closeStorage(), CacheTest::makeBlockId(), SnapshotSegmentTestBase::openSegmentStorage(), SegStorageTestBase::openSegmentStorage(), LinearViewSegmentTest::openSegmentStorage(), CacheTestBase::openStorage(), and PagingTestBase::testCheckpoint().
TestSuite* TestBase::pTestSuite [protected, inherited] |
Boost test suite.
Definition at line 59 of file TestBase.h.
Referenced by TestBase::releaseTestSuite().
boost::shared_ptr<TestBase> TestBase::pTestObj [protected, inherited] |
Definition at line 61 of file TestBase.h.
Referenced by TestBase::releaseTestSuite(), and TestBase::TestBase().
std::ofstream TestBase::traceStream [protected, inherited] |
Output file stream for tracing.
Definition at line 66 of file TestBase.h.
Referenced by TestBase::notifyTrace(), TestBase::TestBase(), and TestBase::~TestBase().
StrictMutex TestBase::traceMutex [protected, inherited] |
Protects traceStream.
Definition at line 71 of file TestBase.h.
Referenced by TestBase::notifyTrace().
std::string TestBase::testName [protected, inherited] |
Name of test.
Definition at line 76 of file TestBase.h.
Referenced by TestBase::afterTestCase(), TestBase::beforeTestCase(), TestBase::releaseTestSuite(), TestBase::TestBase(), LhxHashTableTest::testInsert1Ka(), and LhxHashTableTest::testInsert1Kb().
TraceLevel TestBase::traceLevel [protected, inherited] |
Level at which to trace test execution.
Definition at line 81 of file TestBase.h.
Referenced by TestBase::getSourceTraceLevel(), and TestBase::TestBase().
FileStatsTarget TestBase::statsTarget [protected, inherited] |
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().