35 : m_new_rows(false), m_timestamp(time(0)) {
50 uint64_t disk_used, uint64_t memory_used,
51 double compression_ratio) {
52 bool update_start_row =
false;
53 String old_start_row, old_end_row;
56 lock_guard<mutex> lock(
m_mutex);
58 update_start_row =
true;
79 String value =
format(
"3:%ld,%llu,%llu,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f",
80 rounded_time, (
Llu)disk_used, (
Llu)memory_used,
81 compression_ratio, disk_byte_read_rate, byte_write_rate,
82 byte_read_rate, update_rate, scan_rate, cell_write_rate,
88 key.
row = row.c_str();
91 if (update_start_row) {
126 mutator->
set(key, (uint8_t *)value.c_str(), value.length());
140 m_buffer.
reserve(table_id.length() + 1 + start_row.length() + 1 + end_row.length() + 1);
144 m_buffer.
add(table_id.c_str(), table_id.length()+1);
148 m_buffer.
add(start_row.c_str(), start_row.length()+1);
static LocationInitializerPtr location_initializer
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...
virtual void set_delete(const KeySpec &key)
Deletes an entire row, a column family in a particular row, or a specific cell within a row...
long long unsigned int Llu
Shortcut for printf formats.
const char * column_qualifier
static const uint32_t FLAG_DELETE_CELL
size_t column_qualifier_len
uint8_t * ptr
Pointer to the end of the used part of the buffer.
virtual void set(const KeySpec &key, const void *value, uint32_t value_len)
Inserts a cell into the table.
Provides the ability to mutate a table in the form of adding and deleting rows and cells...
uint8_t * add(const void *data, size_t len)
Adds more data WITH boundary checks; if required the buffer is resized and existing data is preserved...
Compatibility Macros for C/C++.
LoadMetricsRange(const String &table_id, const String &start_row, const String &end_row)
static int32_t metrics_interval
This is a generic exception class for Hypertable.
A String class based on std::string.
LoadFactors m_load_factors
uint8_t * release(size_t *lenp=0)
Moves ownership of the buffer to the caller.
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:
const char * column_family
void initialize(const String &table_id, const String &start_row, const String &end_row)
void reserve(size_t len, bool nocopy=false)
Reserve space for additional data Will grow the space to exactly what's needed.