Request object

The Staging database is a global database shared between threads. To avoid locking issues, a queue based producer-consumer model is built. In this model, the staging database is controlled by a thread and reads requests from a queue.

Each request has a callback that is called when the request is finished. The thread is an operating system thread and not a Cloverleaf engine thread.

This table shows the request object fields:

Field Name C++ type Notes
1 RequestType reqtype integer One of:
  • CREATE_KEYSPACE
  • REMOVE_KEYSPACE
  • SET_KEY
  • GET_KEY
  • REMOVE_KEY
2 Key Space keyspace string
3 Key key string
4 Data data string
5 Metadata metadata string
6 Value Type datatype integer DTC for (key,value) DTC protocol writes:
  • Data field contains Message Content
  • Metadata field contains Message’s Metadata
MSG for user (key,value) when value is a message:
  • Data field contains Message Content
  • Metadata field contains Message’s Metadata
DAT for user (key,value). Data field contains value. Metadata field is NULL.
7 Return Value ret integer STAGE_ERR_SUCCESS(0)

If success, other values mean failure.