projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge in code such that we are much closer to running the same test
[awesomized/libmemcached]
/
libmemcached
/
options
/
parser.yy
diff --git
a/libmemcached/options/parser.yy
b/libmemcached/options/parser.yy
index e950076e1c519af86ec7084f0d954c4c3f04e8e2..722ced5f9db6ffd41669cd9a96336f0624671ea7 100644
(file)
--- a/
libmemcached/options/parser.yy
+++ b/
libmemcached/options/parser.yy
@@
-39,24
+39,23
@@
#include <stdint.h>
#include <stdint.h>
+#include <libmemcached/common.h>
+#include <libmemcached/options.hpp>
+
#include <libmemcached/options/context.h>
#include <libmemcached/options/context.h>
-#include <libmemcached/options/build.h>
-#include <libmemcached/options/string.h>
#include <libmemcached/options/symbol.h>
#include <libmemcached/options/symbol.h>
-#include <libmemcached/visibility.h>
-#include <libmemcached/prefix_key.h>
+#include <libmemcached/options/scanner.h>
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wold-style-cast"
-#include <libmemcached/options/scanner.h>
int conf_lex(YYSTYPE* lvalp, void* scanner);
int conf_lex(YYSTYPE* lvalp, void* scanner);
-#define parser_abort(A, B) do {
parser::abort_func((A),
(B)); YYABORT; } while (0)
+#define parser_abort(A, B) do {
(A)->abort(
(B)); YYABORT; } while (0)
inline void config_error(Context *context, yyscan_t *scanner, const char *error)
{
if (not context->end())
inline void config_error(Context *context, yyscan_t *scanner, const char *error)
{
if (not context->end())
-
parser::abort_func(context,
error);
+
context->abort(
error);
}
%}
}
%}
@@
-76,13
+75,12
@@
inline void config_error(Context *context, yyscan_t *scanner, const char *error)
%token UNKNOWN
/* All behavior options */
%token UNKNOWN
/* All behavior options */
-%token AUTO_EJECT_HOSTS
%token BINARY_PROTOCOL
%token BUFFER_REQUESTS
%token CONNECT_TIMEOUT
%token DISTRIBUTION
%token HASH
%token BINARY_PROTOCOL
%token BUFFER_REQUESTS
%token CONNECT_TIMEOUT
%token DISTRIBUTION
%token HASH
-%token HASH_WITH_
PREFIX_KEY
+%token HASH_WITH_
NAMESPACE
%token IO_BYTES_WATERMARK
%token IO_KEY_PREFETCH
%token IO_MSG_WATERMARK
%token IO_BYTES_WATERMARK
%token IO_KEY_PREFETCH
%token IO_MSG_WATERMARK
@@
-93,22
+91,26
@@
inline void config_error(Context *context, yyscan_t *scanner, const char *error)
%token POLL_TIMEOUT
%token RANDOMIZE_REPLICA_READ
%token RCV_TIMEOUT
%token POLL_TIMEOUT
%token RANDOMIZE_REPLICA_READ
%token RCV_TIMEOUT
+%token REMOVE_FAILED_SERVERS
%token RETRY_TIMEOUT
%token RETRY_TIMEOUT
-%token SERVER_FAILURE_LIMIT
%token SND_TIMEOUT
%token SOCKET_RECV_SIZE
%token SOCKET_SEND_SIZE
%token SORT_HOSTS
%token SUPPORT_CAS
%token SND_TIMEOUT
%token SOCKET_RECV_SIZE
%token SOCKET_SEND_SIZE
%token SORT_HOSTS
%token SUPPORT_CAS
-%token _TCP_NODELAY
-%token _TCP_KEEPALIVE
-%token _TCP_KEEPIDLE
%token USER_DATA
%token USE_UDP
%token VERIFY_KEY
%token USER_DATA
%token USE_UDP
%token VERIFY_KEY
+%token _TCP_KEEPALIVE
+%token _TCP_KEEPIDLE
+%token _TCP_NODELAY
/* Callbacks */
/* Callbacks */
-%token PREFIX_KEY
+%token NAMESPACE
+
+/* Pool */
+%token POOL_MIN
+%token POOL_MAX
/* Hash types */
%token MD5
/* Hash types */
%token MD5
@@
-135,19
+137,21
@@
inline void config_error(Context *context, yyscan_t *scanner, const char *error)
%token <number> FLOAT
%token <number> NUMBER
%token <number> FLOAT
%token <number> NUMBER
-%token PORT
-%token WEIGHT_START
+%token
<number>
PORT
+%token
<number>
WEIGHT_START
%token <server> IPADDRESS
%token <server> HOSTNAME
%token <string> STRING
%token <string> QUOTED_STRING
%token <string> FILE_PATH
%token <server> IPADDRESS
%token <server> HOSTNAME
%token <string> STRING
%token <string> QUOTED_STRING
%token <string> FILE_PATH
-%type <string> string
-%type <distribution> distribution
-%type <hash> hash
%type <behavior> behavior_boolean
%type <behavior> behavior_number
%type <behavior> behavior_boolean
%type <behavior> behavior_number
+%type <distribution> distribution
+%type <hash> hash
+%type <number> optional_port
+%type <number> optional_weight
+%type <string> string
%%
%%
@@
-183,7
+187,7
@@
statement:
}
| INCLUDE ' ' string
{
}
| INCLUDE ' ' string
{
- if ((context->rc= memcached_parse_configure_file(
context->memc, $3.c_str, $3.length
)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_parse_configure_file(
*context->memc, $3.c_str, $3.size
)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);
}
{
parser_abort(context, NULL);
}
@@
-194,7
+198,7
@@
statement:
expression:
SERVER HOSTNAME optional_port optional_weight
{
expression:
SERVER HOSTNAME optional_port optional_weight
{
- if (
(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $2.port, $2.weight)) != MEMCACHED_SUCCESS
)
+ if (
memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $3, $4))
)
{
parser_abort(context, NULL);
}
{
parser_abort(context, NULL);
}
@@
-202,7
+206,7
@@
expression:
}
| SERVER IPADDRESS optional_port optional_weight
{
}
| SERVER IPADDRESS optional_port optional_weight
{
- if (
(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $2.port, $2.weight)) != MEMCACHED_SUCCESS
)
+ if (
memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $3, $4))
)
{
parser_abort(context, NULL);
}
{
parser_abort(context, NULL);
}
@@
-210,15
+214,23
@@
expression:
}
| CONFIGURE_FILE string
{
}
| CONFIGURE_FILE string
{
- memcached_set_configuration_file(context->memc, $2.c_str, $2.length);
+ memcached_set_configuration_file(context->memc, $2.c_str, $2.size);
+ }
+ | POOL_MIN NUMBER
+ {
+ context->memc->configure.initial_pool_size= $2;
+ }
+ | POOL_MAX NUMBER
+ {
+ context->memc->configure.max_pool_size= $2;
}
| behaviors
;
behaviors:
}
| behaviors
;
behaviors:
-
PREFIX_KEY
string
+
NAMESPACE
string
{
{
- if ((context->rc= memcached_set_prefix_key(context->memc, $2.c_str, $2.
length
)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_set_prefix_key(context->memc, $2.c_str, $2.
size
)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);;
}
{
parser_abort(context, NULL);;
}
@@
-268,7
+280,11
@@
behaviors:
;
behavior_number:
;
behavior_number:
- CONNECT_TIMEOUT
+ REMOVE_FAILED_SERVERS
+ {
+ $$= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS;
+ }
+ | CONNECT_TIMEOUT
{
$$= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT;
}
{
$$= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT;
}
@@
-300,10
+316,6
@@
behavior_number:
{
$$= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT;
}
{
$$= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT;
}
- | SERVER_FAILURE_LIMIT
- {
- $$= MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT;
- }
| SND_TIMEOUT
{
$$= MEMCACHED_BEHAVIOR_SND_TIMEOUT;
| SND_TIMEOUT
{
$$= MEMCACHED_BEHAVIOR_SND_TIMEOUT;
@@
-319,11
+331,7
@@
behavior_number:
;
behavior_boolean:
;
behavior_boolean:
- AUTO_EJECT_HOSTS
- {
- $$= MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS;
- }
- | BINARY_PROTOCOL
+ BINARY_PROTOCOL
{
$$= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL;
}
{
$$= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL;
}
@@
-331,7
+339,7
@@
behavior_boolean:
{
$$= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS;
}
{
$$= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS;
}
- | HASH_WITH_
PREFIX_KEY
+ | HASH_WITH_
NAMESPACE
{
$$= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY;
}
{
$$= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY;
}
@@
-374,13
+382,13
@@
behavior_boolean:
optional_port:
optional_port:
- { }
+ {
$$= MEMCACHED_DEFAULT_PORT;
}
| PORT
{ };
;
optional_weight:
| PORT
{ };
;
optional_weight:
- { }
+ {
$$= 1;
}
| WEIGHT_START
{ }
;
| WEIGHT_START
{ }
;
@@
-432,7
+440,7
@@
string:
| QUOTED_STRING
{
$$.c_str= $1.c_str +1; // +1 to move use passed the initial quote
| QUOTED_STRING
{
$$.c_str= $1.c_str +1; // +1 to move use passed the initial quote
- $$.
length= $1.length -1; // -1 removes the
end quote
+ $$.
size= $1.size -2; // -2 removes the begin and
end quote
}
;
}
;