0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ReaderTable.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2013 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 3
9  * of the License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
27 
28 #ifndef Hypertable_Lib_RS_METRICS_ReaderTable_H
29 #define Hypertable_Lib_RS_METRICS_ReaderTable_H
30 
31 #include "Reader.h"
32 
33 #include <Hypertable/Lib/KeySpec.h>
34 #include <Hypertable/Lib/Table.h>
35 
36 namespace Hypertable {
37 namespace Lib {
38 namespace RS_METRICS {
39 
40  // This class reads in data from the sys/RS_METRICS table and makes it accessible.
41  // It reads the data either from the sys/RS_METRICS table or from a text file dump if the same
42 
45 
47  class ReaderTable : public Reader {
48  public:
49  ReaderTable(TablePtr &rs_metrics) : m_table(rs_metrics) { }
50  virtual ~ReaderTable() { }
51  virtual void get_range_metrics(const char *server_id,
52  RangeMetricsMap &range_metrics);
53  virtual void get_server_metrics(vector<ServerMetrics> &server_metrics);
54 
55  private:
56 
57  void parse_cell(const KeySpec &key, const char *value, size_t value_len);
59  };
60 
62 
63 } // namespace RS_METRICS
64 } // namespace Lib
65 } // namespace Hypertable
66 
67 #endif // Hypertable_Lib_RS_METRICS_ReaderTable_H
std::map< String, RangeMetrics > RangeMetricsMap
Definition: RangeMetrics.h:104
void parse_cell(const KeySpec &key, const char *value, size_t value_len)
Hypertable definitions
Reads metrics from the sys/RS_METRICS table.
Definition: ReaderTable.h:47
virtual void get_range_metrics(const char *server_id, RangeMetricsMap &range_metrics)
Definition: ReaderTable.cc:43
Declarations for Reader.
virtual void get_server_metrics(vector< ServerMetrics > &server_metrics)
Definition: ReaderTable.cc:83
Interface class for reading RangeServer metrics.
Definition: Reader.h:46
std::shared_ptr< Table > TablePtr
Definition: Table.h:53