Simple key-value store
The purpose of barge-store is to make it easy to test barge with jepsen. By exposing a simple put/get interface we can implement a simple client that will be used by jepsen to check linearizability of barge.
Main program is now barge-store.jar (replacing barge-http.jar) which launches server in the background. Server can be stopped by POSTing empty string to URI /control/shutdown. Store is available under namespace /store and is dead simple:
- Use
PUT /store/my/keywith arbitrary byte input to store data. This must be sent to current leader and waits for Raft protocol synchronisation before returning to client, - Use
GET /store/my/keyto retrieve stored data or a 404 error. Data is read from current state machine so reading from non-Leader might provide stale data.
Looks good. Since this is a new module I'm not going to nit-pick. Feel free to merge when you're ready or point out places you'd like me to take a harder look at.
Well, on the contrary, given this is a new module, better nitpick when there are few lines of code! If there are things that looked suspicious or with which you are not at ease with, I would greatly appreciate your comments. Bear in mind however the overall idea is not to provide a full-fledged DB but merely a simple tool to exercise barge. But simple does not mean simplistic of course.
OK, fair enough. I'll give it a more thorough look.