|
Barrelfish
|
octopus Query Interface Header file More...
Functions | |
| errval_t | set_binding (octopus_binding_type_t type, uint64_t id, void *binding) |
| Stores a binding for the given id. More... | |
| errval_t | get_record_names (struct ast_object *ast, struct oct_query_state *dqs) |
| errval_t | get_record (struct ast_object *ast, struct oct_query_state *dqs) |
| Returns a record matching the given query. More... | |
| errval_t | set_record (struct ast_object *ast, uint64_t mode, struct oct_query_state *dqs) |
| Stores a record in the database. More... | |
| errval_t | del_record (struct ast_object *, struct oct_query_state *) |
| Deletes a record in the database. More... | |
| errval_t | set_watch (struct octopus_binding *b, struct ast_object *ast, uint64_t mode, struct oct_reply_state *drs, uint64_t *wid) |
| errval_t | del_watch (struct octopus_binding *b, octopus_trigger_id_t id, struct oct_query_state *dqs) |
| Removes a watch. More... | |
| errval_t | add_subscription (struct octopus_binding *b, struct ast_object *ast, uint64_t trigger_fn, uint64_t state, struct oct_reply_state *drs) |
| Adds a subscription. More... | |
| errval_t | del_subscription (struct octopus_binding *b, uint64_t id, struct oct_query_state *dqs) |
| Deletes a subscription for a given (Binding, Id) pair. More... | |
| errval_t | find_subscribers (struct ast_object *ast, struct oct_query_state *dqs) |
| struct octopus_binding * | get_event_binding (struct octopus_binding *binding) |
| Find the event binding of the client based on his RPC binding. More... | |
octopus Query Interface Header file
The server must implement this interface in order for dist2 to work accordingly.
| errval_t add_subscription | ( | struct octopus_binding * | b, |
| struct ast_object * | ast, | ||
| uint64_t | trigger_fn, | ||
| uint64_t | state, | ||
| struct oct_reply_state * | drs | ||
| ) |
Adds a subscription.
| b | RPC binding of subscriber. |
| ast | Subscription template (to match with published records). |
| trigger_fn | Client handler function. |
| state | Additional state argument supplied by client. |
| drs | Returned result of query invocation. |
| SYS_ERR_OK | |
| OCT_ERR_MAX_SUBSCRIPTIONS | |
| OCT_ERR_ENGINE_FAIL | |
| LIB_ERR_MALLOC_FAIL |
| errval_t del_record | ( | struct ast_object * | , |
| struct oct_query_state * | |||
| ) |
Deletes a record in the database.
| ast | Record to delete. |
| dqs | Returned result of query invocation. |
| SYS_ERR_OK | |
| OCT_ERR_NO_RECORD | |
| OCT_ERR_ENGINE_FAIL |
| errval_t del_subscription | ( | struct octopus_binding * | b, |
| uint64_t | id, | ||
| struct oct_query_state * | dqs | ||
| ) |
Deletes a subscription for a given (Binding, Id) pair.
| b | RPC binding of subscriber. |
| id | ID of the subscription. |
| dqs | Returned result of query invocation. |
| SYS_ERR_OK | |
| OCT_ERR_NO_SUBSCRIPTION | |
| OCT_ERR_ENGINE_FAIL |
| errval_t del_watch | ( | struct octopus_binding * | b, |
| octopus_trigger_id_t | id, | ||
| struct oct_query_state * | dqs | ||
| ) |
Removes a watch.
| b | Binding of caller |
| id | Trigger Id supplied by caller |
| dqs | Query state |
| SYS_ERR_OK | |
| OCT_ERR_INVALID_ID | |
| OCT_ERR_ENGINE_FAIL |
| errval_t find_subscribers | ( | struct ast_object * | ast, |
| struct oct_query_state * | dqs | ||
| ) |
Find all subscribers with a matching subscription for the given AST.
| ast | Record to match with stored subscription. |
| dqs | Returned result of query invocation. |
| SYS_ERR_OK | |
| OCT_ERR_NO_SUBSCRIBERS | |
| OCT_ERR_ENGINE_FAIL |
| struct octopus_binding* get_event_binding | ( | struct octopus_binding * | binding | ) |
Find the event binding of the client based on his RPC binding.
| binding | RPC binding |
| errval_t get_record | ( | struct ast_object * | ast, |
| struct oct_query_state * | dqs | ||
| ) |
Returns a record matching the given query.
| ast | Query supplied by client converted to AST. |
| dqs | Contains the result of the query invocation. |
| SYS_ERR_OK | |
| OCT_ERR_NO_RECORD | |
| OCT_ERR_ENGINE_FAIL |
| errval_t get_record_names | ( | struct ast_object * | ast, |
| struct oct_query_state * | dqs | ||
| ) |
Given a query returns a number of record names matching the query. The record names are stored as a comma separated string in oct_query_state.
| ast | Abstract Syntax Tree of query. |
| dqs | Contains the result of the query invocation. |
| SYS_ERR_OK | |
| OCT_ERR_NO_RECORD | |
| OCT_ERR_ENGINE_FAIL |
| errval_t set_binding | ( | octopus_binding_type_t | type, |
| uint64_t | id, | ||
| void * | binding | ||
| ) |
Stores a binding for the given id.
Used to find the event binding for a given RPC connection since in a regular flounder interface RPC calls are on on a different waitset we currently need two binding.
| type | Binding type (RPC or Event) |
| id | Identifier unique per client |
| binding | Pointer value of binding |
| SYS_ERR_OK | |
| OCT_ERR_UNSUPPORTED_BINDING | |
| OCT_ERR_ENGINE_FAIL | |
| LIB_ERR_MALLOC_FAIL |
| errval_t set_record | ( | struct ast_object * | ast, |
| uint64_t | mode, | ||
| struct oct_query_state * | dqs | ||
| ) |
Stores a record in the database.
| ast | Record to set. |
| mode | A combination of modes as defined in getset.h. |
| dqs | Returned result of query invocation. |
| SYS_ERR_OK | |
| OCT_ERR_ENGINE_FAIL |
| errval_t set_watch | ( | struct octopus_binding * | b, |
| struct ast_object * | ast, | ||
| uint64_t | mode, | ||
| struct oct_reply_state * | drs, | ||
| uint64_t * | wid | ||
| ) |
Sets a watch for a record(s) matching the given query. The Query Engine is supposed to use the drs struct to reply to the client once the watch is triggered.
| b | RPC Binding |
| ast | AST to watch for |
| mode | When to trigger the watch (del or set). |
| drs | Reply state used to reply to the client. |
| wid | ID of the installed watch (used for remove). |
| SYS_ERR_OK | |
| OCT_ERR_ENGINE_FAIL |
1.8.11