MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
engine_interface_v1 Struct Reference

#include <engine.h>

Collaboration diagram for engine_interface_v1:

Public Attributes

struct engine_interface interface
const engine_info *(* get_info )(ENGINE_HANDLE *handle)
ENGINE_ERROR_CODE(* initialize )(ENGINE_HANDLE *handle, const char *config_str)
void(* destroy )(ENGINE_HANDLE *handle, const bool force)
ENGINE_ERROR_CODE(* allocate )(ENGINE_HANDLE *handle, const void *cookie, item **item, const void *key, const size_t nkey, const size_t nbytes, const int flags, const rel_time_t exptime)
ENGINE_ERROR_CODE(* remove )(ENGINE_HANDLE *handle, const void *cookie, const void *key, const size_t nkey, uint64_t cas, uint16_t vbucket)
ENGINE_ERROR_CODE(* bind )(ENGINE_HANDLE *handle, const void *cookie, const void *name, const size_t name_len)
void(* release )(ENGINE_HANDLE *handle, const void *cookie, item *item)
void(* clean_engine )(ENGINE_HANDLE *handle, const void *cookie, void *engine_data)
ENGINE_ERROR_CODE(* get )(ENGINE_HANDLE *handle, const void *cookie, item **item, const void *key, const int nkey, uint16_t vbucket)
ENGINE_ERROR_CODE(* store )(ENGINE_HANDLE *handle, const void *cookie, item *item, uint64_t *cas, ENGINE_STORE_OPERATION operation, uint16_t vbucket)
ENGINE_ERROR_CODE(* arithmetic )(ENGINE_HANDLE *handle, const void *cookie, const void *key, const int nkey, const bool increment, const bool create, const uint64_t delta, const uint64_t initial, const rel_time_t exptime, uint64_t *cas, uint64_t *result, uint16_t vbucket)
ENGINE_ERROR_CODE(* flush )(ENGINE_HANDLE *handle, const void *cookie, time_t when)
ENGINE_ERROR_CODE(* get_stats )(ENGINE_HANDLE *handle, const void *cookie, const char *stat_key, int nkey, ADD_STAT add_stat)
void(* reset_stats )(ENGINE_HANDLE *handle, const void *cookie)
void *(* get_stats_struct )(ENGINE_HANDLE *handle, const void *cookie)
ENGINE_ERROR_CODE(* aggregate_stats )(ENGINE_HANDLE *handle, const void *cookie, void(*callback)(void *, void *), void *)
ENGINE_ERROR_CODE(* unknown_command )(ENGINE_HANDLE *handle, const void *cookie, protocol_binary_request_header *request, ADD_RESPONSE response)
ENGINE_ERROR_CODE(* tap_notify )(ENGINE_HANDLE *handle, const void *cookie, void *engine_specific, uint16_t nengine, uint8_t ttl, uint16_t tap_flags, tap_event_t tap_event, uint32_t tap_seqno, const void *key, size_t nkey, uint32_t flags, uint32_t exptime, uint64_t cas, const void *data, size_t ndata, uint16_t vbucket)
TAP_ITERATOR(* get_tap_iterator )(ENGINE_HANDLE *handle, const void *cookie, const void *client, size_t nclient, uint32_t flags, const void *userdata, size_t nuserdata)
void(* item_set_cas )(ENGINE_HANDLE *handle, const void *cookie, item *item, uint64_t cas)
bool(* get_item_info )(ENGINE_HANDLE *handle, const void *cookie, const item *item, item_info *item_info)
size_t(* errinfo )(ENGINE_HANDLE *handle, const void *cookie, char *buffer, size_t buffsz)

Detailed Description

Definition of the first version of the engine interface

Definition at line 213 of file engine.h.

Member Data Documentation

ENGINE_ERROR_CODE(* engine_interface_v1::aggregate_stats)(ENGINE_HANDLE *handle, const void *cookie, void(*callback)(void *, void *), void *)

Aggregate stats among all per-connection stats. Set to NULL if you don't need it.

