39 int32_t priority,
String *trace) {
41 std::vector<RangeData> range_data_root;
42 std::vector<RangeData> range_data_metadata;
43 std::vector<RangeData> range_data_system;
44 std::vector<RangeData> range_data_user;
46 for (
size_t i=0; i<range_data.size(); i++) {
47 if (range_data[i].range->is_root())
48 range_data_root.push_back(range_data[i]);
49 else if (range_data[i].data->is_metadata)
50 range_data_metadata.push_back(range_data[i]);
51 else if (range_data[i].data->is_system)
52 range_data_system.push_back(range_data[i]);
54 range_data_user.push_back(range_data[i]);
57 m_uninitialized_ranges_seen =
false;
62 if (!range_data_root.empty()) {
65 memory_state, priority, trace);
66 schedule_initialization_operations(range_data_root, priority);
73 if (!range_data_metadata.empty()) {
77 schedule_initialization_operations(range_data_metadata, priority);
90 *trace +=
format(
"%d prune threshold\t%lld\n", __LINE__, (
Lld)prune_threshold);
95 if (!range_data_system.empty()) {
97 memory_state, priority, trace);
98 schedule_initialization_operations(range_data_system, priority);
104 if (!range_data_user.empty()) {
106 if (schedule_inprogress_operations(range_data_user, memory_state, priority, trace))
107 schedule_splits_and_relinquishes(range_data, memory_state, priority, trace);
109 assign_priorities_user(range_data_user, load_stats, memory_state,
113 prune_threshold, memory_state, priority,
116 schedule_initialization_operations(range_data_user, priority);
119 if (m_uninitialized_ranges_seen ==
false)
120 m_initialization_complete =
true;
135 int32_t &priority,
String *trace) {
137 if (!schedule_inprogress_operations(range_data, memory_state, priority, trace))
140 if (!schedule_splits_and_relinquishes(range_data, memory_state, priority, trace))
143 if (!schedule_necessary_compactions(range_data, log, prune_threshold,
144 memory_state, priority, trace))
174 if (!purge_shadow_caches(range_data, memory_state, priority, trace))
179 HT_INFOF(
"READ workload prioritization (update_bytes=%llu, scan_count=%u)",
182 if (!compact_cellcaches(range_data, memory_state, priority, trace))
192 if (!purge_cellstore_indexes(range_data, memory_state, priority, trace))
198 HT_INFOF(
"WRITE workload prioritization (update_bytes=%llu, scan_count=%u)",
208 if (!purge_cellstore_indexes(range_data, memory_state, priority, trace))
211 if (!compact_cellcaches(range_data, memory_state, priority, trace))
POD-style structure to hold statistics.
uint32_t scan_count
Scan count.
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...
void decrement_needed(int64_t amount)
long long unsigned int Llu
Shortcut for printf formats.
virtual void prioritize(std::vector< RangeData > &range_data, MemoryState &memory_state, int32_t priority, String *trace)
static int64_t log_prune_threshold_max
void assign_priorities_user(std::vector< RangeData > &range_data, LoadStatistics::Bundle &load_stats, MemoryState &memory_state, int32_t &priority, String *trace)
Memory freeing algorithm:
uint64_t update_bytes
Bytes updated.
static CommitLogPtr root_log
Compatibility Macros for C/C++.
static int64_t log_prune_threshold_min
void cap_memory_use()
Sets limit to memory currently used, it will not reduce the limit below min_memory.
void assign_priorities_all(std::vector< RangeData > &range_data, CommitLogPtr &log, int64_t prune_threshold, MemoryState &memory_state, int32_t &priority, String *trace)
Memory freeing algorithm:
long long int Lld
Shortcut for printf formats.
static CommitLogPtr system_log
double update_mbps
Megabytes/s updated.
#define HT_INFOF(msg,...)
std::shared_ptr< CommitLog > CommitLogPtr
Smart pointer to CommitLog.
static CommitLogPtr user_log
static LoadStatisticsPtr load_statistics
Declarations for MaintenanceFlag This file contains declarations that are part of the MaintenanceFlag...
String extensions and helpers: sets, maps, append operators etc.
static Hypertable::FileBlockCache * block_cache
static CommitLogPtr metadata_log
Executes user-defined functions when leaving the current scope.