00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "fennel/common/CommonPreamble.h"
00023 #include "fennel/test/ExecStreamUnitTestBase.h"
00024 #include "fennel/lucidera/colstore/LcsClusterAppendExecStream.h"
00025 #include "fennel/lucidera/colstore/LcsClusterDump.h"
00026 #include "fennel/lucidera/colstore/LcsClusterVerifier.h"
00027 #include "fennel/lucidera/colstore/LcsRowScanExecStream.h"
00028 #include "fennel/btree/BTreeBuilder.h"
00029 #include "fennel/ftrs/BTreeInsertExecStream.h"
00030 #include "fennel/ftrs/BTreeSearchExecStream.h"
00031 #include "fennel/ftrs/BTreeExecStream.h"
00032 #include "fennel/tuple/StandardTypeDescriptor.h"
00033 #include "fennel/exec/MockProducerExecStream.h"
00034 #include "fennel/exec/ValuesExecStream.h"
00035 #include "fennel/exec/ExecStreamEmbryo.h"
00036 #include "fennel/exec/DynamicParam.h"
00037 #include "fennel/cache/Cache.h"
00038 #include "fennel/common/TraceSource.h"
00039 #include <stdarg.h>
00040
00041 #include <boost/test/test_tools.hpp>
00042
00043 using namespace fennel;
00044
00045 class LcsClusterAppendExecStreamTest : public ExecStreamUnitTestBase
00046 {
00047 protected:
00048 StandardTypeDescriptorFactory stdTypeFactory;
00049 TupleAttributeDescriptor attrDesc_int64;
00050 TupleAttributeDescriptor attrDesc_bitmap;
00051
00052 PageId savedRootPageId;
00053 BTreeDescriptor btreeDescriptor;
00054
00055 void testLoadSingleCol(
00056 uint nRows,
00057 uint startRid,
00058 bool newRoot,
00059 SharedMockProducerExecStreamGenerator pGeneratorInit,
00060 std::string testName = "LcsClusterAppendExecStreamTest");
00061
00062 void testLoadMultiCol(
00063 uint nRows,
00064 uint nCols,
00065 bool newRoot,
00066 SharedMockProducerExecStreamGenerator pGeneratorInit,
00067 std::string testName = "LcsClusterAppendExecStreamTest");
00068
00069 void verifyClusterPages(std::string testName, uint nCols);
00070
00071 void testScanSingleCol(
00072 uint nrows,
00073 SharedMockProducerExecStreamGenerator pGeneratorInit,
00074 SharedMockProducerExecStreamGenerator pResultGenerator);
00075
00076 void setUpDelIndexScan(ExecStreamEmbryo &valuesStreamEmbryo);
00077
00078 void testScanMultiCol(
00079 uint nrows,
00080 uint nCols,
00081 SharedMockProducerExecStreamGenerator pGeneratorInit,
00082 SharedMockProducerExecStreamGenerator pResultGenerator);
00083
00084 public:
00085 explicit LcsClusterAppendExecStreamTest()
00086 {
00087 FENNEL_UNIT_TEST_CASE(
00088 LcsClusterAppendExecStreamTest,
00089 testSingleColNoDupNewRoot);
00090 FENNEL_UNIT_TEST_CASE(
00091 LcsClusterAppendExecStreamTest,
00092 testSingleColNoDupOldRoot);
00093 FENNEL_UNIT_TEST_CASE(
00094 LcsClusterAppendExecStreamTest,
00095 testSingleColConstNewRoot);
00096 FENNEL_UNIT_TEST_CASE(
00097 LcsClusterAppendExecStreamTest,
00098 testSingleColConstOldRoot);
00099 FENNEL_UNIT_TEST_CASE(
00100 LcsClusterAppendExecStreamTest,
00101 testSingleColStairNewRoot);
00102 FENNEL_UNIT_TEST_CASE(
00103 LcsClusterAppendExecStreamTest,
00104 testSingleColStairOldRoot);
00105
00106 FENNEL_UNIT_TEST_CASE(
00107 LcsClusterAppendExecStreamTest,
00108 testMultiColNoDupNewRoot);
00109 FENNEL_UNIT_TEST_CASE(
00110 LcsClusterAppendExecStreamTest,
00111 testMultiColNoDupOldRoot);
00112 FENNEL_UNIT_TEST_CASE(
00113 LcsClusterAppendExecStreamTest,
00114 testMultiColConstNewRoot);
00115 FENNEL_UNIT_TEST_CASE(
00116 LcsClusterAppendExecStreamTest,
00117 testMultiColConstOldRoot);
00118 FENNEL_UNIT_TEST_CASE(
00119 LcsClusterAppendExecStreamTest,
00120 testMultiColStairNewRoot);
00121 FENNEL_UNIT_TEST_CASE(
00122 LcsClusterAppendExecStreamTest,
00123 testMultiColStairOldRoot);
00124 }
00125 void testCaseSetUp();
00126 void testCaseTearDown();
00127
00128 void testSingleColNoDupNewRoot();
00129 void testSingleColNoDupOldRoot();
00130
00131 void testSingleColConstNewRoot();
00132 void testSingleColConstOldRoot();
00133
00134 void testSingleColStairNewRoot();
00135 void testSingleColStairOldRoot();
00136
00137 void testMultiColNoDupNewRoot();
00138 void testMultiColNoDupOldRoot();
00139
00140 void testMultiColConstNewRoot();
00141 void testMultiColConstOldRoot();
00142
00143 void testMultiColStairNewRoot();
00144 void testMultiColStairOldRoot();
00145 };
00146
00147 void LcsClusterAppendExecStreamTest::verifyClusterPages(
00148 std::string testName,
00149 uint nCols)
00150 {
00151 bool found;
00152 PConstLcsClusterNode pBlock;
00153 PageId clusterPageId;
00154 LcsRid rid;
00155 ClusterPageData pageData;
00156 uint blockSize =
00157 btreeDescriptor.segmentAccessor.pSegment->getUsablePageSize();
00158 LcsClusterVerifier clusterVerifier(btreeDescriptor);
00159 TupleDescriptor colTupleDesc;
00160 for (uint i = 0; i < nCols; i++) {
00161 colTupleDesc.push_back(attrDesc_int64);
00162 }
00163 LcsClusterDump clusterDump(
00164 btreeDescriptor,
00165 colTupleDesc,
00166 TRACE_INFO,
00167 shared_from_this(),
00168 testName);
00169
00170
00171
00172 found = clusterVerifier.getFirstClusterPageForRead(pBlock);
00173 if (!found) {
00174 BOOST_FAIL("getFirstClusterPageForRead found nothing");
00175 }
00176 do {
00177 pageData = clusterVerifier.getPageData();
00178
00179
00180 BOOST_CHECK_EQUAL(pageData.bTreeRid, pBlock->firstRID);
00181 clusterDump.dump(
00182 opaqueToInt(pageData.clusterPageId),
00183 pBlock,
00184 blockSize);
00185 } while (found = clusterVerifier.getNextClusterPageForRead(pBlock));
00186 }
00187
00188
00189
00190
00191
00192
00193
00194 void LcsClusterAppendExecStreamTest::testLoadSingleCol(
00195 uint nRows,
00196 uint startRid,
00197 bool newRoot,
00198 SharedMockProducerExecStreamGenerator pGeneratorInit,
00199 std::string testName)
00200 {
00201 SharedMockProducerExecStreamGenerator pGenerator = pGeneratorInit;
00202
00203 MockProducerExecStreamParams mockParams;
00204 mockParams.outputTupleDesc.push_back(attrDesc_int64);
00205 mockParams.nRows = nRows;
00206 mockParams.pGenerator = pGenerator;
00207
00208 ExecStreamEmbryo mockStreamEmbryo;
00209 mockStreamEmbryo.init(new MockProducerExecStream(), mockParams);
00210 mockStreamEmbryo.getStream()->setName("MockProducerExecStream");
00211
00212 LcsClusterAppendExecStreamParams lcsAppendParams;
00213 lcsAppendParams.scratchAccessor =
00214 pSegmentFactory->newScratchSegment(pCache, 10);
00215 lcsAppendParams.pCacheAccessor = pCache;
00216 lcsAppendParams.pSegment = pRandomSegment;
00217
00218 lcsAppendParams.inputProj.push_back(0);
00219
00220
00221
00222 (lcsAppendParams.tupleDesc).push_back(attrDesc_int64);
00223 (lcsAppendParams.tupleDesc).push_back(attrDesc_int64);
00224
00225
00226 (lcsAppendParams.keyProj).push_back(0);
00227
00228
00229 lcsAppendParams.outputTupleDesc.push_back(attrDesc_int64);
00230 lcsAppendParams.outputTupleDesc.push_back(attrDesc_int64);
00231
00232 lcsAppendParams.pRootMap = 0;
00233 lcsAppendParams.rootPageIdParamId = DynamicParamId(0);
00234
00235
00236 lcsAppendParams.segmentId = btreeDescriptor.segmentId;
00237 lcsAppendParams.pageOwnerId = btreeDescriptor.pageOwnerId;
00238
00239
00240 btreeDescriptor.segmentAccessor.pSegment = lcsAppendParams.pSegment;
00241 btreeDescriptor.segmentAccessor.pCacheAccessor = pCache;
00242 btreeDescriptor.tupleDescriptor = lcsAppendParams.tupleDesc;
00243 btreeDescriptor.keyProjection = lcsAppendParams.keyProj;
00244 btreeDescriptor.rootPageId = newRoot ? NULL_PAGE_ID : savedRootPageId;
00245
00246 BTreeBuilder builder(btreeDescriptor, pRandomSegment);
00247
00248
00249 if (newRoot) {
00250 builder.createEmptyRoot();
00251 savedRootPageId = builder.getRootPageId();
00252 }
00253
00254 lcsAppendParams.rootPageId = btreeDescriptor.rootPageId = savedRootPageId;
00255
00256
00257
00258
00259 LcsClusterAppendExecStream *lcsStream = new LcsClusterAppendExecStream();
00260
00261 ExecStreamEmbryo lcsAppendStreamEmbryo;
00262 lcsAppendStreamEmbryo.init(lcsStream, lcsAppendParams);
00263 lcsAppendStreamEmbryo.getStream()->setName("LcsClusterAppendExecStream");
00264
00265 SharedExecStream pOutputStream = prepareTransformGraph(
00266 mockStreamEmbryo, lcsAppendStreamEmbryo);
00267
00268
00269 vector<boost::shared_ptr<ColumnGenerator<int64_t> > > columnGenerators;
00270 SharedInt64ColumnGenerator colGen =
00271 SharedInt64ColumnGenerator(new SeqColumnGenerator(nRows));
00272 columnGenerators.push_back(colGen);
00273 colGen = SharedInt64ColumnGenerator(new SeqColumnGenerator(startRid));
00274 columnGenerators.push_back(colGen);
00275
00276 CompositeExecStreamGenerator expectedResultGenerator(columnGenerators);
00277
00278 verifyOutput(*pOutputStream, 1, expectedResultGenerator);
00279
00280
00281
00282 verifyClusterPages(testName, 1);
00283 }
00284
00285 void LcsClusterAppendExecStreamTest::testLoadMultiCol(
00286 uint nRows,
00287 uint nCols,
00288 bool newRoot,
00289 SharedMockProducerExecStreamGenerator pGeneratorInit,
00290 std::string testName)
00291 {
00292 SharedMockProducerExecStreamGenerator pGenerator = pGeneratorInit;
00293
00294 MockProducerExecStreamParams mockParams;
00295 for (uint i = 0; i < nCols; i ++) {
00296 mockParams.outputTupleDesc.push_back(attrDesc_int64);
00297 }
00298 mockParams.nRows = nRows;
00299 mockParams.pGenerator = pGenerator;
00300
00301 ExecStreamEmbryo mockStreamEmbryo;
00302 mockStreamEmbryo.init(new MockProducerExecStream(), mockParams);
00303 mockStreamEmbryo.getStream()->setName("MockProducerExecStream");
00304
00305 LcsClusterAppendExecStreamParams lcsAppendParams;
00306 lcsAppendParams.scratchAccessor =
00307 pSegmentFactory->newScratchSegment(pCache, 10);
00308 lcsAppendParams.pCacheAccessor = pCache;
00309 lcsAppendParams.pSegment = pRandomSegment;
00310
00311
00312
00313 (lcsAppendParams.tupleDesc).push_back(attrDesc_int64);
00314 (lcsAppendParams.tupleDesc).push_back(attrDesc_int64);
00315
00316
00317 (lcsAppendParams.keyProj).push_back(0);
00318
00319
00320 lcsAppendParams.outputTupleDesc.push_back(attrDesc_int64);
00321
00322 for (uint i = 0; i < nCols; i++) {
00323 lcsAppendParams.inputProj.push_back(i);
00324 }
00325 lcsAppendParams.pRootMap = 0;
00326 lcsAppendParams.rootPageIdParamId = DynamicParamId(0);
00327
00328
00329 lcsAppendParams.segmentId = btreeDescriptor.segmentId;
00330 lcsAppendParams.pageOwnerId = btreeDescriptor.pageOwnerId;
00331
00332
00333
00334 btreeDescriptor.segmentAccessor.pSegment = lcsAppendParams.pSegment;
00335 btreeDescriptor.segmentAccessor.pCacheAccessor = pCache;
00336 btreeDescriptor.tupleDescriptor = lcsAppendParams.tupleDesc;
00337 btreeDescriptor.keyProjection = lcsAppendParams.keyProj;
00338 btreeDescriptor.rootPageId = newRoot ? NULL_PAGE_ID : savedRootPageId;
00339
00340 BTreeBuilder builder(btreeDescriptor, pRandomSegment);
00341
00342
00343 if (newRoot) {
00344 builder.createEmptyRoot();
00345 savedRootPageId = builder.getRootPageId();
00346 }
00347
00348 lcsAppendParams.rootPageId = btreeDescriptor.rootPageId = savedRootPageId;
00349
00350
00351
00352
00353 ExecStreamEmbryo lcsAppendStreamEmbryo;
00354 lcsAppendStreamEmbryo.init(
00355 new LcsClusterAppendExecStream(),
00356 lcsAppendParams);
00357 lcsAppendStreamEmbryo.getStream()->setName("LcsClusterAppendExecStream");
00358
00359 SharedExecStream pOutputStream = prepareTransformGraph(
00360 mockStreamEmbryo, lcsAppendStreamEmbryo);
00361
00362
00363 RampExecStreamGenerator expectedResultGenerator(mockParams.nRows);
00364
00365 verifyOutput(*pOutputStream, 1, expectedResultGenerator);
00366
00367
00368
00369 verifyClusterPages(testName, nCols);
00370 }
00371
00372 void LcsClusterAppendExecStreamTest::testScanSingleCol(
00373 uint nrows,
00374 SharedMockProducerExecStreamGenerator pGeneratorInit,
00375 SharedMockProducerExecStreamGenerator pResultGenerator)
00376 {
00377 SharedMockProducerExecStreamGenerator pGenerator = pGeneratorInit;
00378
00379
00380
00381
00382 LcsRowScanExecStreamParams scanParams;
00383 scanParams.hasExtraFilter = false;
00384 scanParams.isFullScan = true;
00385 scanParams.samplingMode = SAMPLING_OFF;
00386
00387 struct LcsClusterScanDef clusterScanDef;
00388
00389 clusterScanDef.clusterTupleDesc.push_back(attrDesc_int64);
00390 clusterScanDef.pSegment = btreeDescriptor.segmentAccessor.pSegment;
00391 clusterScanDef.pCacheAccessor =
00392 btreeDescriptor.segmentAccessor.pCacheAccessor;
00393 clusterScanDef.tupleDesc = btreeDescriptor.tupleDescriptor;
00394 clusterScanDef.keyProj = btreeDescriptor.keyProjection;
00395 clusterScanDef.rootPageId = btreeDescriptor.rootPageId;
00396 clusterScanDef.segmentId = btreeDescriptor.segmentId;
00397 clusterScanDef.pageOwnerId = btreeDescriptor.pageOwnerId;
00398
00399 scanParams.lcsClusterScanDefs.push_back(clusterScanDef);
00400 scanParams.outputTupleDesc.push_back(attrDesc_int64);
00401 scanParams.outputProj.push_back(0);
00402
00403 ExecStreamEmbryo valuesStreamEmbryo;
00404 setUpDelIndexScan(valuesStreamEmbryo);
00405
00406 ExecStreamEmbryo scanStreamEmbryo;
00407
00408 scanStreamEmbryo.init(new LcsRowScanExecStream(), scanParams);
00409 scanStreamEmbryo.getStream()->setName("RowScanExecStream");
00410
00411 SharedExecStream pOutputStream =
00412 prepareTransformGraph(valuesStreamEmbryo, scanStreamEmbryo);
00413
00414
00415 verifyOutput(*pOutputStream, nrows, *pResultGenerator);
00416 }
00417
00418 void LcsClusterAppendExecStreamTest::setUpDelIndexScan(
00419 ExecStreamEmbryo &valuesStreamEmbryo)
00420 {
00421 ValuesExecStreamParams valuesParams;
00422 boost::shared_array<FixedBuffer> pBuffer;
00423
00424
00425
00426 valuesParams.outputTupleDesc.push_back(attrDesc_int64);
00427 valuesParams.outputTupleDesc.push_back(attrDesc_bitmap);
00428 valuesParams.outputTupleDesc.push_back(attrDesc_bitmap);
00429
00430 uint bufferSize = 16;
00431 pBuffer.reset(new FixedBuffer[bufferSize]);
00432 valuesParams.pTupleBuffer = pBuffer;
00433 valuesParams.bufSize = 0;
00434 valuesStreamEmbryo.init(new ValuesExecStream(), valuesParams);
00435 valuesStreamEmbryo.getStream()->setName("ValuesExecStream");
00436 }
00437
00438 void LcsClusterAppendExecStreamTest::testScanMultiCol(
00439 uint nrows,
00440 uint nCols,
00441 SharedMockProducerExecStreamGenerator pGeneratorInit,
00442 SharedMockProducerExecStreamGenerator pResultGenerator)
00443 {
00444 uint i;
00445 SharedMockProducerExecStreamGenerator pGenerator = pGeneratorInit;
00446
00447
00448
00449
00450 LcsRowScanExecStreamParams scanParams;
00451 scanParams.hasExtraFilter = false;
00452 scanParams.isFullScan = true;
00453 scanParams.samplingMode = SAMPLING_OFF;
00454 struct LcsClusterScanDef clusterScanDef;
00455
00456 for (i = 0; i < nCols; i++) {
00457 clusterScanDef.clusterTupleDesc.push_back(attrDesc_int64);
00458 }
00459
00460 clusterScanDef.pSegment = btreeDescriptor.segmentAccessor.pSegment;
00461 clusterScanDef.pCacheAccessor =
00462 btreeDescriptor.segmentAccessor.pCacheAccessor;
00463 clusterScanDef.tupleDesc = btreeDescriptor.tupleDescriptor;
00464 clusterScanDef.keyProj = btreeDescriptor.keyProjection;
00465 clusterScanDef.rootPageId = btreeDescriptor.rootPageId;
00466 clusterScanDef.segmentId = btreeDescriptor.segmentId;
00467 clusterScanDef.pageOwnerId = btreeDescriptor.pageOwnerId;
00468
00469 scanParams.lcsClusterScanDefs.push_back(clusterScanDef);
00470 for (i = 0; i < nCols; i++) {
00471 scanParams.outputTupleDesc.push_back(attrDesc_int64);
00472 scanParams.outputProj.push_back(i);
00473 }
00474
00475 ExecStreamEmbryo valuesStreamEmbryo;
00476 setUpDelIndexScan(valuesStreamEmbryo);
00477
00478 ExecStreamEmbryo scanStreamEmbryo;
00479
00480 scanStreamEmbryo.init(new LcsRowScanExecStream(), scanParams);
00481 scanStreamEmbryo.getStream()->setName("RowScanExecStream");
00482
00483 SharedExecStream pOutputStream =
00484 prepareTransformGraph(valuesStreamEmbryo, scanStreamEmbryo);
00485
00486
00487 verifyOutput(*pOutputStream, nrows, *pResultGenerator);
00488 }
00489
00490 void LcsClusterAppendExecStreamTest::testCaseSetUp()
00491 {
00492 ExecStreamUnitTestBase::testCaseSetUp();
00493
00494 attrDesc_int64 = TupleAttributeDescriptor(
00495 stdTypeFactory.newDataType(STANDARD_TYPE_INT_64));
00496 attrDesc_bitmap = TupleAttributeDescriptor(
00497 stdTypeFactory.newDataType(STANDARD_TYPE_CHAR),
00498 true, pRandomSegment->getUsablePageSize() / 8);
00499
00500 savedRootPageId = NULL_PAGE_ID;
00501 }
00502
00503 void LcsClusterAppendExecStreamTest::testCaseTearDown()
00504 {
00505 btreeDescriptor.segmentAccessor.reset();
00506 ExecStreamUnitTestBase::testCaseTearDown();
00507 }
00508
00509 void LcsClusterAppendExecStreamTest::testSingleColNoDupNewRoot()
00510 {
00511
00512
00513
00514 SharedMockProducerExecStreamGenerator pGenerator =
00515 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00516 SharedMockProducerExecStreamGenerator pResultGenerator =
00517 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00518
00519 testLoadSingleCol(
00520 848, 0, true, pGenerator, "testSingleColNoDupNewRoot");
00521 resetExecStreamTest();
00522 testScanSingleCol(848, pGenerator, pResultGenerator);
00523 }
00524
00525
00526
00527
00528
00529
00530
00531 void LcsClusterAppendExecStreamTest::testSingleColNoDupOldRoot()
00532 {
00533
00534
00535
00536
00537 SharedMockProducerExecStreamGenerator pGenerator =
00538 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00539 SharedMockProducerExecStreamGenerator pResultGenerator =
00540 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00541
00542 testLoadSingleCol(
00543 848, 0, true, pGenerator, "testSingleColNoDupOldRoot");
00544 resetExecStreamTest();
00545
00546 testScanSingleCol(848, pGenerator, pResultGenerator);
00547
00548 resetExecStreamTest();
00549 testLoadSingleCol(
00550 848, 848, false, pGenerator, "testSingleColNoDupOldRoot");
00551 }
00552
00553
00554 void LcsClusterAppendExecStreamTest::testSingleColConstNewRoot()
00555 {
00556
00557
00558
00559 SharedMockProducerExecStreamGenerator pGenerator =
00560 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00561 SharedMockProducerExecStreamGenerator pResultGenerator =
00562 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00563
00564 testLoadSingleCol(
00565 848, 0, true, pGenerator, "testSingleColConstNewRoot");
00566 resetExecStreamTest();
00567
00568 pGenerator.reset(new RampExecStreamGenerator());
00569 testScanSingleCol(848, pGenerator, pResultGenerator);
00570 }
00571
00572
00573
00574
00575
00576
00577
00578 void LcsClusterAppendExecStreamTest::testSingleColConstOldRoot()
00579 {
00580
00581
00582
00583
00584 SharedMockProducerExecStreamGenerator pGenerator =
00585 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00586 SharedMockProducerExecStreamGenerator pResultGenerator =
00587 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00588
00589 testLoadSingleCol(
00590 10, 0, true, pGenerator, "testSingleColConstOldRoot");
00591 resetExecStreamTest();
00592 testLoadSingleCol(
00593 10, 10, false, pGenerator, "testSingleColConstOldRoot");
00594
00595 resetExecStreamTest();
00596 pGenerator.reset(new RampExecStreamGenerator());
00597 testScanSingleCol(20, pGenerator, pResultGenerator);
00598 }
00599
00600 void LcsClusterAppendExecStreamTest::testSingleColStairNewRoot()
00601 {
00602
00603
00604
00605 SharedMockProducerExecStreamGenerator pGenerator =
00606 SharedMockProducerExecStreamGenerator(
00607 new StairCaseExecStreamGenerator(1, 7));
00608 SharedMockProducerExecStreamGenerator pResultGenerator =
00609 SharedMockProducerExecStreamGenerator(
00610 new StairCaseExecStreamGenerator(1, 7));
00611
00612 testLoadSingleCol(
00613 848, 0, true, pGenerator, "testSingleColStairNewRoot");
00614 resetExecStreamTest();
00615
00616 pGenerator.reset(new RampExecStreamGenerator());
00617 testScanSingleCol(848, pGenerator, pResultGenerator);
00618 }
00619
00620
00621
00622
00623
00624
00625
00626 void LcsClusterAppendExecStreamTest::testSingleColStairOldRoot()
00627 {
00628
00629
00630
00631
00632 SharedMockProducerExecStreamGenerator pGenerator =
00633 SharedMockProducerExecStreamGenerator(
00634 new StairCaseExecStreamGenerator(1, 7));
00635 SharedMockProducerExecStreamGenerator pRidGenerator =
00636 SharedMockProducerExecStreamGenerator(
00637 new RampExecStreamGenerator());
00638 SharedMockProducerExecStreamGenerator pResultGenerator =
00639 SharedMockProducerExecStreamGenerator(
00640 new StairCaseExecStreamGenerator(1, 7));
00641
00642 testLoadSingleCol(
00643 10, 0, true, pGenerator, "testSingleColStairOldRoot");
00644 resetExecStreamTest();
00645 testScanSingleCol(10, pRidGenerator, pResultGenerator);
00646
00647 resetExecStreamTest();
00648 testLoadSingleCol(
00649 10, 10, false, pGenerator, "testSingleColStairOldRoot");
00650 }
00651
00652 void LcsClusterAppendExecStreamTest::testMultiColNoDupNewRoot()
00653 {
00654
00655
00656
00657 SharedMockProducerExecStreamGenerator pGenerator =
00658 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00659 SharedMockProducerExecStreamGenerator pResultGenerator =
00660 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00661
00662 testLoadMultiCol(848, 3, true, pGenerator, "testMultiColNoDupNewRoot");
00663 resetExecStreamTest();
00664 testScanMultiCol(848, 3, pGenerator, pResultGenerator);
00665 }
00666
00667
00668
00669
00670
00671
00672
00673 void LcsClusterAppendExecStreamTest::testMultiColNoDupOldRoot()
00674 {
00675
00676
00677
00678
00679
00680
00681
00682 SharedMockProducerExecStreamGenerator pGenerator =
00683 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00684 SharedMockProducerExecStreamGenerator pRidGenerator =
00685 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00686 SharedMockProducerExecStreamGenerator pResultGenerator =
00687 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00688
00689 testLoadMultiCol(15000, 12, true, pGenerator,"testMultiColNoDupOldRoot");
00690 resetExecStreamTest();
00691 testScanMultiCol(15000, 12, pRidGenerator, pResultGenerator);
00692
00693 resetExecStreamTest();
00694 testLoadMultiCol(15000, 12, false, pGenerator, "testMultiColNoDupOldRoot");
00695 }
00696
00697
00698 void LcsClusterAppendExecStreamTest::testMultiColConstNewRoot()
00699 {
00700
00701
00702
00703 SharedMockProducerExecStreamGenerator pGenerator =
00704 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00705 SharedMockProducerExecStreamGenerator pResultGenerator =
00706 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00707
00708 testLoadMultiCol(848, 3, true, pGenerator, "testMultiColConstNewRoot");
00709 resetExecStreamTest();
00710
00711 pGenerator.reset(new RampExecStreamGenerator());
00712 testScanMultiCol(848, 3, pGenerator, pResultGenerator);
00713 }
00714
00715
00716
00717
00718
00719
00720
00721 void LcsClusterAppendExecStreamTest::testMultiColConstOldRoot()
00722 {
00723
00724
00725
00726
00727 SharedMockProducerExecStreamGenerator pGenerator =
00728 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00729 SharedMockProducerExecStreamGenerator pResultGenerator =
00730 SharedMockProducerExecStreamGenerator(new ConstExecStreamGenerator(72));
00731
00732 testLoadMultiCol(10, 3, true, pGenerator, "testMultiColConstOldRoot");
00733 resetExecStreamTest();
00734 testLoadMultiCol(10, 3, false, pGenerator, "testMultiColConstOldRoot");
00735
00736 resetExecStreamTest();
00737 pGenerator.reset(new RampExecStreamGenerator());
00738 testScanMultiCol(20, 3, pGenerator, pResultGenerator);
00739 }
00740
00741 void LcsClusterAppendExecStreamTest::testMultiColStairNewRoot()
00742 {
00743
00744
00745
00746 SharedMockProducerExecStreamGenerator pGenerator =
00747 SharedMockProducerExecStreamGenerator(
00748 new StairCaseExecStreamGenerator(1, 7));
00749 SharedMockProducerExecStreamGenerator pResultGenerator =
00750 SharedMockProducerExecStreamGenerator(
00751 new StairCaseExecStreamGenerator(1, 7));
00752
00753 testLoadMultiCol(848, 3, true, pGenerator, "testMultiColStairNewRoot");
00754 resetExecStreamTest();
00755
00756 pGenerator.reset(new RampExecStreamGenerator());
00757 testScanMultiCol(848, 3, pGenerator, pResultGenerator);
00758 }
00759
00760
00761
00762
00763
00764
00765
00766 void LcsClusterAppendExecStreamTest::testMultiColStairOldRoot()
00767 {
00768
00769
00770
00771
00772 SharedMockProducerExecStreamGenerator pGenerator =
00773 SharedMockProducerExecStreamGenerator(
00774 new StairCaseExecStreamGenerator(1, 7));
00775 SharedMockProducerExecStreamGenerator pRidGenerator =
00776 SharedMockProducerExecStreamGenerator(new RampExecStreamGenerator());
00777 SharedMockProducerExecStreamGenerator pResultGenerator =
00778 SharedMockProducerExecStreamGenerator(
00779 new StairCaseExecStreamGenerator(1, 7));
00780
00781 testLoadMultiCol(10, 3, true, pGenerator, "testMultiColStairOldRoot");
00782 resetExecStreamTest();
00783 testScanMultiCol(10, 3, pRidGenerator, pResultGenerator);
00784
00785 resetExecStreamTest();
00786 testLoadMultiCol(10, 3, false, pGenerator, "testMultiColStairOldRoot");
00787 }
00788
00789 FENNEL_UNIT_TEST_SUITE(LcsClusterAppendExecStreamTest);
00790
00791