当前位置: 首页>>代码示例>>C++>>正文


C++ ObRootServer2::get_time_stamp_changing方法代码示例

本文整理汇总了C++中ObRootServer2::get_time_stamp_changing方法的典型用法代码示例。如果您正苦于以下问题:C++ ObRootServer2::get_time_stamp_changing方法的具体用法?C++ ObRootServer2::get_time_stamp_changing怎么用?C++ ObRootServer2::get_time_stamp_changing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObRootServer2的用法示例。


在下文中一共展示了ObRootServer2::get_time_stamp_changing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: master_wrapper

TEST(ObRootServer2LogTest, start_switch)
{
  ObRootServer2 master;
  ObRootWorkerForTest master_worker;
  ASSERT_TRUE(master.init("./root_server.conf", 100, &master_worker));
  ObRootServerTester master_wrapper(&master);
  master_wrapper.stop_thread();

  ObRootServer2 slave;
  ObRootWorkerForTest slave_worker;
  ASSERT_TRUE(slave.init("./root_server.conf", 100, &slave_worker));
  ObRootServerTester slave_wrapper(&slave);
  slave_wrapper.stop_thread();

  master_wrapper.set_master(true);
  master_wrapper.stop_thread();
  slave_wrapper.stop_thread();
  slave_wrapper.set_master(false);

  TBSYS_LOG(DEBUG, "Server status: %d", master_wrapper.get_server_status());
  bool ret = master.start_switch();
  TBSYS_LOG(DEBUG, "Server status: %d", master_wrapper.get_server_status());
  ASSERT_TRUE(ret);
  TBSYS_LOG(DEBUG, "master start switch done");

  int64_t ts = master.get_time_stamp_changing();

  ObRootLogWorker log_worker = slave_wrapper.get_log_worker();
  log_worker.do_start_report(ts, true);
  log_worker.do_start_switch(ts);
  TBSYS_LOG(DEBUG, "slave start switch done");

  int64_t slave_ts = slave.get_time_stamp_changing();

  ASSERT_EQ(ts, slave_ts);
  ASSERT_EQ(master_wrapper.get_server_status(), slave_wrapper.get_server_status());
}
开发者ID:Abioy,项目名称:oceanbase,代码行数:37,代码来源:root_server_log_test.cpp

示例2: server

TEST(ObRootServer2LogTest, cs_schema_changed)
{
  int32_t port = 1001;
  ObServer server(ObServer::IPV4, "10.10.10.1", port);
  int64_t ts = 12345;

  ObRootServer2 root;
  ObRootWorkerForTest worker;
  ASSERT_TRUE(root.init("./root_server.conf", 100, &worker));
  ObRootServerTester wrapper(&root);
  wrapper.stop_thread();

  wrapper.get_log_worker().do_cs_regist(server, ts);
  ObChunkServerManager& slave_server_manager = wrapper.get_server_manager();
  ObChunkServerManager::iterator it = slave_server_manager.find_by_ip(server);
  ASSERT_TRUE(it != slave_server_manager.end());

  it->status_ = ObServerStatus::STATUS_REPORTING;

  wrapper.get_log_worker().do_cs_merge_over(it->server_, root.get_time_stamp_changing());
  ASSERT_EQ(ObServerStatus::STATUS_REPORTED, it->status_);

}
开发者ID:Abioy,项目名称:oceanbase,代码行数:23,代码来源:root_server_log_test.cpp


注:本文中的ObRootServer2::get_time_stamp_changing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。