Beispiel #1
0
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;
}
Beispiel #2
0
void fetch_schema(MockClient &client, int64_t timestamp)
{
  ObSchemaManagerV2 *schema_mgr = new(std::nothrow) ObSchemaManagerV2();
  if (NULL == schema_mgr)
  {
    fprintf(stdout, "[%s] new ObSchemaManagerV2 fail\n", __FUNCTION__);
  }
  else
  {
    int err = client.fetch_schema(timestamp, *schema_mgr, timeout);
    fprintf(stdout, "[%s] err=%d\n", __FUNCTION__, err);
    if (OB_SUCCESS == err)
    {
      print_schema(*schema_mgr);
    }
    delete schema_mgr;
  }
}