-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
37 lines (28 loc) · 971 Bytes
/
Copy pathtest.cpp
File metadata and controls
37 lines (28 loc) · 971 Bytes
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
#include "data_file/DataFile.h"
#include <random>
#include <stdint.h>
#include "index/IndexBuilder.h"
#include "index/IndexReader.h"
using namespace std;
int main()
{
const string data_file_name = "test_dir/anonymous";
uint64_t data_file_mb = 10;
uint64_t hash_num = 3;
/*
* 这里不同的分布算法的参数不一样,没调好,还是先都只用uniform_int_distribution
* 为了使得value被压缩的可能性大一些,Value的范围随机值比较小
* 另外,此处生成文件是单线程的,会比较慢
*/
GenDataFile(data_file_name, data_file_mb);
IndexBuilder* index_builder = new IndexBuilder();
index_builder->Init(data_file_name, hash_num);
index_builder->Proc();
delete index_builder;
IndexReader *index_reader = new IndexReader();
index_reader->Init(data_file_name);
index_reader->Traverse(false);
index_reader->Verify(false);
delete index_reader;
return 0;
}