CUBRID Engine
latest
|
#include "porting.h"
#include "thread_manager.hpp"
#include <stdio.h>
#include <pthread.h>
#include <log_impl.h>
#include <sys/time.h>
Go to the source code of this file.
Macros | |
#define | strlen(s1) ((int) strlen(s1)) |
#define | NOPS_SNAPSHOT 1000000 |
#define | NOPS_COMPLPETE 1000000 |
#define | NOPS_OLDEST 2000000 |
#define | MVCC_BITAREA_ELEMENT_BITS 64 |
#define | MVCC_BITAREA_ELEMENT_ALL_COMMITTED 0xffffffffffffffffULL |
#define | MVCC_BITAREA_BIT_COMMITTED 1 |
#define | MVCC_BITAREA_BIT_ACTIVE 0 |
#define | MVCC_BITAREA_ELEMENTS_AFTER_FULL_CLEANUP 16 |
#define | MVCC_BITAREA_MAXIMUM_ELEMENTS 500 |
#define | MVCC_BITAREA_MAXIMUM_BITS 32000 |
#define | MVCC_BITAREA_BITS_TO_ELEMENTS(count_bits) (((count_bits) + 63) >> 6) |
#define | MVCC_BITAREA_BITS_TO_BYTES(count_bits) ((((count_bits) + 63) >> 6) << 3) |
#define | MVCC_BITAREA_ELEMENTS_TO_BYTES(count_elements) ((count_elements) << 3) |
#define | MVCC_BITAREA_ELEMENTS_TO_BITS(count_elements) ((count_elements) << 6) |
#define | MSG_LEN 40 |
#define | MAX_THREADS 100 |
#define | MAX_SNAPSHOT_THREADS 10 |
#define | MAX_COMPLETE_THREADS 10 |
#define | MAX_OLDEST_THREADS 1 |
Functions | |
static void | begin (char *test_name) |
static int | success () |
static void | logtb_initialize_mvcctable (void) |
static void | logtb_finalize_mvcctable () |
static unsigned int | logtb_tran_btid_hash_func (const void *key, const unsigned int ht_size) |
static int | logtb_tran_btid_hash_cmp_func (const void *key1, const void *key2) |
static void | logtb_initialize_tdes_for_mvcc_testing (LOG_TDES *tdes, int tran_index) |
static int | logtb_initialize_mvcc_testing (int num_threads, THREAD_ENTRY **thread_array) |
static void | logtb_finalize_mvcc_testing (THREAD_ENTRY **thread_array) |
THREAD_RET_T THREAD_CALLING_CONVENTION | test_mvcc_get_snapshot (void *param) |
THREAD_RET_T THREAD_CALLING_CONVENTION | test_new_mvcc_complete (void *param) |
THREAD_RET_T THREAD_CALLING_CONVENTION | test_mvcc_get_oldest (void *param) |
static int | test_mvcc_operations (int num_snapshot_threads, int num_complete_threads, int num_oldest_mvccid_threads, THREAD_ENTRY *thread_array) |
int | main (int argc, char **argv) |
Variables | |
static struct timeval | start_time |
static UINT64 | count_snapshots = 0 |
static UINT64 | count_complete = 0 |
static UINT64 | count_oldest = 0 |
#define MAX_COMPLETE_THREADS 10 |
Referenced by main().
#define MAX_OLDEST_THREADS 1 |
Referenced by main().
#define MAX_SNAPSHOT_THREADS 10 |
Referenced by main().
#define MAX_THREADS 100 |
Referenced by test_mvcc_operations().
#define MSG_LEN 40 |
Referenced by begin().
#define MVCC_BITAREA_BIT_ACTIVE 0 |
Definition at line 42 of file unittests_snapshot.c.
#define MVCC_BITAREA_BIT_COMMITTED 1 |
Definition at line 41 of file unittests_snapshot.c.
#define MVCC_BITAREA_BITS_TO_BYTES | ( | count_bits | ) | ((((count_bits) + 63) >> 6) << 3) |
Definition at line 54 of file unittests_snapshot.c.
#define MVCC_BITAREA_BITS_TO_ELEMENTS | ( | count_bits | ) | (((count_bits) + 63) >> 6) |
Definition at line 53 of file unittests_snapshot.c.
#define MVCC_BITAREA_ELEMENT_ALL_COMMITTED 0xffffffffffffffffULL |
Definition at line 40 of file unittests_snapshot.c.
#define MVCC_BITAREA_ELEMENT_BITS 64 |
Definition at line 39 of file unittests_snapshot.c.
#define MVCC_BITAREA_ELEMENTS_AFTER_FULL_CLEANUP 16 |
Definition at line 45 of file unittests_snapshot.c.
#define MVCC_BITAREA_ELEMENTS_TO_BITS | ( | count_elements | ) | ((count_elements) << 6) |
Definition at line 56 of file unittests_snapshot.c.
#define MVCC_BITAREA_ELEMENTS_TO_BYTES | ( | count_elements | ) | ((count_elements) << 3) |
Definition at line 55 of file unittests_snapshot.c.
#define MVCC_BITAREA_MAXIMUM_BITS 32000 |
Definition at line 51 of file unittests_snapshot.c.
#define MVCC_BITAREA_MAXIMUM_ELEMENTS 500 |
Definition at line 48 of file unittests_snapshot.c.
#define NOPS_COMPLPETE 1000000 |
Definition at line 35 of file unittests_snapshot.c.
Referenced by test_mvcc_operations(), and test_new_mvcc_complete().
#define NOPS_OLDEST 2000000 |
Definition at line 36 of file unittests_snapshot.c.
Referenced by test_mvcc_get_oldest(), and test_mvcc_operations().
#define NOPS_SNAPSHOT 1000000 |
Definition at line 34 of file unittests_snapshot.c.
Referenced by test_mvcc_get_snapshot(), and test_mvcc_operations().
#define strlen | ( | s1 | ) | ((int) strlen(s1)) |
Definition at line 32 of file unittests_snapshot.c.
Referenced by begin().
|
static |
Definition at line 62 of file unittests_snapshot.c.
References i, MSG_LEN, NULL, start_time, and strlen.
Referenced by test_mvcc_operations().
|
static |
Definition at line 224 of file unittests_snapshot.c.
References trantable::all_tdes, trantable::area, mvcc_active_tran::finalize(), free_and_init, i, log_Gl, log_tdes::log_upd_stats, logtb_finalize_mvcctable(), mvcc_snapshot::m_active_mvccs, mht_destroy(), log_tdes::mvccinfo, NULL, trantable::num_total_indices, mvcc_info::snapshot, log_global::trantable, and log_tran_update_stats::unique_stats_hash.
Referenced by main().
|
static |
Definition at line 102 of file unittests_snapshot.c.
References mvcctable::finalize(), log_Gl, and log_global::mvcc_table.
Referenced by logtb_finalize_mvcc_testing().
|
static |
Definition at line 135 of file unittests_snapshot.c.
References trantable::all_tdes, trantable::area, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, error(), free_and_init, log_global::hdr, i, log_Gl, logtb_initialize_mvcctable(), logtb_initialize_tdes_for_mvcc_testing(), log_header::mvcc_next_id, MVCCID_FIRST, log_addr_tdesarea::next, NO_ERROR, NULL, trantable::num_total_indices, log_addr_tdesarea::tdesarea, log_global::trantable, and TT_WORKER.
Referenced by main().
|
static |
Definition at line 95 of file unittests_snapshot.c.
References mvcctable::initialize(), log_Gl, and log_global::mvcc_table.
Referenced by logtb_initialize_mvcc_testing().
|
static |
Definition at line 121 of file unittests_snapshot.c.
References mvcc_info::init(), log_tdes::log_upd_stats, logtb_tran_btid_hash_cmp_func(), logtb_tran_btid_hash_func(), mht_create(), log_tdes::mvccinfo, NULL_TRANID, log_tdes::tran_index, log_tdes::trid, and log_tran_update_stats::unique_stats_hash.
Referenced by logtb_initialize_mvcc_testing().
Definition at line 114 of file unittests_snapshot.c.
Referenced by logtb_initialize_tdes_for_mvcc_testing().
|
static |
Definition at line 108 of file unittests_snapshot.c.
Referenced by logtb_initialize_tdes_for_mvcc_testing().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 483 of file unittests_snapshot.c.
References ER_FAILED, fail(), logtb_finalize_mvcc_testing(), logtb_initialize_mvcc_testing(), MAX_COMPLETE_THREADS, MAX_OLDEST_THREADS, MAX_SNAPSHOT_THREADS, NO_ERROR, NULL, and test_mvcc_operations().
|
static |
Definition at line 80 of file unittests_snapshot.c.
References NO_ERROR, NULL, and start_time.
Referenced by test_mvcc_operations().
THREAD_RET_T THREAD_CALLING_CONVENTION test_mvcc_get_oldest | ( | void * | param | ) |
Definition at line 347 of file unittests_snapshot.c.
References cubthread::clear_thread_local_entry(), count_oldest, mvcctable::get_global_oldest_visible(), i, log_Gl, MVCC_ID_PRECEDES, log_global::mvcc_table, MVCCID_NULL, NOPS_OLDEST, cubthread::set_thread_local_entry(), and THREAD_RET_T.
Referenced by test_mvcc_operations().
THREAD_RET_T THREAD_CALLING_CONVENTION test_mvcc_get_snapshot | ( | void * | param | ) |
Definition at line 267 of file unittests_snapshot.c.
References cubthread::clear_thread_local_entry(), count_snapshots, i, LOG_FIND_TDES(), LOG_FIND_THREAD_TRAN_INDEX, log_Gl, logtb_get_mvcc_snapshot(), log_global::mvcc_table, log_tdes::mvccinfo, NOPS_SNAPSHOT, NULL, mvcc_info::reset(), mvcctable::reset_transaction_lowest_active(), cubthread::set_thread_local_entry(), THREAD_CALLING_CONVENTION, and THREAD_RET_T.
Referenced by test_mvcc_operations().
|
static |
Definition at line 384 of file unittests_snapshot.c.
References begin(), count_complete, count_oldest, count_snapshots, ER_FAILED, i, MAX_THREADS, NO_ERROR, NOPS_COMPLPETE, NOPS_OLDEST, NOPS_SNAPSHOT, NULL, success(), test_mvcc_get_oldest(), test_mvcc_get_snapshot(), and test_new_mvcc_complete().
Referenced by main().
THREAD_RET_T THREAD_CALLING_CONVENTION test_new_mvcc_complete | ( | void * | param | ) |
Definition at line 304 of file unittests_snapshot.c.
References cubthread::clear_thread_local_entry(), count_complete, i, LOG_FIND_TDES(), LOG_FIND_THREAD_TRAN_INDEX, log_Gl, logtb_complete_mvcc(), logtb_get_current_mvccid(), log_global::mvcc_table, MVCCID_NULL, NOPS_COMPLPETE, mvcctable::reset_transaction_lowest_active(), cubthread::set_thread_local_entry(), THREAD_CALLING_CONVENTION, and THREAD_RET_T.
Referenced by test_mvcc_operations().
|
static |
Definition at line 263 of file unittests_snapshot.c.
Referenced by test_mvcc_operations(), and test_new_mvcc_complete().
|
static |
Definition at line 264 of file unittests_snapshot.c.
Referenced by test_mvcc_get_oldest(), and test_mvcc_operations().
|
static |
Definition at line 262 of file unittests_snapshot.c.
Referenced by test_mvcc_get_snapshot(), and test_mvcc_operations().
|
static |
Definition at line 59 of file unittests_snapshot.c.