#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_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_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_time (int chance_percentage_has_ms) |
|
std::string | generate_decimal (int frac_only_percentage, int has_frac_percentage, int negative_percentage, int positive_percentage) |
|
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...
|
|
|
static const char | alphanum [] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
|
static const int | alphabet_size = 62 |
|
◆ GENERATE_DOUBLE
#define GENERATE_DOUBLE |
( |
| ) |
( ((double)std::rand()) / std::rand() * std::pow(-1, (std::rand() % 2)) ) |
◆ GENERATE_FLOAT
#define GENERATE_FLOAT |
( |
| ) |
( ((float)std::rand()) / std::rand() * std::pow(-1, (std::rand() % 2)) ) |
◆ GENERATE_INT16
#define GENERATE_INT16 |
( |
| ) |
( (std::rand() % 65536) - 32768) |
◆ GENERATE_INT8
#define GENERATE_INT8 |
( |
| ) |
( (std::rand() % 256) - 128) |
◆ GENERATE_IPV4
#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 86 of file test_utils.h.
◆ GENERATE_TIMESTAMP
#define GENERATE_TIMESTAMP |
( |
| ) |
( std::rand() - std::rand() ) |
◆ KINETICA_STREAM_TO_CSTRING
◆ KINETICA_STREAM_TO_STRING
#define KINETICA_STREAM_TO_STRING |
( |
|
... | ) |
( static_cast<const std::ostringstream&> (std::ostringstream() << __VA_ARGS__).str() ) |
◆ LOG_KINETICA_DEBUG
#define LOG_KINETICA_DEBUG |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_DEBUG(logger, logEvent); } while(0) |
◆ LOG_KINETICA_ERROR
#define LOG_KINETICA_ERROR |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_ERROR(logger, logEvent); } while(0) |
◆ LOG_KINETICA_INFO
#define LOG_KINETICA_INFO |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_INFO(logger, logEvent); } while(0) |
◆ LOG_KINETICA_WARN
#define LOG_KINETICA_WARN |
( |
|
logger, |
|
|
|
logEvent |
|
) |
| do { LOG4CPLUS_WARN(logger, logEvent); } while(0) |
◆ NORMALIZER
◆ PERFORM_ACTION
#define PERFORM_ACTION |
( |
|
percentage | ) |
((std::rand() % NORMALIZER) < percentage) |
◆ USE_NULL_VALUE
#define USE_NULL_VALUE |
( |
|
null_percentage | ) |
((std::rand() % NORMALIZER) < null_percentage) |
◆ clear_table()
void clear_table |
( |
const gpudb::GPUdb & |
db, |
|
|
const std::string |
table_name |
|
) |
| |
◆ create_table() [1/2]
Create a table given a DB hancle, table name, and a type.
Clear any pre-existing table
◆ create_table() [2/2]
Create a table given a DB hancle, table name, and a list of columns.
Clear any pre-existing table
◆ generate_charN()
std::string generate_charN |
( |
size_t |
N | ) |
|
◆ generate_date()
std::string generate_date |
( |
| ) |
|
◆ generate_datetime()
std::string generate_datetime |
( |
int |
chance_percentage_has_time, |
|
|
int |
chance_percentage_has_ms |
|
) |
| |
◆ generate_decimal()
std::string generate_decimal |
( |
int |
frac_only_percentage, |
|
|
int |
has_frac_percentage, |
|
|
int |
negative_percentage, |
|
|
int |
positive_percentage |
|
) |
| |
◆ generate_random_string()
std::string generate_random_string |
( |
| ) |
|
◆ generate_time()
std::string generate_time |
( |
int |
chance_percentage_has_ms | ) |
|
◆ alphabet_size
const int alphabet_size = 62 |
|
static |
◆ alphanum
const char alphanum[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
|
static |