本文整理汇总了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);
}