Definition at line 437 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::allocate)(ENGINE_HANDLE *handle, const void *cookie, item **item, const void *key, const size_t nkey, const size_t nbytes, const int flags, const rel_time_t exptime)

Allocate an item.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
outputvariable that will receive the item
keythe item's key
nkeythe length of the key
nbytesthe number of bytes that will make up the value of this item.
flagsthe item's flags
exptimethe maximum lifetime of this item
Returns
ENGINE_SUCCESS if all goes well

Definition at line 264 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::arithmetic)(ENGINE_HANDLE *handle, const void *cookie, const void *key, const int nkey, const bool increment, const bool create, const uint64_t delta, const uint64_t initial, const rel_time_t exptime, uint64_t *cas, uint64_t *result, uint16_t vbucket)

Perform an increment or decrement operation on an item.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
keythe key to look up
nkeythe length of the key
incrementif true, increment the value, else decrement
createif true, create the item if it's missing
deltathe amount to increment or decrement.
initialwhen creating, specifies the initial value
exptimewhen creating, specifies the expiration time
casoutput CAS value
resultoutput arithmetic value
vbucketthe virtual bucket id
Returns
ENGINE_SUCCESS if all goes well

Definition at line 374 of file engine.h.

void(* engine_interface_v1::clean_engine)(ENGINE_HANDLE *handle, const void *cookie, void *engine_data)

Clean up a connection when it is disconnected

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
engine_dataEngine specific resource to clean up

Definition at line 314 of file engine.h.

void(* engine_interface_v1::destroy)(ENGINE_HANDLE *handle, const bool force)

Tear down this engine.

Parameters
handlethe engine handle
forcethe flag indicating the force shutdown or not.

Definition at line 243 of file engine.h.

size_t(* engine_interface_v1::errinfo)(ENGINE_HANDLE *handle, const void *cookie, char *buffer, size_t buffsz)

Get extra error information for an operation.

Parameters
handlethe engine handle
cookieThe connection cookie
bufferWhere to store the info
buffszThe size of the buffer
Returns
the number of bytes written to the buffer

Definition at line 551 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::flush)(ENGINE_HANDLE *handle, const void *cookie, time_t when)

Flush the cache.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
whentime at which the flush should take effect
Returns
ENGINE_SUCCESS if all goes well

Definition at line 396 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::get)(ENGINE_HANDLE *handle, const void *cookie, item **item, const void *key, const int nkey, uint16_t vbucket)

Retrieve an item.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
itemoutput variable that will receive the located item
keythe key to look up
nkeythe length of the key
vbucketthe virtual bucket id
Returns
ENGINE_SUCCESS if all goes well

Definition at line 330 of file engine.h.

const engine_info*(* engine_interface_v1::get_info)(ENGINE_HANDLE *handle)

Get a description of this engine.

Parameters
handlethe engine handle
Returns
a stringz description of this engine

Definition at line 225 of file engine.h.

bool(* engine_interface_v1::get_item_info)(ENGINE_HANDLE *handle, const void *cookie, const item *item, item_info *item_info)

Get information about an item.

The loader of the module may need the pointers to the actual data within an item. Instead of having to create multiple functions to get each individual item, this function will get all of them.

Parameters
handlethe engine that owns the object
cookieconnection cookie for this item
itemthe item to request information about
item_info
Returns
true if successful

Definition at line 536 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::get_stats)(ENGINE_HANDLE *handle, const void *cookie, const char *stat_key, int nkey, ADD_STAT add_stat)

Get statistics from the engine.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
stat_keyoptional argument to stats
nkeythe length of the stat_key
add_statcallback to feed results to the output
Returns
ENGINE_SUCCESS if all goes well

Definition at line 414 of file engine.h.

void*(* engine_interface_v1::get_stats_struct)(ENGINE_HANDLE *handle, const void *cookie)

Get an array of per-thread stats. Set to NULL if you don't need it.

Definition at line 431 of file engine.h.

