Repository: incubator-quickstep Updated Branches: refs/heads/regression [created] 0280a7eca
Intial commit for new branch Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/0280a7ec Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/0280a7ec Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/0280a7ec Branch: refs/heads/regression Commit: 0280a7eca39c6828c6c39c92eeaa40b83423be8b Parents: ac3512c Author: Hakan Memisoglu <hakanmemiso...@gmail.com> Authored: Fri Sep 23 13:22:55 2016 -0500 Committer: Hakan Memisoglu <hakanmemiso...@gmail.com> Committed: Fri Sep 23 13:22:55 2016 -0500 ---------------------------------------------------------------------- storage/CMakeLists.txt | 14 +++++++ storage/tests/SplitRowStoreRegression.cpp | 52 ++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/0280a7ec/storage/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt index f05cc46..c619d31 100644 --- a/storage/CMakeLists.txt +++ b/storage/CMakeLists.txt @@ -1554,6 +1554,20 @@ target_link_libraries(EvictionPolicy_unittest ${LIBS}) add_test(EvictionPolicy_unittest EvictionPolicy_unittest) +add_executable(SplitRowStoreRegression_unittest + "${CMAKE_CURRENT_SOURCE_DIR}/tests/SplitRowStoreRegression.cpp") +target_link_libraries(SplitRowStoreRegression_unittest + gtest + gtest_main + quickstep_catalog_CatalogAttribute + quickstep_catalog_CatalogRelation + quickstep_storage_SplitRowStoreTupleStorageSubBlock + quickstep_storage_StorageBlockLayout_proto + quickstep_types_TypeFactory + quickstep_utility_ScopedBuffer + ${LIBS}) +add_test(SplitRowStoreRegression_unittest SplitRowStoreRegression_unittest) + if (QUICKSTEP_HAVE_FILE_MANAGER_HDFS) add_executable(FileManagerHdfs_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/FileManagerHdfs_unittest.cpp") http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/0280a7ec/storage/tests/SplitRowStoreRegression.cpp ---------------------------------------------------------------------- diff --git a/storage/tests/SplitRowStoreRegression.cpp b/storage/tests/SplitRowStoreRegression.cpp new file mode 100644 index 0000000..a21f9a8 --- /dev/null +++ b/storage/tests/SplitRowStoreRegression.cpp @@ -0,0 +1,52 @@ +#include <cstddef> +#include <memory> + +#include "catalog/CatalogAttribute.hpp" +#include "catalog/CatalogRelation.hpp" +#include "storage/SplitRowStoreTupleStorageSubBlock.hpp" +#include "storage/StorageBlockLayout.hpp" +#include "storage/StorageBlockLayout.pb.h" +#include "types/TypeFactory.hpp" +#include "utility/ScopedBuffer.hpp" + +#include "gtest/gtest.h" + +namespace quickstep { + +class SplitRowStoreRegression : public ::testing::TestWithParam<std::size_t> { + protected: + static const size_t kSubBlockSize = 0x1000000; // 16 MB. + + virtual void SetUp() { + relation_.reset(new CatalogRelation(nullptr, "RegressionRelation")); + + std::size_t num_of_attributes = GetParam(); + for (std::size_t i = 0; num_of_attributes; ++i) { + std::string name_of_attribute = "double_attr" + std::to_string(i); + CatalogAttribute *double_attr = new CatalogAttribute(relation_.get(), + name_of_attribute, + TypeFactory::GetType(kDouble, false)); + ASSERT_EQ(i, relation_->addAttribute(double_attr)); + } + + tuple_store_description_.reset(); + tuple_store_.reset(); + tuple_store_memory_.reset(); + } + + std::unique_ptr<CatalogRelation> relation_; + ScopedBuffer tuple_store_memory_; + std::unique_ptr<TupleStorageSubBlockDescription> tuple_store_description_; + std::unique_ptr<SplitRowStoreTupleStorageSubBlock> tuple_store_; +}; + +TEST_P(SplitRowStoreRegression, StrideAccess) { + std::size_t param = GetParam(); + ASSERT_LT(param, 10); +} + +INSTANTIATE_TEST_CASE_P(SplitRowStoreRegressionStrideTest, + SplitRowStoreRegression, + ::testing::Values(1, 2, 4, 8, 16, 32, 64, 128, 256),); + +}