- Here you will defined what type of answer you expect from reading the data of a node. In this example it will return a optional value from a given key in the
- Declare the type configuration for example K/V store.
- Here defines a state machine of the raft, this state represents a copy of the data between each node. Note that we are using
serdeto serialize the
data, which has a implementation to be serialized. Note that for this test we set both the key and value as String, but you could set any type of value that has the serialization impl.
- Here you will set the types of request that will interact with the raft nodes. For example the
Setwill be used to write data (key and value) to the raft database. The
AddNodewill append a new node to the current existing shared list of nodes. You will want to add any request that can write data in all nodes here.