OmniSciDB  5ade3759e0
anonymous_namespace{StorageTest.cpp} Namespace Reference

Functions

void run_ddl_statement (const string &input_str)
 
bool storage_test (const string &table_name, size_t num_rows)
 
void simple_thread_wrapper (const string &table_name, size_t num_rows, size_t thread_id)
 
bool storage_test_parallel (const string &table_name, size_t num_rows, size_t thread_count)
 

Function Documentation

◆ run_ddl_statement()

void anonymous_namespace{StorageTest.cpp}::run_ddl_statement ( const string &  input_str)
inline

Definition at line 56 of file StorageTest.cpp.

References QueryRunner::QueryRunner::get(), and QueryRunner::QueryRunner::runDDLStatement().

56  {
57  QR::get()->runDDLStatement(input_str);
58 }
virtual void runDDLStatement(const std::string &)
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:

◆ simple_thread_wrapper()

void anonymous_namespace{StorageTest.cpp}::simple_thread_wrapper ( const string &  table_name,
size_t  num_rows,
size_t  thread_id 
)

Definition at line 70 of file StorageTest.cpp.

References QueryRunner::QueryRunner::get(), and populate_table_random().

Referenced by storage_test_parallel().

70  {
71  populate_table_random(table_name, num_rows, *QR::get()->getCatalog());
72 }
const int8_t const int64_t * num_rows
std::vector< size_t > populate_table_random(const std::string &table_name, const size_t num_rows, const Catalog &cat)
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storage_test()

bool anonymous_namespace{StorageTest.cpp}::storage_test ( const string &  table_name,
size_t  num_rows 
)

Definition at line 60 of file StorageTest.cpp.

References QueryRunner::QueryRunner::get(), populate_table_random(), scan_table_return_hash(), and scan_table_return_hash_non_iter().

Referenced by TEST().

60  {
61  vector<size_t> insert_col_hashs =
62  populate_table_random(table_name, num_rows, *QR::get()->getCatalog());
63  vector<size_t> scan_col_hashs =
64  scan_table_return_hash(table_name, *QR::get()->getCatalog());
65  vector<size_t> scan_col_hashs2 =
66  scan_table_return_hash_non_iter(table_name, *QR::get()->getCatalog());
67  return insert_col_hashs == scan_col_hashs && insert_col_hashs == scan_col_hashs2;
68 }
const int8_t const int64_t * num_rows
vector< size_t > scan_table_return_hash(const string &table_name, const Catalog &cat)
Definition: ScanTable.cpp:108
vector< size_t > scan_table_return_hash_non_iter(const string &table_name, const Catalog &cat)
Definition: ScanTable.cpp:145
std::vector< size_t > populate_table_random(const std::string &table_name, const size_t num_rows, const Catalog &cat)
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storage_test_parallel()

bool anonymous_namespace{StorageTest.cpp}::storage_test_parallel ( const string &  table_name,
size_t  num_rows,
size_t  thread_count 
)

Definition at line 74 of file StorageTest.cpp.

References QueryRunner::QueryRunner::get(), scan_table_return_hash(), scan_table_return_hash_non_iter(), and simple_thread_wrapper().

Referenced by TEST().

76  {
77  // Constructs a number of threads and have them push records to the table in parallel
78  vector<std::thread> myThreads;
79  for (size_t i = 0; i < thread_count; i++) {
80  myThreads.emplace_back(simple_thread_wrapper, table_name, num_rows / thread_count, i);
81  }
82  for (auto& t : myThreads) {
83  t.join();
84  }
85  vector<size_t> scan_col_hashs =
86  scan_table_return_hash(table_name, *QR::get()->getCatalog());
87  vector<size_t> scan_col_hashs2 =
88  scan_table_return_hash_non_iter(table_name, *QR::get()->getCatalog());
89  return scan_col_hashs == scan_col_hashs2;
90 }
const int8_t const int64_t * num_rows
vector< size_t > scan_table_return_hash(const string &table_name, const Catalog &cat)
Definition: ScanTable.cpp:108
vector< size_t > scan_table_return_hash_non_iter(const string &table_name, const Catalog &cat)
Definition: ScanTable.cpp:145
void simple_thread_wrapper(const string &table_name, size_t num_rows, size_t thread_id)
Definition: StorageTest.cpp:70
static QueryRunner * get()
Definition: QueryRunner.h:115
+ Here is the call graph for this function:
+ Here is the caller graph for this function: