-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.cpp
More file actions
29 lines (24 loc) · 683 Bytes
/
try.cpp
File metadata and controls
29 lines (24 loc) · 683 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
#include <iostream>
#include "kvstore.h"
using namespace std;
const auto path = "./data";
int main() {
KVStore* store = new KVStore(path);
store->put(1, "1");
store->put(2, "2");
for (int i = 0; i <= 102400; ++i) store->put(i + 30, std::string(1024, 'x'));
cout << store->get(1) << endl;
cout << store->get(2) << endl;
delete store;
store = new KVStore(path);
cout << store->get(1) << endl;
cout << store->get(2) << endl;
store->put(1, "3");
store->put(2, "4");
for (int i = 0; i <= 10240; ++i) store->put(i + 30, std::string(1024, 'x'));
cout << store->get(1) << endl;
cout << store->get(2) << endl;
store->reset();
delete store;
return 0;
}