49 const char *table, *end_row;
51 ri.
start = scan_start_row.c_str();
52 ri.
end = scan_end_row.c_str();
55 scan_spec.
columns.push_back(
"range");
56 scan_spec.
columns.push_back(
"range_start_row");
57 scan_spec.
columns.push_back(
"range_move");
60 while (scanner->next(cell)) {
61 table = strchr(cell.
row_key,
':') + 1;
63 HT_ASSERT(!(table == NULL || end_row == NULL));
66 RangeMetricsMap::iterator rm_it = range_metrics.find(key);
68 if (rm_it == range_metrics.end()) {
70 pair<RangeMetricsMap::iterator, bool> ret = range_metrics.insert(make_pair(key, rm));
75 rm_it->second.add_measurement((
const char*) cell.
value, cell.
value_len);
77 rm_it->second.set_start_row((
const char*) cell.
value, cell.
value_len);
79 rm_it->second.set_last_move((
const char*) cell.
value, cell.
value_len);
85 scan_spec.
columns.push_back(
"server");
91 while (scanner->next(cell)) {
92 HT_ASSERT(!strcmp(cell.column_family,
"server"));
93 if (empty || server_metrics.back().get_id() != cell.row_key) {
96 server_metrics.push_back(sm);
98 server_metrics.back().add_measurement((
const char*)cell.value, cell.value_len);
std::string String
A String is simply a typedef to std::string.
String format(const char *fmt,...)
Returns a String using printf like format facilities Vanilla snprintf is about 1.5x faster than this...
std::map< String, RangeMetrics > RangeMetricsMap
Facilities for reading and writing sys/RS_METRICS table.
const char * column_qualifier
std::shared_ptr< TableScanner > TableScannerPtr
Smart pointer to TableScanner.
Represents a row interval.
Scan predicate and control specification.
Logging routines and macros.
Declarations for ReaderTable.
Compatibility Macros for C/C++.
Aggregates metrics for an individual range.
const char * column_family
RowIntervals row_intervals
Aggregates metrics for an individual RangeServer.
virtual void get_range_metrics(const char *server_id, RangeMetricsMap &range_metrics)
Encapsulates decomposed key and value.
virtual void get_server_metrics(vector< ServerMetrics > &server_metrics)