From d7a4e37ed3f72ed9058590b039804bef1c69d3a3 Mon Sep 17 00:00:00 2001 From: Yao Yue Date: Tue, 23 Jul 2019 18:05:37 -0700 Subject: [PATCH] rename redis protocol to resp --- src/client/README.md | 2 +- src/client/resp_cli/CMakeLists.txt | 2 +- src/client/resp_cli/setting.h | 2 +- src/protocol/data/CMakeLists.txt | 2 +- src/protocol/data/redis_include.h | 6 ------ src/protocol/data/{redis => resp}/CMakeLists.txt | 2 +- src/protocol/data/{redis => resp}/cmd_bitmap.h | 0 src/protocol/data/{redis => resp}/cmd_hash.h | 0 src/protocol/data/{redis => resp}/cmd_list.h | 0 src/protocol/data/{redis => resp}/cmd_misc.h | 0 src/protocol/data/{redis => resp}/cmd_zset.h | 0 src/protocol/data/{redis => resp}/compose.c | 2 +- src/protocol/data/{redis => resp}/compose.h | 0 src/protocol/data/{redis => resp}/parse.c | 2 +- src/protocol/data/{redis => resp}/parse.h | 0 src/protocol/data/{redis => resp}/process.h | 0 src/protocol/data/{redis => resp}/request.c | 2 +- src/protocol/data/{redis => resp}/request.h | 0 src/protocol/data/{redis => resp}/response.c | 2 +- src/protocol/data/{redis => resp}/response.h | 0 src/protocol/data/{redis => resp}/token.c | 0 src/protocol/data/{redis => resp}/token.h | 0 src/protocol/data/resp_include.h | 6 ++++++ src/server/ds/CMakeLists.txt | 2 +- src/server/ds/data/cmd_list.c | 2 +- src/server/ds/data/cmd_misc.c | 2 +- src/server/ds/data/process.c | 2 +- src/server/ds/setting.h | 2 +- src/server/ds/stats.h | 2 +- src/server/slimds/CMakeLists.txt | 2 +- src/server/slimds/data/cmd_bitmap.c | 2 +- src/server/slimds/data/cmd_misc.c | 2 +- src/server/slimds/data/process.c | 2 +- src/server/slimds/setting.h | 2 +- src/server/slimds/stats.h | 2 +- test/protocol/data/CMakeLists.txt | 2 +- test/protocol/data/{redis => resp}/CMakeLists.txt | 2 +- .../data/{redis/check_redis.c => resp/check_resp.c} | 8 ++++---- 38 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 src/protocol/data/redis_include.h rename src/protocol/data/{redis => resp}/CMakeLists.txt (67%) rename src/protocol/data/{redis => resp}/cmd_bitmap.h (100%) rename src/protocol/data/{redis => resp}/cmd_hash.h (100%) rename src/protocol/data/{redis => resp}/cmd_list.h (100%) rename src/protocol/data/{redis => resp}/cmd_misc.h (100%) rename src/protocol/data/{redis => resp}/cmd_zset.h (100%) rename src/protocol/data/{redis => resp}/compose.c (97%) rename src/protocol/data/{redis => resp}/compose.h (100%) rename src/protocol/data/{redis => resp}/parse.c (98%) rename src/protocol/data/{redis => resp}/parse.h (100%) rename src/protocol/data/{redis => resp}/process.h (100%) rename src/protocol/data/{redis => resp}/request.c (98%) rename src/protocol/data/{redis => resp}/request.h (100%) rename src/protocol/data/{redis => resp}/response.c (98%) rename src/protocol/data/{redis => resp}/response.h (100%) rename src/protocol/data/{redis => resp}/token.c (100%) rename src/protocol/data/{redis => resp}/token.h (100%) create mode 100644 src/protocol/data/resp_include.h rename test/protocol/data/{redis => resp}/CMakeLists.txt (94%) rename test/protocol/data/{redis/check_redis.c => resp/check_resp.c} (99%) diff --git a/src/client/README.md b/src/client/README.md index 593a123f6..0cec650ed 100644 --- a/src/client/README.md +++ b/src/client/README.md @@ -1,4 +1,4 @@ -The idea of a CLI client comes from Redis, which builds `redis-cli` for easy +The idea of a CLI client comes from Redis, which builds `resp-cli` for easy testing and interactive play. This is particularly useful for Redis because the RESP protocol is more verbose than Memcached's ASCII protocol. diff --git a/src/client/resp_cli/CMakeLists.txt b/src/client/resp_cli/CMakeLists.txt index 65dcc922b..55c99d2cf 100644 --- a/src/client/resp_cli/CMakeLists.txt +++ b/src/client/resp_cli/CMakeLists.txt @@ -6,7 +6,7 @@ set(SOURCE set(MODULES client-network - protocol_redis + protocol_resp util) set(LIBS diff --git a/src/client/resp_cli/setting.h b/src/client/resp_cli/setting.h index d80602635..bd71f8ce4 100644 --- a/src/client/resp_cli/setting.h +++ b/src/client/resp_cli/setting.h @@ -2,7 +2,7 @@ #include "core/data/server.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include #include diff --git a/src/protocol/data/CMakeLists.txt b/src/protocol/data/CMakeLists.txt index dd4eb3c78..af72a52b1 100644 --- a/src/protocol/data/CMakeLists.txt +++ b/src/protocol/data/CMakeLists.txt @@ -1,3 +1,3 @@ add_subdirectory(memcache) add_subdirectory(ping) -add_subdirectory(redis) +add_subdirectory(resp) diff --git a/src/protocol/data/redis_include.h b/src/protocol/data/redis_include.h deleted file mode 100644 index dea202d2e..000000000 --- a/src/protocol/data/redis_include.h +++ /dev/null @@ -1,6 +0,0 @@ -#include "redis/compose.h" -#include "redis/token.h" -#include "redis/parse.h" -#include "redis/process.h" -#include "redis/request.h" -#include "redis/response.h" diff --git a/src/protocol/data/redis/CMakeLists.txt b/src/protocol/data/resp/CMakeLists.txt similarity index 67% rename from src/protocol/data/redis/CMakeLists.txt rename to src/protocol/data/resp/CMakeLists.txt index 52280aee7..4658a30b8 100644 --- a/src/protocol/data/redis/CMakeLists.txt +++ b/src/protocol/data/resp/CMakeLists.txt @@ -5,4 +5,4 @@ set(SOURCE response.c token.c) -add_library(protocol_redis ${SOURCE}) +add_library(protocol_resp ${SOURCE}) diff --git a/src/protocol/data/redis/cmd_bitmap.h b/src/protocol/data/resp/cmd_bitmap.h similarity index 100% rename from src/protocol/data/redis/cmd_bitmap.h rename to src/protocol/data/resp/cmd_bitmap.h diff --git a/src/protocol/data/redis/cmd_hash.h b/src/protocol/data/resp/cmd_hash.h similarity index 100% rename from src/protocol/data/redis/cmd_hash.h rename to src/protocol/data/resp/cmd_hash.h diff --git a/src/protocol/data/redis/cmd_list.h b/src/protocol/data/resp/cmd_list.h similarity index 100% rename from src/protocol/data/redis/cmd_list.h rename to src/protocol/data/resp/cmd_list.h diff --git a/src/protocol/data/redis/cmd_misc.h b/src/protocol/data/resp/cmd_misc.h similarity index 100% rename from src/protocol/data/redis/cmd_misc.h rename to src/protocol/data/resp/cmd_misc.h diff --git a/src/protocol/data/redis/cmd_zset.h b/src/protocol/data/resp/cmd_zset.h similarity index 100% rename from src/protocol/data/redis/cmd_zset.h rename to src/protocol/data/resp/cmd_zset.h diff --git a/src/protocol/data/redis/compose.c b/src/protocol/data/resp/compose.c similarity index 97% rename from src/protocol/data/redis/compose.c rename to src/protocol/data/resp/compose.c index 9b829cde9..7778dcfa0 100644 --- a/src/protocol/data/redis/compose.c +++ b/src/protocol/data/resp/compose.c @@ -7,7 +7,7 @@ #include #include -#define COMPOSE_MODULE_NAME "protocol::redis::compose" +#define COMPOSE_MODULE_NAME "protocol::resp::compose" static bool compose_init = false; static compose_req_metrics_st *compose_req_metrics = NULL; diff --git a/src/protocol/data/redis/compose.h b/src/protocol/data/resp/compose.h similarity index 100% rename from src/protocol/data/redis/compose.h rename to src/protocol/data/resp/compose.h diff --git a/src/protocol/data/redis/parse.c b/src/protocol/data/resp/parse.c similarity index 98% rename from src/protocol/data/redis/parse.c rename to src/protocol/data/resp/parse.c index 91477d97f..6aa3b7974 100644 --- a/src/protocol/data/redis/parse.c +++ b/src/protocol/data/resp/parse.c @@ -11,7 +11,7 @@ #include -#define PARSE_MODULE_NAME "protocol::redis::parse" +#define PARSE_MODULE_NAME "protocol::resp::parse" static bool parse_init = false; static parse_req_metrics_st *parse_req_metrics = NULL; diff --git a/src/protocol/data/redis/parse.h b/src/protocol/data/resp/parse.h similarity index 100% rename from src/protocol/data/redis/parse.h rename to src/protocol/data/resp/parse.h diff --git a/src/protocol/data/redis/process.h b/src/protocol/data/resp/process.h similarity index 100% rename from src/protocol/data/redis/process.h rename to src/protocol/data/resp/process.h diff --git a/src/protocol/data/redis/request.c b/src/protocol/data/resp/request.c similarity index 98% rename from src/protocol/data/redis/request.c rename to src/protocol/data/resp/request.c index 5dd9c3c2c..b0ab87312 100644 --- a/src/protocol/data/redis/request.c +++ b/src/protocol/data/resp/request.c @@ -6,7 +6,7 @@ #include #include -#define REQUEST_MODULE_NAME "protocol::redis::request" +#define REQUEST_MODULE_NAME "protocol::resp::request" static bool request_init = false; static request_metrics_st *request_metrics = NULL; diff --git a/src/protocol/data/redis/request.h b/src/protocol/data/resp/request.h similarity index 100% rename from src/protocol/data/redis/request.h rename to src/protocol/data/resp/request.h diff --git a/src/protocol/data/redis/response.c b/src/protocol/data/resp/response.c similarity index 98% rename from src/protocol/data/redis/response.c rename to src/protocol/data/resp/response.c index ee840b18d..a4b526b4e 100644 --- a/src/protocol/data/redis/response.c +++ b/src/protocol/data/resp/response.c @@ -6,7 +6,7 @@ #include #include -#define RESPONSE_MODULE_NAME "protocol::redis::response" +#define RESPONSE_MODULE_NAME "protocol::resp::response" static bool response_init = false; static response_metrics_st *response_metrics = NULL; diff --git a/src/protocol/data/redis/response.h b/src/protocol/data/resp/response.h similarity index 100% rename from src/protocol/data/redis/response.h rename to src/protocol/data/resp/response.h diff --git a/src/protocol/data/redis/token.c b/src/protocol/data/resp/token.c similarity index 100% rename from src/protocol/data/redis/token.c rename to src/protocol/data/resp/token.c diff --git a/src/protocol/data/redis/token.h b/src/protocol/data/resp/token.h similarity index 100% rename from src/protocol/data/redis/token.h rename to src/protocol/data/resp/token.h diff --git a/src/protocol/data/resp_include.h b/src/protocol/data/resp_include.h new file mode 100644 index 000000000..50eb86f30 --- /dev/null +++ b/src/protocol/data/resp_include.h @@ -0,0 +1,6 @@ +#include "resp/compose.h" +#include "resp/token.h" +#include "resp/parse.h" +#include "resp/process.h" +#include "resp/request.h" +#include "resp/response.h" diff --git a/src/server/ds/CMakeLists.txt b/src/server/ds/CMakeLists.txt index d091694b9..9b031c6c7 100644 --- a/src/server/ds/CMakeLists.txt +++ b/src/server/ds/CMakeLists.txt @@ -11,7 +11,7 @@ set(MODULES core ds_ziplist protocol_admin - protocol_redis + protocol_resp slab time util) diff --git a/src/server/ds/data/cmd_list.c b/src/server/ds/data/cmd_list.c index 4b9cd4364..8e52c4024 100644 --- a/src/server/ds/data/cmd_list.c +++ b/src/server/ds/data/cmd_list.c @@ -1,7 +1,7 @@ #include "process.h" #include "data_structure/ziplist/ziplist.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include "storage/slab/item.h" #include "storage/slab/slab.h" diff --git a/src/server/ds/data/cmd_misc.c b/src/server/ds/data/cmd_misc.c index 3c67072ea..edec66795 100644 --- a/src/server/ds/data/cmd_misc.c +++ b/src/server/ds/data/cmd_misc.c @@ -1,6 +1,6 @@ #include "process.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include #include diff --git a/src/server/ds/data/process.c b/src/server/ds/data/process.c index 50cd5fa39..dfcce9fbb 100644 --- a/src/server/ds/data/process.c +++ b/src/server/ds/data/process.c @@ -1,6 +1,6 @@ #include "process.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include #include diff --git a/src/server/ds/setting.h b/src/server/ds/setting.h index 46a44c210..98175de37 100644 --- a/src/server/ds/setting.h +++ b/src/server/ds/setting.h @@ -5,7 +5,7 @@ #include "core/core.h" #include "storage/slab/item.h" #include "storage/slab/slab.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include "time/time.h" #include diff --git a/src/server/ds/stats.h b/src/server/ds/stats.h index 1239f75cf..0f7f3f337 100644 --- a/src/server/ds/stats.h +++ b/src/server/ds/stats.h @@ -3,7 +3,7 @@ #include "data/process.h" #include "core/core.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include "storage/slab/item.h" #include "storage/slab/slab.h" #include "util/procinfo.h" diff --git a/src/server/slimds/CMakeLists.txt b/src/server/slimds/CMakeLists.txt index 5035a723f..7071fc103 100644 --- a/src/server/slimds/CMakeLists.txt +++ b/src/server/slimds/CMakeLists.txt @@ -12,7 +12,7 @@ set(MODULES cuckoo ds_bitmap protocol_admin - protocol_redis + protocol_resp time util) diff --git a/src/server/slimds/data/cmd_bitmap.c b/src/server/slimds/data/cmd_bitmap.c index 81c6891ea..a371052be 100644 --- a/src/server/slimds/data/cmd_bitmap.c +++ b/src/server/slimds/data/cmd_bitmap.c @@ -1,7 +1,7 @@ #include "process.h" #include "data_structure/bitmap/bitset.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include "storage/cuckoo/cuckoo.h" #include "time/time.h" diff --git a/src/server/slimds/data/cmd_misc.c b/src/server/slimds/data/cmd_misc.c index 3c67072ea..edec66795 100644 --- a/src/server/slimds/data/cmd_misc.c +++ b/src/server/slimds/data/cmd_misc.c @@ -1,6 +1,6 @@ #include "process.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include #include diff --git a/src/server/slimds/data/process.c b/src/server/slimds/data/process.c index 53bb12089..1a3c27066 100644 --- a/src/server/slimds/data/process.c +++ b/src/server/slimds/data/process.c @@ -1,6 +1,6 @@ #include "process.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include #include diff --git a/src/server/slimds/setting.h b/src/server/slimds/setting.h index c0da49043..a60a6e74a 100644 --- a/src/server/slimds/setting.h +++ b/src/server/slimds/setting.h @@ -4,7 +4,7 @@ #include "core/core.h" #include "storage/cuckoo/cuckoo.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include "time/time.h" #include diff --git a/src/server/slimds/stats.h b/src/server/slimds/stats.h index 92a8423da..df36c8f93 100644 --- a/src/server/slimds/stats.h +++ b/src/server/slimds/stats.h @@ -3,7 +3,7 @@ #include "data/process.h" #include "core/core.h" -#include "protocol/data/redis_include.h" +#include "protocol/data/resp_include.h" #include "storage/cuckoo/cuckoo.h" #include "util/procinfo.h" diff --git a/test/protocol/data/CMakeLists.txt b/test/protocol/data/CMakeLists.txt index da74fe8e4..227350e12 100644 --- a/test/protocol/data/CMakeLists.txt +++ b/test/protocol/data/CMakeLists.txt @@ -1,2 +1,2 @@ add_subdirectory(memcache) -add_subdirectory(redis) +add_subdirectory(resp) diff --git a/test/protocol/data/redis/CMakeLists.txt b/test/protocol/data/resp/CMakeLists.txt similarity index 94% rename from test/protocol/data/redis/CMakeLists.txt rename to test/protocol/data/resp/CMakeLists.txt index 5ad3ecc29..15cc10e51 100644 --- a/test/protocol/data/redis/CMakeLists.txt +++ b/test/protocol/data/resp/CMakeLists.txt @@ -1,4 +1,4 @@ -set(suite redis) +set(suite resp) set(test_name check_${suite}) set(source check_${suite}.c) diff --git a/test/protocol/data/redis/check_redis.c b/test/protocol/data/resp/check_resp.c similarity index 99% rename from test/protocol/data/redis/check_redis.c rename to test/protocol/data/resp/check_resp.c index 82518dfb6..2e8fb1b7c 100644 --- a/test/protocol/data/redis/check_redis.c +++ b/test/protocol/data/resp/check_resp.c @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -11,7 +11,7 @@ #include /* define for each suite, local scope due to macro visibility rule */ -#define SUITE_NAME "redis" +#define SUITE_NAME "resp" #define DEBUG_LOG SUITE_NAME ".log" struct request *req; @@ -561,7 +561,7 @@ END_TEST * test suite */ static Suite * -redis_suite(void) +resp_suite(void) { Suite *s = suite_create(SUITE_NAME); @@ -616,7 +616,7 @@ main(void) /* setup */ test_setup(); - Suite *suite = redis_suite(); + Suite *suite = resp_suite(); SRunner *srunner = srunner_create(suite); srunner_set_log(srunner, DEBUG_LOG); srunner_run_all(srunner, CK_ENV); /* set CK_VEBOSITY in ENV to customize */