forked from membase/ep-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckpoint_remover.hh
More file actions
42 lines (33 loc) · 1.11 KB
/
checkpoint_remover.hh
File metadata and controls
42 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#ifndef CHECKPOINT_REMOVER_HH
#define CHECKPOINT_REMOVER_HH 1
#include <assert.h>
#include <set>
#include "common.hh"
#include "stats.hh"
#include "dispatcher.hh"
class EventuallyPersistentStore;
/**
* Dispatcher job responsible for removing closed unreferenced checkpoints from memory.
*/
class ClosedUnrefCheckpointRemover : public DispatcherCallback {
public:
/**
* Construct ClosedUnrefCheckpointRemover.
* @param s the store
* @param st the stats
*/
ClosedUnrefCheckpointRemover(EventuallyPersistentStore *s, EPStats &st,
size_t interval) :
store(s), stats(st), sleepTime(interval), available(true) {}
bool callback(Dispatcher &d, TaskId t);
std::string description() {
return std::string("Removing closed unreferenced checkpoints from memory");
}
private:
EventuallyPersistentStore *store;
EPStats &stats;
size_t sleepTime;
bool available;
};
#endif /* CHECKPOINT_REMOVER_HH */