YAZ
5.34.0
|
Implements query/record caching using memcached. More...
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "zoom-p.h"
#include <yaz/yaz-util.h>
#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include <yaz/diagbib1.h>
Go to the source code of this file.
Functions | |
void | ZOOM_memcached_init (ZOOM_connection c) |
void | ZOOM_memcached_destroy (ZOOM_connection c) |
int | ZOOM_memcached_configure (ZOOM_connection c) |
static void | wrbuf_vary_puts (WRBUF w, const char *v) |
void | ZOOM_memcached_resultset (ZOOM_resultset r, ZOOM_query q) |
void | ZOOM_memcached_search (ZOOM_connection c, ZOOM_resultset resultset) |
void | ZOOM_memcached_hitcount (ZOOM_connection c, ZOOM_resultset resultset, Z_OtherInformation *oi, const char *precision) |
void | ZOOM_memcached_add (ZOOM_resultset r, Z_NamePlusRecord *npr, int pos, const char *syntax, const char *elementSetName, const char *schema, Z_SRW_diagnostic *diag) |
Z_NamePlusRecord * | ZOOM_memcached_lookup (ZOOM_resultset r, int pos, const char *syntax, const char *elementSetName, const char *schema) |
Implements query/record caching using memcached.
Definition in file zoom-memcached.c.
|
static |
Definition at line 188 of file zoom-memcached.c.
References wrbuf_puts(), and wrbuf_sha1_puts().
Referenced by ZOOM_memcached_resultset().
void ZOOM_memcached_add | ( | ZOOM_resultset | r, |
Z_NamePlusRecord * | npr, | ||
int | pos, | ||
const char * | syntax, | ||
const char * | elementSetName, | ||
const char * | schema, | ||
Z_SRW_diagnostic * | diag | ||
) |
Definition at line 424 of file zoom-memcached.c.
References ZOOM_resultset_p::connection, ZOOM_connection_p::expire_record, ZOOM_connection_p::expire_search, ZOOM_resultset_p::mc_key, odr_createmem(), odr_destroy(), ODR_ENCODE, odr_getbuf(), Z_NamePlusRecord::which, wrbuf_alloc(), wrbuf_buf, wrbuf_cstr(), wrbuf_destroy(), wrbuf_len, wrbuf_printf(), wrbuf_sha1_write(), wrbuf_write(), yaz_log(), YLOG_LOG, z_NamePlusRecord(), and Z_NamePlusRecord_databaseRecord.
Referenced by ZOOM_record_cache_add().
int ZOOM_memcached_configure | ( | ZOOM_connection | c | ) |
Definition at line 132 of file zoom-memcached.c.
References ZOOM_connection_p::expire_record, ZOOM_connection_p::expire_search, ZOOM_connection_p::options, ZOOM_ERROR_MEMCACHED, ZOOM_options_get(), and ZOOM_set_error().
Referenced by ZOOM_connection_connect().
void ZOOM_memcached_destroy | ( | ZOOM_connection | c | ) |
Definition at line 35 of file zoom-memcached.c.
Referenced by ZOOM_connection_destroy().
void ZOOM_memcached_hitcount | ( | ZOOM_connection | c, |
ZOOM_resultset | resultset, | ||
Z_OtherInformation * | oi, | ||
const char * | precision | ||
) |
Definition at line 342 of file zoom-memcached.c.
References ZOOM_connection_p::expire_search, ZOOM_resultset_p::live_set, ZOOM_resultset_p::mc_key, odr_createmem(), odr_destroy(), ODR_ENCODE, odr_getbuf(), ODR_INT_PRINTF, odr_malloc(), ZOOM_resultset_p::size, wrbuf_buf, wrbuf_cstr(), wrbuf_len, yaz_log(), YLOG_LOG, and z_OtherInformation().
Referenced by handle_srw_response(), and handle_Z3950_search_response().
void ZOOM_memcached_init | ( | ZOOM_connection | c | ) |
Definition at line 23 of file zoom-memcached.c.
References ZOOM_connection_p::expire_record, and ZOOM_connection_p::expire_search.
Referenced by ZOOM_connection_create().
Z_NamePlusRecord* ZOOM_memcached_lookup | ( | ZOOM_resultset | r, |
int | pos, | ||
const char * | syntax, | ||
const char * | elementSetName, | ||
const char * | schema | ||
) |
Definition at line 535 of file zoom-memcached.c.
References ZOOM_resultset_p::connection, free(), ZOOM_resultset_p::mc_key, ZOOM_resultset_p::odr, odr_setbuf(), wrbuf_alloc(), wrbuf_buf, wrbuf_cstr(), wrbuf_destroy(), wrbuf_len, wrbuf_printf(), wrbuf_write(), yaz_log(), YLOG_LOG, and z_NamePlusRecord().
Referenced by ZOOM_record_cache_lookup().
void ZOOM_memcached_resultset | ( | ZOOM_resultset | r, |
ZOOM_query | q | ||
) |
Definition at line 203 of file zoom-memcached.c.
References ZOOM_resultset_p::connection, ZOOM_connection_p::group, ZOOM_connection_p::host_port, ZOOM_resultset_p::mc_key, ZOOM_connection_p::password, ZOOM_resultset_p::req_facets, ZOOM_connection_p::user, wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_puts(), wrbuf_sha1_puts(), wrbuf_vary_puts(), ZOOM_query_get_hash(), and ZOOM_resultset_option_get().
Referenced by ZOOM_connection_search().
void ZOOM_memcached_search | ( | ZOOM_connection | c, |
ZOOM_resultset | resultset | ||
) |
Definition at line 230 of file zoom-memcached.c.
References free(), ZOOM_resultset_p::live_set, ZOOM_resultset_p::mc_key, ZOOM_resultset_p::odr, odr_atoi(), odr_setbuf(), ZOOM_resultset_p::size, wrbuf_buf, wrbuf_cstr(), wrbuf_len, yaz_log(), YLOG_LOG, YLOG_WARN, z_OtherInformation(), ZOOM_connection_put_event(), ZOOM_Event_create(), ZOOM_EVENT_RECV_SEARCH, ZOOM_handle_facet_result(), and ZOOM_handle_search_result().
Referenced by ZOOM_connection_srw_send_search(), and ZOOM_connection_Z3950_search().