Skip to content

Commit

Permalink
rename ds to be rds (rich data server) (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yao Yue authored Aug 4, 2019
1 parent d279cbe commit ea7cc00
Show file tree
Hide file tree
Showing 41 changed files with 73 additions and 72 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ option(HAVE_LOGGING "logging enabled by default" ON)
option(HAVE_STATS "stats enabled by default" ON)

option(TARGET_PINGSERVER "build pingserver binary" ON)
option(TARGET_DS "build dataserver binary" ON)
option(TARGET_SLIMDS "build slim dataserver binary" ON)
option(TARGET_RDS "build rich data server binary" ON)
option(TARGET_SLIMRDS "build slim rich data server binary" ON)
option(TARGET_SLIMCACHE "build slimcache binary" ON)
option(TARGET_TWEMCACHE "build twemcache binary" ON)
option(TARGET_CDB "build cdb binary (implies HAVE_RUST)" OFF)
Expand Down
8 changes: 4 additions & 4 deletions src/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ if(TARGET_PINGSERVER)
add_subdirectory(pingserver)
endif()

if(TARGET_DS)
add_subdirectory(ds)
if(TARGET_RDS)
add_subdirectory(rds)
endif()

if(TARGET_SLIMDS)
add_subdirectory(slimds)
if(TARGET_SLIMRDS)
add_subdirectory(slimrds)
endif()

if(TARGET_SLIMCACHE)
Expand Down
2 changes: 0 additions & 2 deletions src/server/ds/README

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set(LIBS
${CMAKE_THREAD_LIBS_INIT})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/_bin)
set(TARGET_NAME ${PROJECT_NAME}_ds)
set(TARGET_NAME ${PROJECT_NAME}_rds)

add_executable(${TARGET_NAME} ${SOURCE})
target_link_libraries(${TARGET_NAME} ${MODULES} ${LIBS})
Expand Down
2 changes: 2 additions & 0 deletions src/server/rds/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
We may want to rename "rds", which stands for "rich data server" right now, once
we come up with a proper name for the protocol we are using in this binary.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/server/ds/admin/process.c → src/server/rds/admin/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cc_mm.h>
#include <cc_print.h>

#define DS_ADMIN_MODULE_NAME "ds::admin"
#define RDS_ADMIN_MODULE_NAME "rds::admin"

extern struct stats stats;
extern unsigned int nmetric;
Expand All @@ -18,10 +18,10 @@ static size_t cap;
void
admin_process_setup(void)
{
log_info("set up the %s module", DS_ADMIN_MODULE_NAME);
log_info("set up the %s module", RDS_ADMIN_MODULE_NAME);
if (admin_init) {
log_warn("%s has already been setup, overwrite",
DS_ADMIN_MODULE_NAME);
RDS_ADMIN_MODULE_NAME);
}

