forked from ty2806/storage_layout_emulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workload_executor.h
49 lines (37 loc) · 1.61 KB
/
workload_executor.h
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
/*
* Created on: May 14, 2019
* Author: Subhadeep, Papon
*/
#ifndef AWESOME_H_
#define AWESOME_H_
#include "emu_environment.h"
#include <iostream>
#include <vector>
using namespace std;
using namespace tree_builder;
namespace workload_exec {
class WorkloadExecutor {
private:
public:
static long total_insert_count;
static long buffer_update_count;
static long buffer_insert_count;
static uint32_t counter;
static int insert(long sortkey, long deletekey, string value);
static int pointGet(long key);
static int search(long key, int possible_level_of_occurrence);
static int getWorkloadStatictics(EmuEnv* _env);
};
class Utility {
public:
static int sortAndWrite(vector < pair < pair < long, long >, string > > vector_to_compact, int level_to_flush_in);
static int compactAndFlush(vector < pair < pair < long, long >, string > > vector_to_compact, int level_to_flush_in);
static bool sortbysortkey(const pair<pair<long, long>, string> &a, const pair<pair<long, long>, string> &b);
static bool sortbydeletekey(const pair<pair<long, long>, string> &a, const pair<pair<long, long>, string> &b);
static int minInt(int a, int b);
static int QueryDrivenCompaction(vector < pair < pair < long, long >, string > > vector_to_compact);
static void sortMerge(vector < pair < pair < long, long >, string > >& vector_to_compact, int level_to_flush_in);
static int sortMergeRepartition(vector < pair < pair < long, long >, string > >& vector_to_compact, int level_to_flush_in);
};
} // namespace awesome
#endif /*EMU_ENVIRONMENT_H_*/