Skip to content

Recipe: Basic Recipe For Niovakv

Paul Nowoczynski edited this page Sep 29, 2021 · 1 revision

Basic Recipe For Niovakv

Parent Recipe: none

Objective

Ensure that the read and writes are happening through niovakv_client. Verify that read and write is happening successfully.

Parameters:

  • Pmdb Server Count: Start servers such that quorum is formed. (Number of servers /2 + 1)
  • Niovakv Server Count : 1 or more servers need to be started.
  • Niovakv Client-Count: 1 or more clients need to be started.

1 - Check if app_type is niovakv

2 - Export path

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= <holon-directory-path>
export NIOVA_BIN_PATH= /home/user-name/dir-name/niova-core/libexec/niova

3 - Start one niovakv-server

  • Internally this will start a PMDB Client.

4 - Write key-value pair by starting a niovakv_client

To start niovakv client we need to pass various parameters for write operation.

Operation : "write"
Key : <key-prefix>
Value : <value-prefix>
OutfileName : <abc>
NumRequest : <how many request to process / by default it is 5 no of request>
MultiKey : <since we here are passing single key and value therefore this value will be False>
Sequential : <since we here are passing single key and value therefore this value will be False>

4a - Verify the operation is successful

Add checks for Status for write operation it should be 0. And the Response of Validate should be true.

{
 "write": [
  {
   "Request": {
    "Operation": "write",
    "Key": "Key0",
    "Value": "Value0",
    "Request_timestamp": "2021-09-23T06:09:38.161834162Z"
   },
   "Response": {
    "Status": 0,
    "Response": "",
    "Validate": true,
    "Response_timestamp": "2021-09-23T06:09:38.227719859Z"
   },
   "Req_resolved_time": 65885713
  }
 ]
}

5 - Read key-value pair by starting a niovakv_client

Here to start niovakv client we need to pass various parameters for read operation .

Operation : "read"
Key : <key-prefix>
Value : ""
OutfileName : <abc>
NumRequest : <how many request to process / by default it is 5 no of request>
MultiKey : <since we here are passing single key and value therefore this value will be False>
Sequential : <since we here are passing single key and value therefore this value will be False>

Here’s some output from the read operation json file:

{
 "read": [
  {
   "Request": {
    "Operation": "read",
    "Key": "Key0",
    "Value": "",
    "Request_timestamp": "2021-09-23T06:09:38.380893291Z"
   },
   "Response": {
    "Status": 0,
    "Response": "Value0",
    "Validate": false,
    "Response_timestamp": "2021-09-23T06:09:38.383659665Z"
   },
   "Req_resolved_time": 2766378
  }
 ]
}

Compare values of read and write

  • [‘write’][’Request’][‘Key’] == [‘read’][‘Request’][‘Key’]
  • [‘write’][‘Request’][‘Value’] == [‘read’][‘Response’][‘Response’]
Clone this wiki locally