37 " usage: apache_log_query <row-prefix> [ <cf> ... ]\n"
39 " Queries the table 'LogDb' for all rows that start\n"
40 " with <row-prefix>. If no column families are\n"
41 " specified, then all column families are returned.\n"
42 " Otherwise, just the column families specified by\n"
43 " the <cf> arguments are returned\n";
52 int main(
int argc,
char **argv) {
62 cout << usage << endl;
72 namespace_ptr = client_ptr->open_namespace(
"/");
75 table_ptr = namespace_ptr->open_table(
"LogDb");
79 end_row.append(1, static_cast<char>(0xff));
83 for (
int i=2; i<argc; i++)
87 scanner_ptr.reset(table_ptr->create_scanner(scan_spec_builder.
get()));
90 catch (std::exception &e) {
91 cerr <<
"error: " << e.what() << endl;
96 while (scanner_ptr->next(cell)) {
100 printf(
"\t%s\n", std::string((
const char *)cell.
value,
Retrieves system information (hardware, installation directory, etc)
ScanSpec & get()
Returns the built ScanSpec object.
std::string String
A String is simply a typedef to std::string.
int main(int argc, char **argv)
This program is designed to query the table 'LogDb' for the contents of the row that has the key equa...
const char * column_qualifier
std::shared_ptr< TableScanner > TableScannerPtr
Smart pointer to TableScanner.
std::shared_ptr< Namespace > NamespacePtr
Shared smart pointer to Namespace.
std::shared_ptr< Client > ClientPtr
Compatibility Macros for C/C++.
Helper class for building a ScanSpec.
static String locate_install_dir(const char *argv0)
Returns the installation directory.
void add_column(const string &str)
Adds a column family to be returned by the scan.
void add_row_interval(const string &start, bool start_inclusive, const string &end, bool end_inclusive)
Adds a row interval to be returned in the scan.
const char * column_family
Encapsulates decomposed key and value.
Error codes, Exception handling, error logging.
std::shared_ptr< Table > TablePtr