本文整理汇总了C++中Scanner::setRange方法的典型用法代码示例。如果您正苦于以下问题:C++ Scanner::setRange方法的具体用法?C++ Scanner::setRange怎么用?C++ Scanner::setRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scanner
的用法示例。
在下文中一共展示了Scanner::setRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[]) {
if(argc < 8 || argc > 10) {
cout << "Usage: " << argv[0] << " <host> <port> <username> <password> <tableName> <startRowId> <stopRowId> <colFam> <colQual>\n";
return 1;
}
try {
Connector connector(argv[1], atoi(argv[2]), argv[3], argv[4]);
Authorizations auths("");
Scanner scanner = connector.createScanner(argv[5], auths);
Key ks, ke;
ks.row = argv[6]; ke.row = argv[7];
Range range;
range.start = ks;
range.stop = ke;
scanner.setRange(range);
if(argc > 8) {
if(argc == 9) {
scanner.fetchColumnFamily(argv[8]);
}
else if(argc == 10) {
scanner.fetchColumn(argv[8], argv[9]);
}
}
ScannerIterator itr = scanner.iterator();
while(itr.hasNext()) {
KeyValue kv = itr.next();
cout << kv.key.row << " " << kv.key.colFamily << ":"
<< kv.key.colQualifier << " [" << kv.key.colVisibility
<< "] " << kv.key.timestamp << "\t" << kv.value << "\n";
}
itr.close();
connector.close();
} catch(TableNotFoundException &e) {
cout << "The specified table was not found\n";
}
return 0;
}