TAP_ITERATOR(* engine_interface_v1::get_tap_iterator)(ENGINE_HANDLE *handle, const void *cookie, const void *client, size_t nclient, uint32_t flags, const void *userdata, size_t nuserdata)

Get (or create) a Tap iterator for this connection.

Parameters
handlethe engine handle
cookieThe connection cookie
clientThe "name" of the client
nclientThe number of bytes in the client name
flagsTap connection flags
userdataSpecific userdata the engine may know how to use
nuserdataThe size of the userdata
Returns
a tap iterator to iterate through the event stream

Definition at line 512 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::initialize)(ENGINE_HANDLE *handle, const char *config_str)

Initialize an engine instance. This is called after creation, but before the engine may be used.

Parameters
handlethe engine handle
config_strconfiguration this engine needs to initialize itself.

Definition at line 234 of file engine.h.

struct engine_interface engine_interface_v1::interface

Engine info.

Definition at line 217 of file engine.h.

void(* engine_interface_v1::item_set_cas)(ENGINE_HANDLE *handle, const void *cookie, item *item, uint64_t cas)

Set the CAS id on an item.

Definition at line 520 of file engine.h.

void(* engine_interface_v1::release)(ENGINE_HANDLE *handle, const void *cookie, item *item)

Indicate that a caller who received an item no longer needs it.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
itemthe item to be released

Definition at line 303 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::remove)(ENGINE_HANDLE *handle, const void *cookie, const void *key, const size_t nkey, uint64_t cas, uint16_t vbucket)

Remove an item.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
keythe key identifying the item to be removed
nkeythe length of the key
vbucketthe virtual bucket id
Returns
ENGINE_SUCCESS if all goes well

Definition at line 284 of file engine.h.

void(* engine_interface_v1::reset_stats)(ENGINE_HANDLE *handle, const void *cookie)

Reset the stats.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend

Definition at line 426 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::store)(ENGINE_HANDLE *handle, const void *cookie, item *item, uint64_t *cas, ENGINE_STORE_OPERATION operation, uint16_t vbucket)

Store an item.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
itemthe item to store
casthe CAS value for conditional sets
operationthe type of store operation to perform.
vbucketthe virtual bucket id
Returns
ENGINE_SUCCESS if all goes well

Definition at line 349 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::tap_notify)(ENGINE_HANDLE *handle, const void *cookie, void *engine_specific, uint16_t nengine, uint8_t ttl, uint16_t tap_flags, tap_event_t tap_event, uint32_t tap_seqno, const void *key, size_t nkey, uint32_t flags, uint32_t exptime, uint64_t cas, const void *data, size_t ndata, uint16_t vbucket)

Callback for all incoming TAP messages. It is up to the engine to determine what to do with the event. The core will create and send a TAP_ACK message if the flag section contains TAP_FLAG_SEND_ACK with the status byte mapped from the return code.

Parameters
handlethe engine handle
cookieidentification for the tap stream
engine_specificpointer to engine specific data (received)
nengine_specificnumber of bytes of engine specific data
ttlttl for this item (Tap stream hops)
tap_flagstap flags for this object
tap_eventthe tap event from over the wire
tap_seqnosequence number for this item
keythe key in the message
nkeythe number of bytes in the key
flagsthe flags for the item
exptimethe expiry time for the object
casthe cas for the item
datathe data for the item
ndatathe number of bytes in the object
vbucketthe virtual bucket for the object
Returns
ENGINE_SUCCESS for success

Definition at line 484 of file engine.h.

ENGINE_ERROR_CODE(* engine_interface_v1::unknown_command)(ENGINE_HANDLE *handle, const void *cookie, protocol_binary_request_header *request, ADD_RESPONSE response)

Any unknown command will be considered engine specific.

Parameters
handlethe engine handle
cookieThe cookie provided by the frontend
requestpointer to request header to be filled in
responsefunction to transmit data
Returns
ENGINE_SUCCESS if all goes well

Definition at line 453 of file engine.h.


The documentation for this struct was generated from the following file: