本文整理汇总了C++中MockClient::destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ MockClient::destroy方法的具体用法?C++ MockClient::destroy怎么用?C++ MockClient::destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MockClient
的用法示例。
在下文中一共展示了MockClient::destroy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
CmdLine clp;
parse_cmd_line(argc, argv, clp);
TBSYS_LOGGER.rotateLog("multi_write.log");
TBSYS_LOGGER.setFileName("multi_write.log");
TBSYS_LOGGER.setLogLevel("info");
clp.log_all();
ob_init_memory_pool();
ObSchemaManager schema_mgr;
if (NULL != clp.schema_file)
{
tbsys::CConfig config;
if (!schema_mgr.parse_from_file(clp.schema_file, config))
{
TBSYS_LOG(WARN, "parse schema fail");
exit(-1);
}
}
else if (OB_SUCCESS != fetch_schema(clp.root_addr, clp.root_port, schema_mgr))
{
TBSYS_LOG(WARN, "fetch schema fail");
exit(-1);
}
schema_mgr.print_info();
MutatorBuilder mb;
mb.init(schema_mgr,
clp.prefix_start, clp.suffix_length,
clp.merge_addr, clp.merge_port, clp.table_start_version,
clp.max_cell, clp.max_row, clp.max_suffix);
if (OB_SUCCESS != mb.init_prefix_end(clp.prefix_end))
{
TBSYS_LOG(WARN, "init prerfix end fail");
exit(-1);
}
ObServer dst_host;
dst_host.set_ipv4_addr(clp.serv_addr, clp.serv_port);
MockClient client;
client.init(dst_host);
for (int64_t i = 0; i < clp.mutator_num; i++)
{
ObMutator mutator;
PageArena<char> allocer;
int ret = OB_SUCCESS;
if (OB_SUCCESS != (ret = mb.build_mutator(mutator, allocer, clp.using_id)))
{
TBSYS_LOG(WARN, "build_mutator fail ret=%d\n", ret);
break;
}
int64_t timeu = tbsys::CTimeUtil::getTime();
ret = client.ups_apply(mutator, TIMEOUT_MS);
TBSYS_LOG(INFO, "apply ret=%d timeu=%ld\n", ret, tbsys::CTimeUtil::getTime() - timeu);
}
client.destroy();
}
示例2: fetch_schema
int fetch_schema(const char *root_addr, const int32_t root_port, ObSchemaManager &schema_mgr)
{
int ret = OB_SUCCESS;
ObServer dst_host;
dst_host.set_ipv4_addr(root_addr, root_port);
MockClient client;
client.init(dst_host);
ret = client.fetch_schema(0, schema_mgr, TIMEOUT_MS);
client.destroy();
return ret;
}
示例3: main
int main(int argc, char **argv)
{
int err = OB_SUCCESS;
ob_init_memory_pool();
CParam param;
err = parse_cmd_args(argc,argv, param);
MockClient client;
if (OB_SUCCESS == err)
{
init_mock_client(param.server_addr_, param.server_port_, client);
err = apply(param, client);
if (err != OB_SUCCESS)
{
TBSYS_LOG(ERROR, "check apply mutation failed:ret[%d]", err);
}
}
client.destroy();
delete param.schema_mgr_;
return err;
}
示例4: main
int main(int argc, char **argv)
{
CmdLine clp;
parse_cmd_line(argc, argv, clp);
TBSYS_LOGGER.rotateLog("total_scan.log");
TBSYS_LOGGER.setFileName("total_scan.log");
TBSYS_LOGGER.setLogLevel("info");
clp.log_all();
ob_init_memory_pool();
ObSchemaManager schema_mgr;
if (NULL != clp.schema_file)
{
tbsys::CConfig config;
if (!schema_mgr.parse_from_file(clp.schema_file, config))
{
TBSYS_LOG(WARN, "parse schema fail");
exit(-1);
}
}
else if (OB_SUCCESS != fetch_schema(clp.root_addr, clp.root_port, schema_mgr))
{
TBSYS_LOG(WARN, "fetch schema fail");
exit(-1);
}
schema_mgr.print_info();
MutatorBuilder mb;
mb.init(schema_mgr, clp.prefix_start, clp.suffix_length, clp.serv_addr, clp.serv_port, clp.table_start_version, clp.max_cell);
ObServer dst_host;
dst_host.set_ipv4_addr(clp.serv_addr, clp.serv_port);
MockClient client;
client.init(dst_host);
scan_check_all(mb, client, clp.table_start_version, clp.using_id, clp.check);
client.destroy();
}
示例5: main
//.........这里部分代码省略.........
}
else if (0 == strcmp("reload_store", clp.cmd_type))
{
reload_store(client, clp.timestamp);
}
else if (0 == strcmp("umount_store", clp.cmd_type))
{
umount_store(client, clp.ini_fname);
}
else if (0 == strcmp("force_report_frozen_version", clp.cmd_type))
{
force_report_frozen_version(client);
}
else if (0 == strcmp("switch_commit_log", clp.cmd_type))
{
switch_commit_log(client);
}
else if (0 == strcmp("get_table_time_stamp", clp.cmd_type))
{
get_table_time_stamp(client, clp.timestamp);
}
else if (0 == strcmp("disable_memtable_checksum", clp.cmd_type))
{
disable_memtable_checksum(client);
}
else if (0 == strcmp("enable_memtable_checksum", clp.cmd_type))
{
enable_memtable_checksum(client);
}
else if (0 == strcmp("immediately_drop_memtable", clp.cmd_type))
{
immediately_drop_memtable(client);
}
else if (0 == strcmp("delay_drop_memtable", clp.cmd_type))
{
delay_drop_memtable(client);
}
else if (0 == strcmp("minor_load_bypass", clp.cmd_type))
{
rc = minor_load_bypass(client);
}
else if (0 == strcmp("major_load_bypass", clp.cmd_type))
{
rc = major_load_bypass(client);
}
else if(0 == strcmp("list_sessions", clp.cmd_type))
{
client.list_sessions(timeout);
}
else if(0 == strcmp("kill_session", clp.cmd_type))
{
client.kill_session(timeout, clp.session_id);
}
else if (0 == strcmp("change_log_level", clp.cmd_type))
{
change_log_level(client, clp.log_level);
}
else if (0 == strcmp("get_slave_ups_info", clp.cmd_type))
{
get_slave_ups_info(client);
}
else if (0 == strcmp("print_scanner", clp.cmd_type))
{
print_scanner(clp.ini_fname);
}
else if (0 == strcmp("print_schema", clp.cmd_type))
{
print_schema(clp.ini_fname);
}
else if (0 == strcmp("sql_query", clp.cmd_type))
{
execute_sql(client, clp.sql_query);
}
else if (0 == strcmp("ups_show_sessions", clp.cmd_type))
{
ups_show_sessions(client);
}
else if (0 == strcmp("ups_kill_session", clp.cmd_type))
{
ups_kill_session(static_cast<uint32_t>(clp.session_id), client);
}
else
{
print_usage();
}
if (!clp.quickly_exit)
{
client.destroy();
TBSYS_LOG(INFO, "ups_admin end==================================================");
return rc;
}
else
{
TBSYS_LOG(INFO, "ups_admin killed==================================================");
fflush(stdout);
fflush(stderr);
_exit(rc);
}
}
示例6: main
int main(int argc, char** argv)
{
const int32_t MOCK_SERVER_LISTEN_PORT = 8888;
MockClient client;
ObServer dst_host;
const char* dst_addr = "localhost";
dst_host.set_ipv4_addr(dst_addr, MOCK_SERVER_LISTEN_PORT);
client.init(dst_host);
// init cell info
static const int64_t ROW_NUM = 1;
static const int64_t COL_NUM = 10;
ObCellInfo cell_infos[ROW_NUM][COL_NUM];
char row_key_strs[ROW_NUM][50];
uint64_t table_id = 10;
// init cell infos
for (int64_t i = 0; i < ROW_NUM; ++i)
{
sprintf(row_key_strs[i], "row_key_%08ld", i);
for (int64_t j = 0; j < COL_NUM; ++j)
{
cell_infos[i][j].table_id_ = table_id;
cell_infos[i][j].row_key_.assign(row_key_strs[i], strlen(row_key_strs[i]));
//cell_infos[i][j].op_info_.set_sem_ob();
cell_infos[i][j].column_id_ = j + 1;
cell_infos[i][j].value_.set_int(1000 + i * COL_NUM + j);
}
}
// scan memtable
ObScanner scanner;
ObScanParam scan_param;
//ObOperateInfo op_info;
ObString table_name;
ObRange range;
const int64_t version = 999;
range.start_key_ = cell_infos[0][0].row_key_;
range.end_key_ = cell_infos[ROW_NUM - 1][0].row_key_;
range.border_flag_.set_inclusive_start();
range.border_flag_.set_inclusive_end();
scan_param.set(table_id, table_name, range);
//scan_param.set_timestamp(version);
//scan_param.set_is_read_frozen_only(false);
ObVersionRange version_range;
version_range.start_version_ = version;
version_range.end_version_ = version;
version_range.border_flag_.set_inclusive_start();
version_range.border_flag_.set_inclusive_end();
scan_param.set_version_range(version_range);
for (int64_t i = 0; i < COL_NUM; ++i)
{
scan_param.add_column(cell_infos[0][i].column_id_);
}
int64_t count = 0;
const int64_t timeout = 10 * 1000L;
int err = client.ups_scan(scan_param, scanner, timeout);
fprintf(stderr, "ups_scan err=%d\n", err);
// check result
count = 0;
ObScannerIterator iter;
for (iter = scanner.begin(); iter != scanner.end(); iter++)
{
ObCellInfo ci;
ObCellInfo expected = cell_infos[count / COL_NUM][count % COL_NUM];
EXPECT_EQ(OB_SUCCESS, iter.get_cell(ci));
check_cell(expected, ci);
++count;
}
EXPECT_EQ(ROW_NUM * COL_NUM, count);
fprintf(stderr, "cell_num=%ld\n", count);
client.destroy();
return 0;
}