ExecStreamTestSuite.h

Go to the documentation of this file.
00001 /*
00002 // $Id: //open/dev/fennel/test/ExecStreamTestSuite.h#26 $
00003 // Fennel is a library of data storage and processing components.
00004 // Copyright (C) 2005-2009 The Eigenbase Project
00005 // Copyright (C) 2005-2009 SQLstream, Inc.
00006 // Copyright (C) 2005-2009 LucidEra, Inc.
00007 // Portions Copyright (C) 2003-2009 John V. Sichi
00008 //
00009 // This program is free software; you can redistribute it and/or modify it
00010 // under the terms of the GNU General Public License as published by the Free
00011 // Software Foundation; either version 2 of the License, or (at your option)
00012 // any later version approved by The Eigenbase Project.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with this program; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 #ifndef Fennel_Test_ExecStreamTestSuite_Included
00025 #define Fennel_Test_ExecStreamTestSuite_Included
00026 
00027 #include "fennel/test/ExecStreamUnitTestBase.h"
00028 #include <boost/test/test_tools.hpp>
00029 #include <hash_set>
00030 
00031 using namespace fennel;
00032 
00039 class FENNEL_TEST_EXPORT ExecStreamTestSuite
00040     : public ExecStreamUnitTestBase
00041 {
00042 protected:
00043     void testCartesianJoinExecStream(uint nRowsLeft,uint nRowsRight);
00044     void testGroupAggExecStreamNrows(uint nrows);
00045     void testReshapeExecStream(
00046         bool cast, bool filter, uint expectedNRows, int expectedStart,
00047         bool compareParam,
00048         std::hash_set<int64_t> const &outputParams);
00049     void testBTreeInsertExecStream(bool useDynamicBTree, uint nRows);
00050     void testNestedLoopJoinExecStream(uint nRowsLeft, uint nRowsRight);
00051     virtual uint getDegreeOfParallelism();
00052     void testSegBufferReaderWriterExecStream(
00053         bool restartable, bool earlyClose);
00054 
00055 public:
00063     explicit ExecStreamTestSuite(bool initTestCases = true)
00064     {
00065         if (initTestCases) {
00066             FENNEL_UNIT_TEST_CASE(
00067                 ExecStreamTestSuite,testScratchBufferExecStream);
00068             FENNEL_UNIT_TEST_CASE(
00069                 ExecStreamTestSuite,testDoubleBufferExecStream);
00070             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testCopyExecStream);
00071             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testMergeExecStream);
00072             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testSegBufferExecStream);
00073             FENNEL_UNIT_TEST_CASE(
00074                 ExecStreamTestSuite,testCartesianJoinExecStreamOuter);
00075             FENNEL_UNIT_TEST_CASE(
00076                 ExecStreamTestSuite,testCartesianJoinExecStreamInner);
00077             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testCountAggExecStream);
00078             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testSumAggExecStream);
00079             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream1);
00080             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream2);
00081             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream3);
00082             FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream4);
00083             FENNEL_UNIT_TEST_CASE(
00084                 ExecStreamTestSuite,testReshapeExecStreamCastFilter);
00085             FENNEL_UNIT_TEST_CASE(
00086                 ExecStreamTestSuite,testReshapeExecStreamNoCastFilter);
00087             FENNEL_UNIT_TEST_CASE(
00088                 ExecStreamTestSuite,testReshapeExecStreamDynamicParams);
00089             FENNEL_UNIT_TEST_CASE(
00090                 ExecStreamTestSuite,
00091                 testSingleValueAggExecStream);
00092             FENNEL_UNIT_TEST_CASE(
00093                 ExecStreamTestSuite,
00094                 testMergeImplicitPullInputs);
00095             FENNEL_UNIT_TEST_CASE(
00096                 ExecStreamTestSuite,
00097                 testBTreeInsertExecStreamStaticBTree);
00098             FENNEL_UNIT_TEST_CASE(
00099                 ExecStreamTestSuite,
00100                 testBTreeInsertExecStreamDynamicBTree);
00101             FENNEL_UNIT_TEST_CASE(
00102                 ExecStreamTestSuite,
00103                 testNestedLoopJoinExecStream1);
00104             FENNEL_UNIT_TEST_CASE(
00105                 ExecStreamTestSuite,
00106                 testNestedLoopJoinExecStream2);
00107             FENNEL_UNIT_TEST_CASE(
00108                 ExecStreamTestSuite,
00109                 testSplitterPlusBarrier);
00110             FENNEL_UNIT_TEST_CASE(
00111                 ExecStreamTestSuite,
00112                 testSegBufferReaderWriterExecStream1);
00113             FENNEL_UNIT_TEST_CASE(
00114                 ExecStreamTestSuite,
00115                 testSegBufferReaderWriterExecStream2);
00116             FENNEL_UNIT_TEST_CASE(
00117                 ExecStreamTestSuite,
00118                 testSegBufferReaderWriterExecStream3);
00119             FENNEL_UNIT_TEST_CASE(
00120                 ExecStreamTestSuite,
00121                 testSegBufferReaderWriterExecStream4);
00122         }
00123     }
00124 
00125     void testScratchBufferExecStream();
00126     void testDoubleBufferExecStream();
00127     void testCopyExecStream();
00128     void testMergeExecStream();
00129     void testSegBufferExecStream();
00130     void testCountAggExecStream();
00131     void testSumAggExecStream();
00132     void testReshapeExecStream();
00133     void testSingleValueAggExecStream();
00134     void testMergeImplicitPullInputs();
00135     void testSplitterPlusBarrier();
00136 
00137     void testCartesianJoinExecStreamOuter()
00138     {
00139         // iterate multiple outer buffers
00140         testCartesianJoinExecStream(10000,5);
00141     }
00142 
00143     void testCartesianJoinExecStreamInner()
00144     {
00145         // iterate multiple inner buffers
00146         testCartesianJoinExecStream(5,10000);
00147     }
00148 
00149     void testGroupAggExecStream1()
00150     {
00151         testGroupAggExecStreamNrows(10000);
00152     }
00153 
00154     // 258*2 values seems to be the point at which buffer
00155     // overflow occurs, so test that case as well as +/- 1
00156     // from there
00157     void testGroupAggExecStream2()
00158     {
00159         testGroupAggExecStreamNrows(257*2);
00160     }
00161 
00162     void testGroupAggExecStream3()
00163     {
00164         testGroupAggExecStreamNrows(258*2);
00165     }
00166 
00167     void testGroupAggExecStream4()
00168     {
00169         testGroupAggExecStreamNrows(259*2);
00170     }
00171 
00172     void testReshapeExecStreamCastFilter()
00173     {
00174         std::hash_set<int64_t> outputParams;
00175         testReshapeExecStream(true, true, 10, 500, false, outputParams);
00176     }
00177 
00178     void testReshapeExecStreamNoCastFilter()
00179     {
00180         std::hash_set<int64_t> outputParams;
00181         testReshapeExecStream(false, false, 1000, 0, false, outputParams);
00182     }
00183 
00184     void testReshapeExecStreamDynamicParams()
00185     {
00186         std::hash_set<int64_t> outputParams;
00187         outputParams.insert(0);
00188         outputParams.insert(2);
00189         testReshapeExecStream(true, false, 10, 500, true, outputParams);
00190     }
00191 
00192     void testBTreeInsertExecStreamStaticBTree()
00193     {
00194         testBTreeInsertExecStream(false, 1000);
00195     }
00196 
00197     void testBTreeInsertExecStreamDynamicBTree()
00198     {
00199         testBTreeInsertExecStream(true, 1000);
00200     }
00201 
00202     void testNestedLoopJoinExecStream1()
00203     {
00204         testNestedLoopJoinExecStream(10000, 5);
00205     }
00206 
00207     void testNestedLoopJoinExecStream2()
00208     {
00209         testNestedLoopJoinExecStream(5, 10000);
00210     }
00211 
00212     void testSegBufferReaderWriterExecStream1()
00213     {
00214         testSegBufferReaderWriterExecStream(false, false);
00215     }
00216 
00217     void testSegBufferReaderWriterExecStream2()
00218     {
00219         testSegBufferReaderWriterExecStream(true, false);
00220     }
00221 
00222     void testSegBufferReaderWriterExecStream3()
00223     {
00224         testSegBufferReaderWriterExecStream(false, true);
00225     }
00226 
00227     void testSegBufferReaderWriterExecStream4()
00228     {
00229         testSegBufferReaderWriterExecStream(true, true);
00230     }
00231 };
00232 
00233 #endif
00234 // End ExecStreamTestSuite.h

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