mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-26 19:35:12 +00:00
Expose the dirty_memory_region_group in database and add occupancy to
column_family This patch adds a getter for the dirty_memory_region_group in the database object and add an occupency method to column family that returns the total occupency in all the memtable in the column family. Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
@@ -93,6 +93,15 @@ column_family::sstables_as_mutation_source() {
|
||||
column_family::~column_family() {
|
||||
}
|
||||
|
||||
|
||||
logalloc::occupancy_stats column_family::occupancy() const {
|
||||
logalloc::occupancy_stats res;
|
||||
for (auto m : *_memtables.get()) {
|
||||
res += m->region().occupancy();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static
|
||||
bool belongs_to_current_shard(const mutation& m) {
|
||||
return dht::shard_of(m.token()) == engine().cpu_id();
|
||||
|
||||
@@ -159,6 +159,8 @@ public:
|
||||
const row_cache& get_row_cache() const {
|
||||
return _cache;
|
||||
}
|
||||
|
||||
logalloc::occupancy_stats occupancy() const;
|
||||
public:
|
||||
column_family(schema_ptr schema, config cfg, db::commitlog& cl, compaction_manager&);
|
||||
column_family(schema_ptr schema, config cfg, no_commitlog, compaction_manager&);
|
||||
@@ -490,6 +492,10 @@ public:
|
||||
}
|
||||
|
||||
future<> flush_all_memtables();
|
||||
|
||||
const logalloc::region_group& dirty_memory_region_group() const {
|
||||
return _dirty_memory_region_group;
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME: stub
|
||||
|
||||
Reference in New Issue
Block a user