cap = nmetric * METRIC_PRINT_LEN;
Expand All @@ -34,9 +34,9 @@ admin_process_setup(void)
void
admin_process_teardown(void)
{
log_info("tear down the %s module", DS_ADMIN_MODULE_NAME);
log_info("tear down the %s module", RDS_ADMIN_MODULE_NAME);
if (!admin_init) {
log_warn("%s has never been setup", DS_ADMIN_MODULE_NAME);
log_warn("%s has never been setup", RDS_ADMIN_MODULE_NAME);
}

admin_init = false;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions src/server/ds/data/process.c → src/server/rds/data/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cc_debug.h>
#include <cc_print.h>

#define DS_PROCESS_MODULE_NAME "ds::process"
#define RDS_PROCESS_MODULE_NAME "rds::process"

#define OVERSIZE_ERR_MSG "oversized value, cannot be stored"
#define OOM_ERR_MSG "server is out of memory"
Expand All @@ -24,11 +24,11 @@ process_metrics_st *process_metrics = NULL;
void
process_setup(process_options_st *options, process_metrics_st *metrics)
{
log_info("set up the %s module", DS_PROCESS_MODULE_NAME);
log_info("set up the %s module", RDS_PROCESS_MODULE_NAME);

if (process_init) {
log_warn("%s has already been setup, overwrite",
DS_PROCESS_MODULE_NAME);
RDS_PROCESS_MODULE_NAME);
}

process_metrics = metrics;
Expand Down Expand Up @@ -63,9 +63,9 @@ process_setup(process_options_st *options, process_metrics_st *metrics)
void
process_teardown(void)
{
log_info("tear down the %s module", DS_PROCESS_MODULE_NAME);
log_info("tear down the %s module", RDS_PROCESS_MODULE_NAME);
if (!process_init) {
log_warn("%s has never been setup", DS_PROCESS_MODULE_NAME);
log_warn("%s has never been setup", RDS_PROCESS_MODULE_NAME);
}

command_registry[REQ_PING] = cmd_ping;
Expand Down Expand Up @@ -102,7 +102,7 @@ process_request(struct response *rsp, struct request *req)
}

int
ds_process_read(struct buf **rbuf, struct buf **wbuf, void **data)
rds_process_read(struct buf **rbuf, struct buf **wbuf, void **data)
{
parse_rstatus_e status;
struct request *req; /* data should be NULL or hold a req pointer */
Expand Down Expand Up @@ -178,7 +178,7 @@ ds_process_read(struct buf **rbuf, struct buf **wbuf, void **data)


int
ds_process_write(struct buf **rbuf, struct buf **wbuf, void **data)
rds_process_write(struct buf **rbuf, struct buf **wbuf, void **data)
{
log_verb("post-write processing");

Expand All @@ -192,7 +192,7 @@ ds_process_write(struct buf **rbuf, struct buf **wbuf, void **data)


int
ds_process_error(struct buf **rbuf, struct buf **wbuf, void **data)
rds_process_error(struct buf **rbuf, struct buf **wbuf, void **data)
{
log_verb("post-error processing");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ extern bool allow_flush;
void process_setup(process_options_st *options, process_metrics_st *metrics);
void process_teardown(void);

int ds_process_read(struct buf **rbuf, struct buf **wbuf, void **data);
int ds_process_write(struct buf **rbuf, struct buf **wbuf, void **data);
int ds_process_error(struct buf **rbuf, struct buf **wbuf, void **data);
int rds_process_read(struct buf **rbuf, struct buf **wbuf, void **data);
int rds_process_write(struct buf **rbuf, struct buf **wbuf, void **data);
int rds_process_error(struct buf **rbuf, struct buf **wbuf, void **data);
File renamed without changes.
18 changes: 9 additions & 9 deletions src/server/ds/main.c → src/server/rds/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
#include <sysexits.h>

struct data_processor worker_processor = {
ds_process_read,
ds_process_write,
ds_process_error,
rds_process_read,
rds_process_write,
rds_process_error,
};

static void
show_usage(void)
{
log_stdout(
"Usage:" CRLF
" pelikan_ds [option|config]" CRLF
" pelikan_rds [option|config]" CRLF
);
log_stdout(
"Description:" CRLF
" pelikan_ds is one of the unified cache backends. " CRLF
" pelikan_rds is one of the unified cache backends. " CRLF
" It uses slab-based storage for various data types. " CRLF
" It speaks the RESP protocol." CRLF
);
Expand All @@ -41,7 +41,7 @@ show_usage(void)
);
log_stdout(
"Example:" CRLF
" pelikan_ds ds.conf" CRLF CRLF
" pelikan_rds rds.conf" CRLF CRLF
"Sample config files can be found under the config dir." CRLF
);
}
Expand Down Expand Up @@ -92,10 +92,10 @@ setup(void)
}

/* setup top-level application options */
if (option_bool(&setting.ds.daemonize)) {
if (option_bool(&setting.rds.daemonize)) {
daemonize();
}
fname = option_str(&setting.ds.pid_filename);
fname = option_str(&setting.rds.pid_filename);
if (fname != NULL) {
/* to get the correct pid, call create_pidfile after daemonize */
create_pidfile(fname);
Expand Down Expand Up @@ -124,7 +124,7 @@ setup(void)
core_worker_setup(&setting.worker, &stats.worker);

/* adding recurring events to maintenance/admin thread */
intvl = option_uint(&setting.ds.dlog_intvl);
intvl = option_uint(&setting.rds.dlog_intvl);
if (core_admin_register(intvl, debug_log_flush, NULL) == NULL) {
log_stderr("Could not register timed event to flush debug log");
goto error;
Expand Down
2 changes: 1 addition & 1 deletion src/server/ds/setting.c → src/server/rds/setting.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "setting.h"

struct setting setting = {
{ DS_OPTION(OPTION_INIT) },
{ RDS_OPTION(OPTION_INIT) },
{ ADMIN_OPTION(OPTION_INIT) },
{ SERVER_OPTION(OPTION_INIT) },
{ WORKER_OPTION(OPTION_INIT) },
Expand Down
8 changes: 4 additions & 4 deletions src/server/ds/setting.h → src/server/rds/setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

/* option related */
/* name type default description */
#define DS_OPTION(ACTION) \
#define RDS_OPTION(ACTION) \
ACTION( daemonize, OPTION_TYPE_BOOL, false, "daemonize the process" )\
ACTION( pid_filename, OPTION_TYPE_STR, NULL, "file storing the pid" )\
ACTION( dlog_intvl, OPTION_TYPE_UINT, 500, "debug log flush interval(ms)" )

typedef struct {
DS_OPTION(OPTION_DECLARE)
} ds_options_st;
RDS_OPTION(OPTION_DECLARE)
} rds_options_st;

struct setting {
/* top-level */
ds_options_st ds;
rds_options_st rds;
/* application modules */
admin_options_st admin;
server_options_st server;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions src/server/slimds/README

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(LIBS
${CMAKE_THREAD_LIBS_INIT})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/_bin)
set(TARGET_NAME ${PROJECT_NAME}_slimds)
set(TARGET_NAME ${PROJECT_NAME}_slimrds)

add_executable(${TARGET_NAME} ${SOURCE})
target_link_libraries(${TARGET_NAME} ${MODULES} ${LIBS})
Expand Down
3 changes: 3 additions & 0 deletions src/server/slimrds/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
We may want to rename "slimrds", which stands for "slim rich data server" right
now, once we come up with a proper name for the protocol we are using in this
binary.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cc_mm.h>
#include <cc_print.h>

#define SLIMDS_ADMIN_MODULE_NAME "slimds::admin"
#define SLIMRDS_ADMIN_MODULE_NAME "slimrds::admin"

extern struct stats stats;
extern unsigned int nmetric;
Expand All @@ -18,10 +18,10 @@ static size_t cap;
void
admin_process_setup(void)
{
log_info("set up the %s module", SLIMDS_ADMIN_MODULE_NAME);
log_info("set up the %s module", SLIMRDS_ADMIN_MODULE_NAME);
if (admin_init) {
log_warn("%s has already been setup, overwrite",
SLIMDS_ADMIN_MODULE_NAME);
SLIMRDS_ADMIN_MODULE_NAME);
}

cap = nmetric * METRIC_PRINT_LEN;
Expand All @@ -34,9 +34,9 @@ admin_process_setup(void)
void
admin_process_teardown(void)
{
log_info("tear down the %s module", SLIMDS_ADMIN_MODULE_NAME);
log_info("tear down the %s module", SLIMRDS_ADMIN_MODULE_NAME);
if (!admin_init) {
log_warn("%s has never been setup", SLIMDS_ADMIN_MODULE_NAME);
log_warn("%s has never been setup", SLIMRDS_ADMIN_MODULE_NAME);
}

admin_init = false;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <cc_debug.h>
#include <cc_print.h>

#define SLIMDS_PROCESS_MODULE_NAME "slimds::process"
#define SLIMRDS_PROCESS_MODULE_NAME "slimrds::process"

#define OVERSIZE_ERR_MSG "oversized value, cannot be stored"
#define OOM_ERR_MSG "server is out of memory"
Expand All @@ -23,11 +23,11 @@ process_metrics_st *process_metrics = NULL;
void
process_setup(process_options_st *options, process_metrics_st *metrics)
{
log_info("set up the %s module", SLIMDS_PROCESS_MODULE_NAME);
log_info("set up the %s module", SLIMRDS_PROCESS_MODULE_NAME);

if (process_init) {
log_warn("%s has already been setup, overwrite",
SLIMDS_PROCESS_MODULE_NAME);
SLIMRDS_PROCESS_MODULE_NAME);
}

process_metrics = metrics;
Expand All @@ -49,9 +49,9 @@ process_setup(process_options_st *options, process_metrics_st *metrics)
void
process_teardown(void)
{
log_info("tear down the %s module", SLIMDS_PROCESS_MODULE_NAME);
log_info("tear down the %s module", SLIMRDS_PROCESS_MODULE_NAME);
if (!process_init) {
log_warn("%s has never been setup", SLIMDS_PROCESS_MODULE_NAME);
log_warn("%s has never been setup", SLIMRDS_PROCESS_MODULE_NAME);
}

command_registry[REQ_PING] = cmd_ping;
Expand Down Expand Up @@ -88,7 +88,7 @@ process_request(struct response *rsp, struct request *req)
}

int
slimds_process_read(struct buf **rbuf, struct buf **wbuf, void **data)
slimrds_process_read(struct buf **rbuf, struct buf **wbuf, void **data)
{
parse_rstatus_e status;
struct request *req; /* data should be NULL or hold a req pointer */
Expand Down Expand Up @@ -164,7 +164,7 @@ slimds_process_read(struct buf **rbuf, struct buf **wbuf, void **data)


int
slimds_process_write(struct buf **rbuf, struct buf **wbuf, void **data)
slimrds_process_write(struct buf **rbuf, struct buf **wbuf, void **data)
{
log_verb("post-write processing");

Expand All @@ -178,7 +178,7 @@ slimds_process_write(struct buf **rbuf, struct buf **wbuf, void **data)


int
slimds_process_error(struct buf **rbuf, struct buf **wbuf, void **data)
slimrds_process_error(struct buf **rbuf, struct buf **wbuf, void **data)
{
log_verb("post-error processing");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ extern bool allow_flush;
void process_setup(process_options_st *options, process_metrics_st *metrics);
void process_teardown(void);

int slimds_process_read(struct buf **rbuf, struct buf **wbuf, void **data);
int slimds_process_write(struct buf **rbuf, struct buf **wbuf, void **data);
int slimds_process_error(struct buf **rbuf, struct buf **wbuf, void **data);
int slimrds_process_read(struct buf **rbuf, struct buf **wbuf, void **data);
int slimrds_process_write(struct buf **rbuf, struct buf **wbuf, void **data);
int slimrds_process_error(struct buf **rbuf, struct buf **wbuf, void **data);
Loading

0 comments on commit ea7cc00

Please sign in to comment.