-
Notifications
You must be signed in to change notification settings - Fork 1
Recipe: Niovakv Single Key Write Read
Paul Nowoczynski edited this page Sep 29, 2021
·
1 revision
Make sure app_name=niovakv while running the recipe.
Perform single key write and read through niovakv client. Verify that the write and read operation is happening successfully.
export CGO_LDFLAGS="-L/usr/local/niova/niova-core/lib/"
export CGO_CFLAGS="-I/usr/local/niova/niova-core/include/niova"
export LD_LIBRARY_PATH=/usr/local/niova/niova-core/lib/
export PATH=$PATH:/usr/local/go/bin
export PYTHONPATH=/usr/local/holon/holon
export NIOVA_BIN_PATH=/usr/local/niova//niova-core/libexec/niova
- Internally this will start a PMDB Client.
Here to start niovakv client we need to pass various parameters for write operation. Since niovakv client will write the key-value sequentially and then it will read the written values.
Operation : "write"
Key : <key-prefix>
Value : <value-prefix>
OutfileName : <abc>
NumRequest : <how many request to process> here it will be 1
MultiKey : False
Sequential : False
Verify if write operation is successful
- “Status” for write operation should be 0.
"write": [
{
"Request": {
"Operation": "write",
"Key": "russia1",
"Value": "sputnic1",
"Request_timestamp": "2021-09-23T11:15:20.573363806Z"
},
"Response": {
"Status": 0,
"Response": "",
"Validate": true,
"Response_timestamp": "2021-09-23T11:15:20.636067207Z"
},
"Req_resolved_time": 62703555
},
Operation : "read"
Key : <key-prefix>
Value : <value-prefix>
OutfileName : <abc>
NumRequest : <how many request to process> here it will be 1
MultiKey : False
Sequential : False
After the read operation, take the values.
{
"read": [
{
"Request": {
"Operation": "read",
"Key": "russia1",
"Value": "",
"Request_timestamp": "2021-09-23T11:15:22.112547337Z"
},
"Response": {
"Status": 0,
"Response": "sputnic1",
"Validate": true,
"Response_timestamp": "2021-09-23T11:15:22.114034244Z"
},
"Req_resolved_time": 1486901
},
Compare values of read and write
[‘write’][‘Request’][‘Value’] == [‘read’][‘Response’][‘Response’]
Verify if the read operation is successful.
- “Status” for read operation should be 0.