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


C++ ObScanner::is_empty方法代码示例

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


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

示例1: test_chunk_server

TEST_F(TestRpcStub, test_scan_servers) 
{
  ObMergerRpcStub stub;
  ThreadSpecificBuffer buffer;
  ObPacketFactory factory;
  tbnet::Transport transport;
  tbnet::DefaultPacketStreamer streamer; 
  streamer.setPacketFactory(&factory);
  transport.start();
  ObClientManager client_manager;

  EXPECT_TRUE(OB_SUCCESS == client_manager.initialize(&transport, &streamer));
  EXPECT_TRUE(OB_SUCCESS == stub.init(&buffer, &client_manager));

  ObMergerTabletLocationList list;
  
	ObServer chunk_server;
  chunk_server.set_ipv4_addr(addr, MockChunkServer::CHUNK_SERVER_PORT);

  ObTabletLocation addr;
  //addr.tablet_id_ = 100;
  addr.chunkserver_ = chunk_server;

  list.add(addr); 
  list.add(addr); 
  list.add(addr); 

  // start root server
  MockChunkServer server;
  MockServerRunner test_chunk_server(server);
  tbsys::CThread chunk_server_thread;
  chunk_server_thread.start(&test_chunk_server, NULL); 
  sleep(2); 

  ObScanParam param;
  ObCellInfo cell;
  ObRange range;
  ObString name;
  ObScanner scanner;

  param.set(1, name, range);
  EXPECT_TRUE(OB_SUCCESS == stub.scan(timeout, chunk_server, param, scanner));
  EXPECT_TRUE(!scanner.is_empty());
  
  uint64_t count = 0;
  ObScannerIterator iter;
  for (iter = scanner.begin(); iter != scanner.end(); ++iter)
  {
    EXPECT_TRUE(OB_SUCCESS == iter.get_cell(cell));
    //EXPECT_TRUE(cell.column_id_ == count);
    printf("client:%.*s\n", cell.row_key_.length(), cell.row_key_.ptr());
    ++count;
  }
  // return 10 cells
  EXPECT_TRUE(count == 10);
	ObMergerTabletLocation succ_addr;
  bool update = false;
  EXPECT_TRUE(OB_SUCCESS == stub.scan(timeout, list, param, succ_addr, scanner, update));
  EXPECT_TRUE(!scanner.is_empty());
  EXPECT_TRUE(update == false);
  for (iter = scanner.begin(); iter != scanner.end(); ++iter)
  {
    EXPECT_TRUE(OB_SUCCESS == iter.get_cell(cell));
    printf("client:%.*s\n", cell.row_key_.length(), cell.row_key_.ptr());
  }
  
  transport.stop();
  server.stop();
  sleep(10);
}
开发者ID:CCoder123,项目名称:pproj,代码行数:70,代码来源:test_merger_rpc_stub.cpp


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