diff options
Diffstat (limited to 'memcached.h')
-rw-r--r-- | memcached.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/memcached.h b/memcached.h index 12385db..b7d4ad5 100644 --- a/memcached.h +++ b/memcached.h @@ -223,7 +223,10 @@ enum bin_substates { enum protocol { ascii_prot = 3, /* arbitrary value. */ binary_prot, - negotiating_prot /* Discovering the protocol */ + negotiating_prot, /* Discovering the protocol */ +#ifdef PROXY + proxy_prot, +#endif }; enum network_transport { @@ -329,6 +332,12 @@ struct slab_stats { X(badcrc_from_extstore) #endif +#ifdef PROXY +#define PROXY_THREAD_STATS_FIELDS \ + X(proxy_conn_requests) \ + X(proxy_conn_errors) +#endif + /** * Stats stored per-thread. */ @@ -339,6 +348,9 @@ struct thread_stats { #ifdef EXTSTORE EXTSTORE_THREAD_STATS_FIELDS #endif +#ifdef PROXY + PROXY_THREAD_STATS_FIELDS +#endif #undef X struct slab_stats slab_stats[MAX_NUMBER_OF_SLAB_CLASSES]; uint64_t lru_hits[POWER_LARGEST]; @@ -501,6 +513,11 @@ struct settings { #endif int num_napi_ids; /* maximum number of NAPI IDs */ char *memory_file; /* warm restart memory file path */ +#ifdef PROXY + bool proxy_enabled; + char *proxy_startfile; /* lua file to run when workers start */ + void *proxy_ctx; /* proxy's state context */ +#endif }; extern struct stats stats; @@ -628,6 +645,7 @@ typedef struct { #define IO_QUEUE_NONE 0 #define IO_QUEUE_EXTSTORE 1 +#define IO_QUEUE_PROXY 2 typedef struct _io_pending_t io_pending_t; typedef struct io_queue_s io_queue_t; @@ -690,7 +708,12 @@ typedef struct { char *ssl_wbuf; #endif int napi_id; /* napi id associated with this thread */ - +#ifdef PROXY + void *L; + void *proxy_hooks; + void *proxy_stats; + // TODO: add ctx object so we can attach to queue. +#endif } LIBEVENT_THREAD; /** @@ -905,6 +928,9 @@ extern int daemonize(int nochdir, int noclose); void memcached_thread_init(int nthreads, void *arg); void redispatch_conn(conn *c); void timeout_conn(conn *c); +#ifdef PROXY +void proxy_reload_notify(LIBEVENT_THREAD *t); +#endif void return_io_pending(io_pending_t *io); void dispatch_conn_new(int sfd, enum conn_states init_state, int event_flags, int read_buffer_size, enum network_transport transport, void *ssl); @@ -945,6 +971,7 @@ void STATS_UNLOCK(void); void threadlocal_stats_reset(void); void threadlocal_stats_aggregate(struct thread_stats *stats); void slab_stats_aggregate(struct thread_stats *stats, struct slab_stats *out); +LIBEVENT_THREAD *get_worker_thread(int id); /* Stat processing functions */ void append_stat(const char *name, ADD_STAT add_stats, conn *c, |