#include "gpudb/GPUdb.hpp"
#include <string>
#include <log4cplus/logger.h>
#include <log4cplus/loggingmacros.h>
Go to the source code of this file.
|
#define | KINETICA_STREAM_TO_STRING(...) ( static_cast<const std::ostringstream&> (std::ostringstream() << __VA_ARGS__).str() ) |
|
#define | KINETICA_STREAM_TO_CSTRING(...) ( KINETICA_STREAM_TO_STRING(__VA_ARGS__).c_str() ) |
|
#define | LOG_KINETICA_INFO(logger, logEvent) do { LOG4CPLUS_INFO(logger, logEvent); } while(0) |
|
#define | LOG_KINETICA_DEBUG(logger, logEvent) do { LOG4CPLUS_DEBUG(logger, logEvent); } while(0) |
|
#define | LOG_KINETICA_WARN(logger, logEvent) do { LOG4CPLUS_WARN(logger, logEvent); } while(0) |
|
#define | LOG_KINETICA_ERROR(logger, logEvent) do { LOG4CPLUS_ERROR(logger, logEvent); } while(0) |
|
#define | NORMALIZER 100 |
|
#define | USE_NULL_VALUE(null_percentage) ((std::rand() % NORMALIZER) < null_percentage) |
|
#define | PERFORM_ACTION(percentage) ((std::rand() % NORMALIZER) < percentage) |
|
#define | GENERATE_INT8() ( (std::rand() % 256) - 128) |
|
#define | GENERATE_INT16() ( (std::rand() % 65536) - 32768) |
|
#define | GENERATE_FLOAT() ( ((float)std::rand()) / std::rand() * std::pow(-1, (std::rand() % 2)) ) |
|
#define | GENERATE_DOUBLE() ( ((double)std::rand()) / std::rand() * std::pow(-1, (std::rand() % 2)) ) |
|
#define | GENERATE_UNSIGNED_INT16() ( std::rand() % 65536 ) |
|
#define | GENERATE_UNSIGNED_LONG_LONG() |
|
#define | GENERATE_UNSIGNED_LONG_LONG_STRING() ( std::to_string( GENERATE_UNSIGNED_LONG_LONG() ) ) |
|
#define | GENERATE_TIMESTAMP() ( std::rand() - std::rand() ) |
|
#define | GENERATE_IPV4() |
| Generate a random IPv4 address ('x.x.x.x' where x is in [0, 255]) More...
|
|
|
std::string | generate_random_string () |
|
std::string | generate_random_string (const std::string &prefix) |
|
std::string | generate_charN (size_t N) |
|
std::string | generate_unsigned_long_long_str () |
|
std::string | generate_unsigned_long_long_str_no_leading_zero () |
|
std::string | generate_date () |
|
std::string | generate_datetime (int chance_percentage_has_time, int chance_percentage_has_ms) |
|
std::string | generate_time (int chance_percentage_has_ms) |
|
std::string | generate_decimal (int frac_only_percentage, int has_frac_percentage, int negative_percentage, int positive_percentage) |
|
std::string | generate_table_name (const std::string &prefix) |
| Generate a table name with the given prefix. More...
|
|
void | create_table (const gpudb::GPUdb &db, const std::string table_name, const gpudb::Type &type) |
| Create a table given a DB hancle, table name, and a type. More...
|
|
void | create_table (const gpudb::GPUdb &db, const std::string table_name, const std::vector< gpudb::Type::Column > &columns) |
| Create a table given a DB hancle, table name, and a list of columns. More...
|
|
void | clear_table (const gpudb::GPUdb &db, const std::string table_name) |
| Clear a given table. More...
|
|
size_t | get_table_size (const gpudb::GPUdb &db, const std::string table_name) |
| Get a given table's size. More...
|
|
|
log4cplus::Logger | logger |
|
static const char | alphanum [] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
|
static const char | numeric [] = "0123456789" |
|
static const int | alphabet_size = 62 |
|
#define GENERATE_DOUBLE |
( |
| ) |
( ((double)std::rand()) / std::rand() * std::pow(-1, (std::rand() % 2)) ) |
#define GENERATE_FLOAT |
( |
| ) |
( ((float)std::rand()) / std::rand() * std::pow(-1, (std::rand() % 2)) ) |
#define GENERATE_INT16 |
( |
| ) |
( (std::rand() % 65536) - 32768) |
#define GENERATE_INT8 |
( |
| ) |
( (std::rand() % 256) - 128) |
#define GENERATE_IPV4 |
( |
| ) |
|
Value:( std::to_string(std::rand() % 256) + "." \
+ std::to_string(std::rand() % 256) + "." \
+ std::to_string(std::rand() % 256) + "." \
+ std::to_string(std::rand() % 256) )
Generate a random IPv4 address ('x.x.x.x' where x is in [0, 255])
Definition at line 139 of file test_utils.h.
#define GENERATE_TIMESTAMP |
( |
| ) |
( std::rand() - std::rand() ) |
#define GENERATE_UNSIGNED_INT16 |
( |
| ) |
( std::rand() % 65536 ) |
#define GENERATE_UNSIGNED_LONG_LONG |
( |
| ) |
|
Value:
#define GENERATE_UNSIGNED_INT16()
Definition at line 70 of file test_utils.h.
#define KINETICA_STREAM_TO_STRING |
( |
|
... | ) |
( static_cast<const std::ostringstream&> (std::ostringstream() << __VA_ARGS__).str() ) |
#define LOG_KINETICA_DEBUG |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_DEBUG(logger, logEvent); } while(0) |
#define LOG_KINETICA_ERROR |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_ERROR(logger, logEvent); } while(0) |
#define LOG_KINETICA_INFO |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_INFO(logger, logEvent); } while(0) |
#define LOG_KINETICA_WARN |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_WARN(logger, logEvent); } while(0) |
#define PERFORM_ACTION |
( |
|
percentage | ) |
((std::rand() % NORMALIZER) < percentage) |
#define USE_NULL_VALUE |
( |
|
null_percentage | ) |
((std::rand() % NORMALIZER) < null_percentage) |
void clear_table |
( |
const gpudb::GPUdb & |
db, |
|
|
const std::string |
table_name |
|
) |
| |
Create a table given a DB hancle, table name, and a type.
Clear any pre-existing table
Create a table given a DB hancle, table name, and a list of columns.
Clear any pre-existing table
std::string generate_charN |
( |
size_t |
N | ) |
|
std::string generate_date |
( |
| ) |
|
std::string generate_datetime |
( |
int |
chance_percentage_has_time, |
|
|
int |
chance_percentage_has_ms |
|
) |
| |
std::string generate_decimal |
( |
int |
frac_only_percentage, |
|
|
int |
has_frac_percentage, |
|
|
int |
negative_percentage, |
|
|
int |
positive_percentage |
|
) |
| |
std::string generate_random_string |
( |
| ) |
|
std::string generate_random_string |
( |
const std::string & |
prefix | ) |
|
std::string generate_table_name |
( |
const std::string & |
prefix | ) |
|
Generate a table name with the given prefix.
std::string generate_time |
( |
int |
chance_percentage_has_ms | ) |
|
std::string generate_unsigned_long_long_str |
( |
| ) |
|
std::string generate_unsigned_long_long_str_no_leading_zero |
( |
| ) |
|
size_t get_table_size |
( |
const gpudb::GPUdb & |
db, |
|
|
const std::string |
table_name |
|
) |
| |
Get a given table's size.
const int alphabet_size = 62 |
|
static |
const char alphanum[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
|
static |
const char numeric[] = "0123456789" |
|
static |