MySQL 5.6.14 Source Code Document
|
Classes | |
struct | item_observer_cb_data |
struct | server_handle_v1_t |
struct | feature_info |
struct | engine_info |
struct | engine_interface_v1 |
Macros | |
#define | ENGINE_INTERFACE_VERSION 1 |
Typedefs | |
typedef void(* | ADD_STAT )(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, const void *cookie) |
typedef bool(* | ADD_RESPONSE )(const void *key, uint16_t keylen, const void *ext, uint8_t extlen, const void *body, uint32_t bodylen, uint8_t datatype, uint16_t status, uint64_t cas, const void *cookie) |
typedef tap_event_t(* | TAP_ITERATOR )(ENGINE_HANDLE *handle, const void *cookie, item **item, void **engine_specific, uint16_t *nengine_specific, uint8_t *ttl, uint16_t *flags, uint32_t *seqno, uint16_t *vbucket) |
typedef ENGINE_ERROR_CODE(* | CREATE_INSTANCE )(uint64_t interface, GET_SERVER_API get_server_api, ENGINE_HANDLE **handle) |
typedef struct engine_interface_v1 | ENGINE_HANDLE_V1 |
Enumerations | |
enum | tap_event_t { TAP_MUTATION = 1, TAP_DELETION, TAP_FLUSH, TAP_OPAQUE, TAP_VBUCKET_SET, TAP_ACK, TAP_DISCONNECT, TAP_NOOP, TAP_PAUSE, TAP_CHECKPOINT_START, TAP_CHECKPOINT_END } |
enum | engine_feature_t { ENGINE_FEATURE_CAS, ENGINE_FEATURE_PERSISTENT_STORAGE, ENGINE_FEATURE_SECONDARY_ENGINE, ENGINE_FEATURE_ACCESS_CONTROL, ENGINE_FEATURE_MULTI_TENANCY, ENGINE_FEATURE_LRU } |
Most interesting here is to implement engine_interface_v1 for your engine.
typedef bool(* ADD_RESPONSE)(const void *key, uint16_t keylen, const void *ext, uint8_t extlen, const void *body, uint32_t bodylen, uint8_t datatype, uint16_t status, uint64_t cas, const void *cookie) |
Callback for adding a response backet
key | The key to put in the response |
keylen | The length of the key |
ext | The data to put in the extended field in the response |
extlen | The number of bytes in the ext field |
body | The data body |
bodylen | The number of bytes in the body |
datatype | This is currently not used and should be set to 0 |
status | The status code of the return packet (see in protocol_binary for the legal values) |
cas | The cas to put in the return packet |
cookie | The cookie provided by the frontend |
typedef void(* ADD_STAT)(const char *key, const uint16_t klen, const char *val, const uint32_t vlen, const void *cookie) |
typedef ENGINE_ERROR_CODE(* CREATE_INSTANCE)(uint64_t interface, GET_SERVER_API get_server_api, ENGINE_HANDLE **handle) |
The signature for the "create_instance" function exported from the module.
This function should fill out an engine inteface structure according to the interface parameter (Note: it is possible to return a lower version number).
interface | The highest interface level the server supports |
get_server_api | function to get the server API from |
Where | to store the interface handle |
typedef struct engine_interface_v1 ENGINE_HANDLE_V1 |
Definition of the first version of the engine interface
typedef tap_event_t(* TAP_ITERATOR)(ENGINE_HANDLE *handle, const void *cookie, item **item, void **engine_specific, uint16_t *nengine_specific, uint8_t *ttl, uint16_t *flags, uint32_t *seqno, uint16_t *vbucket) |
An iterator for the tap stream. The memcached core will keep on calling this function as long as a tap client is connected to the server. Each event returned by the iterator will be encoded in the binary protocol with the appropriate command opcode.
If the engine needs to store extra information in the tap stream it should do so by returning the data through the engine_specific pointer. This data should be valid for the core to use (read only) until the next invocation of the iterator, of if the connection is closed.
handle | the engine handle |
cookie | identification for the tap stream |
item | item to send returned here (check tap_event_t) |
engine_specific | engine specific data returned here |
nengine_specific | number of bytes of engine specific data |
ttl | ttl for this item (Tap stream hops) |
flags | tap flags for this object |
seqno | sequence number to send |
vbucket | the virtual bucket id |
enum engine_feature_t |