This project is a simple, distributed hash table, Linux-only software composed of multiple servers referenced in one or multiple client. Those clients can write or read any value stored with a key in the hash table. Note that the servers do not store all the key value pairs.
We've done the whole project as asked.
Using a container is recommended to prevent dependecies issues with your other applications.
Run those commands as root to install all dependencies.
$ apt-get update
$ apt-get install -y git build-essential gcc clang check openssh-client curl libssl-dev libssl-doc libvips-dev libcurl4-openssl-dev libjson-c-dev python3 python-is-python3
$ apt-get install -y clang-tools gdb cmakeTo download the project, go into your preferred folder and run the command below.
$ git clone git@github.com:projprogsys-epfl/project-comparch-la-revanche.git$ make cleanInside the done folder in the project, compile the project using make
$ cd project-comparch-la-revanche/done/
$ makeYou can run the server as below and add default key value pairs to the server hash table if needed.
$ ./dkvs-server <SERVER_IP> <SERVER_PORT> [<key> <value>]...First configure the client, write the servers ip and port inside of the done/servers.txt file as below, one line per server.
\n.
<SERVER_IP> <SERVER_PORT> <NODE_COUNT>
...
Node count is used for how much you'll use the this precise server. Higher it is, more likely you'll use it to store a key, value pair. \
$ ./dkvs-client <command> [-r R] [-w W] [-n N] -- ...Where possible commands are:
help: displays the help message.get: get a value from a key, to be provided as extra argument (after--).put: put a key-value pair, to be provided as extra arguments, key first, then value.cat: concatenate several values into a new key; the values are indicated by their key.
for example:cat -- a b c, will concatenate the values of keys a and b into the value for key c.substr: extract a substring from a value and store the result under a new key.
it requires 4 arguments: key to read from, index of substr, length of substr, and key where to put the result to.find: to search from a value into another; it requires two keys: which value to search into and what value to search. it returns the index of the searched value inside the reference value (starting from 0) or -1 if the value is not found.
The flags are used to prevent desynchronization issues:
-n: the number of server the client will connect to.-r: the threshold of same response, the client will consider the value as correct.-w: the threshold of successful response, the client will consider the write as success.
You can also dump every value stored on all server with:
$ ./dkvs-dumpTo change the maximum element (key or value) size, servers.txt filepath, default hash table size, or packet timeout, you can edit the done/config.h and recompile the project.
To print additional information about the current state of the servers, add this argument before compiling.
$ make DEBUG=1To add more of these, use the debug_printf() macro from error.h.
Run the tests provided and made by our group by using this command, you can add your own inside of the done/tests folder.
$ make checkThe time we took is detailed within the done/time.csv file.
| Week number | Hours taken |
|---|---|
| 5 | 17.25 |
| 6 | 20.50 |
| 7 | 0 |
| 8 | 14.25 |
| 9 | 26.00 |
| 10 | 22.75 |
| 11 | 22.75 |
| 12 | 27.25 |
| 13 | 23.00 |