0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LoadMetricsRange.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 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; version 3 of the
9  * License.
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 
22 #ifndef Hypertable_RangeServer_LoadMetricsRange_h
23 #define Hypertable_RangeServer_LoadMetricsRange_h
24 
25 #include "LoadFactors.h"
26 
28 
29 #include <Common/DynamicBuffer.h>
30 #include <Common/String.h>
31 
32 #include <mutex>
33 
34 namespace Hypertable {
35 
37  public:
38  LoadMetricsRange(const String &table_id, const String &start_row, const String &end_row);
39 
40  void change_rows(const String &start_row, const String &end_row) {
41  std::lock_guard<std::mutex> lock(m_mutex);
42  m_new_start_row = start_row;
43  m_new_end_row = end_row;
44  m_new_rows = true;
45  }
46 
47  void compute_and_store(TableMutator *mutator, time_t now,
48  LoadFactors &load_factors,
49  uint64_t disk_used, uint64_t memory_used,
50  double compression_ratio);
51 
52  private:
53 
54  void initialize(const String &table_id, const String &start_row, const String &end_row);
55 
58  const char *m_table_id;
59  const char *m_start_row;
60  const char *m_end_row;
63  bool m_new_rows;
64  time_t m_timestamp;
66  };
67 }
68 
69 
70 #endif // Hypertable_RangeServer_LoadMetricsRange_h
static std::mutex mutex
Definition: Logger.cc:43
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
void change_rows(const String &start_row, const String &end_row)
A dynamic, resizable and reference counted memory buffer.
Definition: DynamicBuffer.h:42
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
Definition: TableMutator.h:55
A dynamic, resizable memory buffer.
Hypertable definitions
LoadMetricsRange(const String &table_id, const String &start_row, const String &end_row)
A String class based on std::string.
void compute_and_store(TableMutator *mutator, time_t now, LoadFactors &load_factors, uint64_t disk_used, uint64_t memory_used, double compression_ratio)
Value format for version 1:
void initialize(const String &table_id, const String &start_row, const String &end_row)