-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
123 lines (95 loc) · 3.4 KB
/
README.txt
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Requirements
------------
Short version for installing requirements in Ubuntu:
$ sudo apt install cmake clang-4.0 libboost-all-dev protobuf-compiler libprotobuf-dev
Longer version:
- A not too old CMake (3.5.1 at development machine)
- A not too old Clang with C++14 support (4.0.0 at development machine)
- Boost libraries installed at system
- Google protobuf (both compiler and dev libs)
- The project should work in any fairly modern Linux installation, it
has been developed and tested on Linux Mint 18.1 (codebase Ubuntu
16.04) and Lubuntu 16.04 (in a virtual machine).
Build
-----
1. Unpack zip file
2. $ cd kvstore
3. kvstore$ mkdir build
4. kvstore$ cd build
5. kvstore/build$ cmake ..
6. kvstore/build$ make all
7. Just delete the "build" directory to start from scratch
Run unit tests
--------------
kvstore/build$ ./unittest
Run servers
-----------
To stop/kill server, press Ctrl+C in terminal.
Server with complete cache, which writes simple output to clients.
kvstore/build$ ./simple_server
LRU cache based server without swap, which writes simple output to
clients.
kvstore/build$ ./lru_server
FIFO cache based server without swap, which writes JSON output to
clients.
kvstore/build$ ./fifo_json_server
FIFO cache based server with protobuf swap file, which writes simple
output to clients.
kvstore/build$ ./fifo_protobuf_server
LRU cache based server with protobuf swap file, which writes JSON
output to clients.
kvstore/build$ ./lru_json_protobuf_server
Run client
----------
The client can and must be configured at command line as in the
following example. The client will send randomized requests to the
running server within these parameters.
kvstore/build$ ./client 2 20 200 50
Number of threads: 2
Number of keys in store: 20
Messages to send per thread: 200
Time to let thread sleep between each message: 50 (milliseconds)
Manual test of server using curl
--------------------------------
$ curl -i --request PUT 0.0.0.0:8888/put/key/foo/value/bar
$ curl -i --request GET 0.0.0.0:8888/get/key/foo
$ curl -i --request GET 0.0.0.0:8888/size
$ curl -i --request DELETE 0.0.0.0:8888/key/foo
====================================================================
Development targets follows, have fun with them if so inclined :)
Run cppcheck
------------
- Version 1.81 installed at development machine.
kvstore/build$ make cppcheck
Run clang-tidy
--------------
- Version 4.0.0 installed at development machine.
kvstore/build$ make clang-tidy
Run clang-format
----------------
- Version 4.0.0 installed at development machine.
kvstore/build$ make clang-format
====================================================================
Third party libraries used
--------------------------
* boost
- Used by crow
- NOT bundled, must be on target system
* crow - https://github.com/ipkn/crow
- Used for REST HTTP server
- Bundled in kvstore/3rdparty/
* embeddedRest - https://github.com/fnc12/embeddedRest
- Used for HTTP client
- Bundled in kvstore/3rdparty/
* Google Protocol Buffers
- Used by some servers for serializing data to/fro disk.
- NOT bundled, must be on target system
* picotest - https://github.com/nyanp/picotest
- Used for unit testing
- Bundled in kvstore/3rdparty/
* recordio
- Used for handling protobuf data on disk.
- https://github.com/xeno14/recordio
- Note that there several libraries with the same name and nearly
same functionality.
- Bundled in kvstore/3rdparty/