The world's most popular open source database
#include <ndb_global.h>#include "../CpcClient.hpp"#include <Vector.hpp>Include dependency graph for test_cpcd.cpp:

Go to the source code of this file.
Defines | |
| #define | ABORT() {ndbout_c("ABORT"); while(true); abort();} |
Functions | |
| SimpleCpcClient | g_client ("localhost", 1234) |
| void | define () |
| void | start (SimpleCpcClient::Process &p) |
| void | stop (SimpleCpcClient::Process &p) |
| void | undefine (SimpleCpcClient::Process &p) |
| void | list () |
| SimpleCpcClient::Process * | find (int id) |
| int | main (void) |
Variables | |
| Vector< SimpleCpcClient::Process > | g_procs |
| int | name = 0 |
| #define ABORT | ( | ) | {ndbout_c("ABORT"); while(true); abort();} |
Definition at line 32 of file test_cpcd.cpp.
Referenced by define(), list(), start(), stop(), and undefine().
| void define | ( | ) |
Definition at line 80 of file test_cpcd.cpp.
References ABORT, g_client(), g_procs, name, ndbout_c(), and Properties::print().
Referenced by ce_inc_search(), NDB_CPC::Computer::defineProcess(), and main().
00080 { 00081 SimpleCpcClient::Process m_proc; 00082 m_proc.m_id = -1; 00083 m_proc.m_type = "temporary"; 00084 m_proc.m_owner = "atrt"; 00085 m_proc.m_group = "group"; 00086 //m_proc.m_cwd 00087 //m_proc.m_env 00088 //proc.m_proc.m_stdout = "log.out"; 00089 //proc.m_proc.m_stderr = "2>&1"; 00090 //proc.m_proc.m_runas = proc.m_host->m_user; 00091 m_proc.m_ulimit = "c:unlimited"; 00092 if((rand() & 15) >= 0){ 00093 m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "sleep"); 00094 m_proc.m_path.assign("/bin/sleep"); 00095 m_proc.m_args = "600"; 00096 } else { 00097 m_proc.m_name.assfmt("%d-%d-%s", getpid(), name++, "test.sh"); 00098 m_proc.m_path.assign("/home/jonas/run/cpcd/test.sh"); 00099 m_proc.m_args = "600"; 00100 } 00101 g_procs.push_back(m_proc); 00102 00103 Properties reply; 00104 if(g_client.define_process(g_procs.back(), reply) != 0){ 00105 ndbout_c("define %s -> ERR", m_proc.m_name.c_str()); 00106 reply.print(); 00107 ABORT(); 00108 } 00109 ndbout_c("define %s -> %d", m_proc.m_name.c_str(), m_proc.m_id); 00110 }
Here is the call graph for this function:

Here is the caller graph for this function:

| SimpleCpcClient::Process * find | ( | int | id | ) |
Definition at line 151 of file test_cpcd.cpp.
References g_procs.
Referenced by Dbdict::drop_fg_commit_start(), find_item_in_list(), find_set(), find_type(), Item_func_find_in_set::fix_length_and_dec(), list(), yaSSL::Sessions::lookup(), mysql_alter_table(), yaSSL::Sessions::remove(), test_read(), test_update(), unlink_open_table(), and Item_func_find_in_set::val_int().
00151 { 00152 for(Uint32 i = 0; i<g_procs.size(); i++){ 00153 if(g_procs[i].m_id == id) 00154 return &g_procs[i]; 00155 } 00156 return 0; 00157 }
Here is the caller graph for this function:

| SimpleCpcClient g_client | ( | "localhost" | , | |
| 1234 | ||||
| ) |
| void list | ( | ) |
Definition at line 136 of file test_cpcd.cpp.
References ABORT, find(), g_client(), p, Properties::print(), and Vector< T >::size().
Referenced by add_status_vars(), add_to_list(), Dbtux::addAccLockOp(), Dbtup::addAccLockOp(), Ndbd_mem_manager::alloc(), Dbtup::alloc_var_part(), Dbtup::allocTabDescr(), EventBufData_list::append_list(), apply(), client_test(), Lgman::compute_free_file_pages(), NDB_CPC::ComputerRemoveDialog::ComputerRemoveDialog_Load(), List< partition_element >::concat(), base_list::concat(), Dbdict::create_file_abort_complete(), Dbdict::create_file_prepare_start(), Dbdict::createTab_dih(), delete_elements(), desc_table(), List< partition_element >::disjoin(), base_list::disjoin(), Dbtup::disk_page_prealloc(), Dbtup::disk_page_prealloc_callback_common(), Dbtup::disk_page_set_dirty(), Dbtup::disk_page_unmap_callback(), display_table_locks(), Dbdict::drop_fg_commit_start(), Lgman::drop_filegroup_drop_files(), Dbtup::drop_fragment_free_exent(), Dbtup::drop_fragment_unmap_pages(), NdbDictionaryImpl::dropTable(), NdbDictionaryImpl::dropTableGlobal(), Dbtup::dump_disk_alloc(), dyn_array_add_block(), Dbtup::execACC_SCANREQ(), Dbtc::execDI_FCOUNTCONF(), Pgman::execDUMP_STATE_ORD(), Lgman::execDUMP_STATE_ORD(), Suma::execFIRE_TRIG_ORD(), Tsman::execFSCLOSECONF(), Lgman::execFSCLOSECONF(), Tsman::find_file_by_id(), find_named(), Dbtup::findFreeLeftNeighbours(), Dbtup::findFreeRightNeighbours(), Lgman::force_log_sync(), NdbEventBuffer::free_list(), free_list(), Dbtup::freeTabDescr(), Dbtup::get_alloc_page(), Dbtup::get_empty_var_page(), Logfile_client::get_log_buffer(), Dbdict::getIndexAttrList(), Dbdict::getTableKeyList(), Dbdict::handleTabInfo(), history_arg_extract(), ib_list_add_after(), ib_list_add_first(), ib_list_add_last(), ib_list_create(), ib_list_create_heap(), ib_list_free(), ib_list_remove(), Lgman::init_run_undo_log(), Ndbd_mem_manager::insert_free_list(), insert_view_fields(), Dbtup::itdaMergeTabDescr(), Item_func::Item_func(), Item_func_case::Item_func_case(), Item_sum::Item_sum(), list(), list_cons(), list_length(), list_walk(), NdbDictionaryImpl::listIndexes(), NdbDictionary::Dictionary::listIndexes(), NdbDictInterface::listObjects(), NdbDictionaryImpl::listObjects(), NdbDictionary::Dictionary::listObjects(), NDB_CPC::Computer::listProcesses(), main(), make_leaves_list(), map_file(), mem_heap_add_block(), mem_heap_block_free(), EventBufData_list::move_gci_ops(), mutex_create_func(), mutex_free(), mysql_create_user(), mysql_drop_user(), mysql_grant(), mysql_ha_read(), mysql_rename_user(), mysql_revoke_all(), Dbdict::packTableIntoPages(), File_parser::parse(), InitConfigFileParser::parse_mycnf(), parse_query(), List< partition_element >::prepand(), base_list::prepand(), Lgman::process_log_buffer_waiters(), Lgman::process_log_sync_waiters(), NDB_CPC::ProcessDefineDialog::ProcessDefineDialog_Load(), Dbtup::releaseScanOp(), Dbdict::releaseTableObject(), NdbTransaction::remove_list(), remove_status_vars(), Dbtux::removeAccLockOp(), Dbtup::removeAccLockOp(), Suma::resend_bucket(), Dbtup::returnCommonArea(), rw_lock_create_func(), rw_lock_free(), Dbtup::scanClose(), Dbtup::scanNext(), Select_fetch_protocol_prep::send_fields(), Protocol::send_fields(), Item_func::set_arguments(), set_ulimit(), Item_func_group_concat::setup(), Item_sum_count_distinct::setup(), Logfile_client::sync_lsn(), test_if_group_changed(), LogHandlerListUnitTest::testAdd(), LogHandlerListUnitTest::testRemove(), LogHandlerListUnitTest::testTraverseNext(), unlink_open_table(), update(), sys_var_key_buffer_size::update(), Dbtup::update_free_page_list(), NDB_CPC::PanelWizard::updateComputers(), and NDB_CPC::CPC::updateListViews().
00136 { 00137 Properties reply; 00138 Vector<SimpleCpcClient::Process> procs; 00139 if(g_client.list_processes(procs, reply) != 0){ 00140 reply.print(); 00141 ABORT(); 00142 } 00143 00144 for(Uint32 i = 0; i<procs.size(); i++){ 00145 SimpleCpcClient::Process * p = find(procs[i].m_id); 00146 if(p != 0){ 00147 p->m_status = procs[i].m_status; 00148 } 00149 } 00150 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int main | ( | void | ) |
Definition at line 37 of file test_cpcd.cpp.
References define(), g_client(), g_procs, list(), ndbout_c(), p, start(), stop(), test, and undefine().
00037 { 00038 00039 g_client.connect(); 00040 00041 srand(time(0)); 00042 for(int i = 0; i<1000; i++){ 00043 int sz = g_procs.size(); 00044 int test = rand() % 100; 00045 if(sz == 0 || test < 10){ 00046 define(); 00047 continue; 00048 } 00049 00050 list(); 00051 00052 int proc = rand() % g_procs.size(); 00053 SimpleCpcClient::Process & p = g_procs[proc]; 00054 if(p.m_status == "running" && test > 50){ 00055 ndbout_c("undefine %d: %s (running)", p.m_id, p.m_name.c_str()); 00056 undefine(p); 00057 g_procs.erase(proc); 00058 continue; 00059 } 00060 if(p.m_status == "running" && test <= 50){ 00061 ndbout_c("stop %d: %s(running)", p.m_id, p.m_name.c_str()); 00062 stop(p); 00063 continue; 00064 } 00065 if(p.m_status == "stopped" && test > 50){ 00066 ndbout_c("undefine %d: %s(stopped)", p.m_id, p.m_name.c_str()); 00067 undefine(p); 00068 g_procs.erase(proc); 00069 continue; 00070 } 00071 if(p.m_status == "stopped" && test <= 50){ 00072 ndbout_c("start %d %s(stopped)", p.m_id, p.m_name.c_str()); 00073 start(p); 00074 continue; 00075 } 00076 ndbout_c("Unknown: %s", p.m_status.c_str()); 00077 } 00078 }
Here is the call graph for this function:

| void start | ( | SimpleCpcClient::Process & | p | ) |
Definition at line 112 of file test_cpcd.cpp.
References ABORT, g_client(), and Properties::print().
Referenced by _db_explain_(), _history_expand_command(), _mi_bin_search(), _mi_calc_var_pack_key_length(), _mi_get_pack_key(), _mi_keylength(), _mi_keylength_part(), _mi_make_key(), _mi_store_var_pack_key(), _rl_vi_save_insert(), Ndbd_mem_manager::alloc(), Dbtup::alloc_page(), append_field(), azread(), bench_aes(), bench_arc4(), bench_blowfish(), bench_des(), bench_dh(), bench_dsa(), bench_md5(), bench_ripemd(), bench_rsa(), bench_sha(), bench_twofish(), Dbtup::buildIndex(), check_column_name(), check_db_name(), check_if_keyname_exists(), cleanup_dirname(), cli_fetch_lengths(), SignalSender::connectAll(), SignalSender::connectOne(), NdbReceiver::copyout(), descript(), dict_skip_word(), digits_bounds(), fetch_string_with_conversion(), Instance_options::fill_instance_version(), in_vector::find(), find_set(), find_table(), find_uniq_filename(), findmust(), Item_func_substr::fix_length_and_dec(), freetest(), ft_init_stopwords(), ftb_parse_query_internal(), get_arg(), get_errcodes(), get_hash_link(), get_interval_info(), get_next_bit(), get_next_time(), get_one_option(), get_privilege_desc(), get_replace(), get_replace_column(), get_sort(), get_string(), get_text(), get_word(), gzread(), history_expand(), history_tokenize(), history_tokenize_internal(), ieee_read_cxx_class(), ieee_read_cxx_defaults(), ieee_read_cxx_misc(), ieee_read_expression(), ieee_read_reference(), ieee_read_type_index(), ieee_require_asn(), ieee_require_atn65(), key_cache_read(), link_hash(), ListAdd(), ListDel(), lock_deadlock_recursive(), lock_tables(), log_check_log_recs(), log_reset_first_header_and_checkpoint(), main(), make_unique_key_name(), malloctest(), mapSegment(), matcher(), merge_key_fields(), mmaptest(), multi_alloc_root(), my_b_gets(), my_b_vprintf(), my_multi_malloc(), my_path(), my_setwd(), my_sleep(), my_strtoll10(), my_vsnprintf(), mysql_create_table_internal(), MYSQLlex(), ndb_mgm_get_configuration(), open_tables(), sp_instr_jump::opt_shortcut_jump(), p_b_term(), p_bre(), pack_dirname(), parse_error_string(), parse_message_string(), parse_version_number(), print_buffer_to_file(), print_ror_scans_arr(), Query_log_event::Query_log_event(), r_strinstr(), Restore::read_file(), Dbtup::releaseFragPages(), remove_cntrl(), remove_key(), replace(), replace_strings_append(), rl_change_case(), rl_complete_internal(), rl_delete_horizontal_space(), rl_do_undo(), rl_tilde_expand(), run_test(), DbUtil::runTransaction(), Dbtux::searchToAdd(), Dbtux::searchToRemove(), Ndbcntr::Missra::sendNextSTTOR(), Dbdih::sendStartFragreq(), simple_parser_parse(), Dbtup::sizeOfReadFunction(), sp_cache_routines_and_add_tables_aux(), BaseString::split(), stab_demangle_arg(), NDB_CPC::Computer::startProcess(), NDB_CPC::startDatabaseDlg::startProcesses(), str2int(), str_to_datetime(), strcont(), strinstr(), strip_sp(), strsvis(), strsvisx(), strunvisx(), test_if_number(), test_pool(), tilde_expand(), trim_space(), unlink_open_table(), unmapSegment(), unmaptest(), Item_func_locate::val_int(), Item_func_interval::val_int(), Item_func_quote::val_str(), Item_func_substr::val_str(), Item_func_right::val_str(), Item_func_insert::val_str(), Query_log_event::write(), yaSSL::X509_NAME_get_index_by_NID(), and mySTL::list< T >::~list().
00112 { 00113 Properties reply; 00114 if(g_client.start_process(p.m_id, reply) != 0){ 00115 reply.print(); 00116 ABORT(); 00117 } 00118 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void stop | ( | SimpleCpcClient::Process & | p | ) |
Definition at line 120 of file test_cpcd.cpp.
References ABORT, g_client(), and Properties::print().
Referenced by bin2decimal(), Dbtup::buildIndex(), digits_bounds(), do_add(), main(), matcher(), Parser< T >::parse(), Dbtup::releaseFragPages(), Dbdih::sendStartFragreq(), Backup::sendStopBackup(), FsBuffer::setup(), Qmgr::stateArbitFind(), Qmgr::stateArbitPrep(), Qmgr::stateArbitRun(), NDB_CPC::Computer::stopProcess(), test_pool(), ArbitMgr::threadMain(), and SignalSender::waitFor().
00120 { 00121 Properties reply; 00122 if(g_client.stop_process(p.m_id, reply) != 0){ 00123 reply.print(); 00124 ABORT(); 00125 } 00126 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void undefine | ( | SimpleCpcClient::Process & | p | ) |
Definition at line 128 of file test_cpcd.cpp.
References ABORT, g_client(), and Properties::print().
Referenced by main(), and NDB_CPC::Computer::undefineProcess().
00128 { 00129 Properties reply; 00130 if(g_client.undefine_process(p.m_id, reply) != 0){ 00131 reply.print(); 00132 ABORT(); 00133 } 00134 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int name = 0 |
Definition at line 34 of file test_cpcd.cpp.
1.4.7

