-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.h
More file actions
58 lines (46 loc) · 1.7 KB
/
Copy pathSettings.h
File metadata and controls
58 lines (46 loc) · 1.7 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef UPDATE_LITE_SETTINGS_H
#define UPDATE_LITE_SETTINGS_H
#include <cstdint>
#include <vector>
#include <cstddef>
#include <functional>
namespace IndexUpdate {
enum Algorithm {
NeverMerge, AlwaysMerge, LogMerge, SkiBased, Prognosticator
};
enum DiskType { HD, SSD};
class Settings {
public:
DiskType diskType;
unsigned ioMBS; //how many MB per second we can read/write
double ioSeek; //the time to make an average seek (random access latency)
unsigned szOfPostingBytes; //we use fixed size of postings (in bytes).
//how many postings we are going to accommodate
uint64_t totalExperimentPostings;
//the size of update buffer in postings
uint64_t updateBufferPostingsLimit;
//the size of cache in postings
uint64_t cacheSizePostings;
//the two quants represent the update-to-query ratio
uint64_t updatesQuant; //usually one million
uint64_t quieriesQuant;
unsigned percentsUBLeft; //after eviction can have as much % UB busy (90 is the default)
unsigned flags[16]; //whatever
typedef std::vector<uint64_t> dataC;
//TPack related data (based on our training set)
dataC tpMembers;
dataC tpUpdates;
dataC tpQueries;
static size_t hash(const Settings& s);
static const std::string& name(Algorithm alg);
};
bool operator==(const Settings& lhs, const Settings& rhs) ;
}
namespace std {
template<> struct hash<IndexUpdate::Settings> {
size_t operator()(const IndexUpdate::Settings &settings) const {
return IndexUpdate::Settings::hash(settings);
}
};
}
#endif //UPDATE_LITE_SETTINGS_H