memgraph/include/dbms/cleaner.hpp
Kruno Tomola Fabro b2ce3d58a4 Added cleaner.
Added multithreading to dbms.
Skiplist now supports emplace insert.
2016-08-30 00:45:07 +01:00

26 lines
421 B
C++

#pragma once
#include "database/db.hpp"
class Thread;
// How much sec is a cleaning_cycle in which cleaner will clean at most
// once.
constexpr size_t cleaning_cycle = 60;
class Cleaning
{
public:
Cleaning(ConcurrentMap<std::string, Db> &dbs);
~Cleaning();
private:
ConcurrentMap<std::string, Db> &dbms;
std::vector<std::unique_ptr<Thread>> cleaners;
std::atomic<bool> cleaning = {true};
};