Skip to content

Commit

Permalink
s/nutcracker/nutredis/
Browse files Browse the repository at this point in the history
  • Loading branch information
mishan committed Apr 27, 2016
1 parent 646a0e4 commit 9de9e99
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ACLOCAL_AMFLAGS = -I m4

SUBDIRS = contrib src

dist_man_MANS = man/nutcracker.8
dist_man_MANS = man/nutredis.8

EXTRA_DIST = README.md NOTICE LICENSE ChangeLog conf scripts notes
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ m4_define([NC_BUGS], [[email protected]])

# Initialize autoconf
AC_PREREQ([2.64])
AC_INIT([nutcracker], [NC_MAJOR.NC_MINOR.NC_PATCH], [NC_BUGS])
AC_INIT([nutredis], [NC_MAJOR.NC_MINOR.NC_PATCH], [NC_BUGS])
AC_CONFIG_SRCDIR([src/nc.c])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config.h:config.h.in])
Expand Down
10 changes: 5 additions & 5 deletions man/nutcracker.8 → man/nutredis.8
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.TH NUTCRACKER 8 "June 13, 2013"
.TH NUTREDIS 8 "June 13, 2013"
.SH NAME
nutcracker \- Fast, light-weight proxy for memcached and Redis
nutredis \- Fast, light-weight proxy for memcached and Redis
.SH SYNOPSIS
.B nutcracker
.B nutredis
.RI [ options ]
.SH DESCRIPTION
\fBnutcracker\fP, also known as \fBtwemproxy\fP (pronounced "two-em-proxy"), is
\fBnutredis\fP, also known as \fBnutcracker\fP and \fBtwemproxy\fP (pronounced "two-em-proxy"), is
a fast and lightweight proxy for the memcached and Redis protocols.
.PP
It was primarily built to reduce the connection count on backend caching
Expand Down Expand Up @@ -73,4 +73,4 @@ Set pid file to \fIfilename\fP.
.BR redis-server (1)
.br
.SH AUTHOR
nutcracker was written by Twitter, Inc.
nutredis is a fork with andyqzb's Redis Sentinel patch. nutcracker was written by Twitter, Inc.
12 changes: 6 additions & 6 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ endif

SUBDIRS = hashkit proto event

sbin_PROGRAMS = nutcracker
sbin_PROGRAMS = nutredis

nutcracker_SOURCES = \
nutredis_SOURCES = \
nc_core.c nc_core.h \
nc_connection.c nc_connection.h \
nc_client.c nc_client.h \
Expand All @@ -55,7 +55,7 @@ nutcracker_SOURCES = \
nc_queue.h \
nc.c

nutcracker_LDADD = $(top_builddir)/src/hashkit/libhashkit.a
nutcracker_LDADD += $(top_builddir)/src/proto/libproto.a
nutcracker_LDADD += $(top_builddir)/src/event/libevent.a
nutcracker_LDADD += $(top_builddir)/contrib/yaml-0.1.4/src/.libs/libyaml.a
nutredis_LDADD = $(top_builddir)/src/hashkit/libhashkit.a
nutredis_LDADD += $(top_builddir)/src/proto/libproto.a
nutredis_LDADD += $(top_builddir)/src/event/libevent.a
nutredis_LDADD += $(top_builddir)/contrib/yaml-0.1.4/src/.libs/libyaml.a
36 changes: 18 additions & 18 deletions src/nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <nc_conf.h>
#include <nc_signal.h>

#define NC_CONF_PATH "conf/nutcracker.yml"
#define NC_CONF_PATH "conf/nutredis.yml"

#define NC_LOG_DEFAULT LOG_NOTICE
#define NC_LOG_MIN LOG_EMERG
Expand Down Expand Up @@ -180,9 +180,9 @@ nc_print_run(struct instance *nci)

status = uname(&name);
if (status < 0) {
loga("nutcracker-%s started on pid %d", NC_VERSION_STRING, nci->pid);
loga("nutredis-%s started on pid %d", NC_VERSION_STRING, nci->pid);
} else {
loga("nutcracker-%s built for %s %s %s started on pid %d",
loga("nutredis-%s built for %s %s %s started on pid %d",
NC_VERSION_STRING, name.sysname, name.release, name.machine,
nci->pid);
}
Expand All @@ -202,7 +202,7 @@ static void
nc_show_usage(void)
{
log_stderr(
"Usage: nutcracker [-?hVdDt] [-v verbosity level] [-o output file]" CRLF
"Usage: nutredis [-?hVdDt] [-v verbosity level] [-o output file]" CRLF
" [-c conf file] [-s stats port] [-a stats addr]" CRLF
" [-i stats interval] [-p pid file] [-m mbuf size]" CRLF
"");
Expand Down Expand Up @@ -342,7 +342,7 @@ nc_get_options(int argc, char **argv, struct instance *nci)
case 'v':
value = nc_atoi(optarg, strlen(optarg));
if (value < 0) {
log_stderr("nutcracker: option -v requires a number");
log_stderr("nutredis: option -v requires a number");
return NC_ERROR;
}
nci->log_level = value;
Expand All @@ -359,11 +359,11 @@ nc_get_options(int argc, char **argv, struct instance *nci)
case 's':
value = nc_atoi(optarg, strlen(optarg));
if (value < 0) {
log_stderr("nutcracker: option -s requires a number");
log_stderr("nutredis: option -s requires a number");
return NC_ERROR;
}
if (!nc_valid_port(value)) {
log_stderr("nutcracker: option -s value %d is not a valid "
log_stderr("nutredis: option -s value %d is not a valid "
"port", value);
return NC_ERROR;
}
Expand All @@ -374,7 +374,7 @@ nc_get_options(int argc, char **argv, struct instance *nci)
case 'i':
value = nc_atoi(optarg, strlen(optarg));
if (value < 0) {
log_stderr("nutcracker: option -i requires a number");
log_stderr("nutredis: option -i requires a number");
return NC_ERROR;
}

Expand All @@ -392,12 +392,12 @@ nc_get_options(int argc, char **argv, struct instance *nci)
case 'm':
value = nc_atoi(optarg, strlen(optarg));
if (value <= 0) {
log_stderr("nutcracker: option -m requires a non-zero number");
log_stderr("nutredis: option -m requires a non-zero number");
return NC_ERROR;
}

if (value < NC_MBUF_MIN_SIZE || value > NC_MBUF_MAX_SIZE) {
log_stderr("nutcracker: mbuf chunk size must be between %zu and"
log_stderr("nutredis: mbuf chunk size must be between %zu and"
" %zu bytes", NC_MBUF_MIN_SIZE, NC_MBUF_MAX_SIZE);
return NC_ERROR;
}
Expand All @@ -410,29 +410,29 @@ nc_get_options(int argc, char **argv, struct instance *nci)
case 'o':
case 'c':
case 'p':
log_stderr("nutcracker: option -%c requires a file name",
log_stderr("nutredis: option -%c requires a file name",
optopt);
break;

case 'm':
case 'v':
case 's':
case 'i':
log_stderr("nutcracker: option -%c requires a number", optopt);
log_stderr("nutredis: option -%c requires a number", optopt);
break;

case 'a':
log_stderr("nutcracker: option -%c requires a string", optopt);
log_stderr("nutredis: option -%c requires a string", optopt);
break;

default:
log_stderr("nutcracker: invalid option -- '%c'", optopt);
log_stderr("nutredis: invalid option -- '%c'", optopt);
break;
}
return NC_ERROR;

default:
log_stderr("nutcracker: invalid option -- '%c'", optopt);
log_stderr("nutredis: invalid option -- '%c'", optopt);
return NC_ERROR;

}
Expand All @@ -452,14 +452,14 @@ nc_test_conf(struct instance *nci)

cf = conf_create(nci->conf_filename);
if (cf == NULL) {
log_stderr("nutcracker: configuration file '%s' syntax is invalid",
log_stderr("nutredis: configuration file '%s' syntax is invalid",
nci->conf_filename);
return false;
}

conf_destroy(cf);

log_stderr("nutcracker: configuration file '%s' syntax is ok",
log_stderr("nutredis: configuration file '%s' syntax is ok",
nci->conf_filename);
return true;
}
Expand Down Expand Up @@ -551,7 +551,7 @@ main(int argc, char **argv)
}

if (show_version) {
log_stderr("This is nutcracker-%s" CRLF, NC_VERSION_STRING);
log_stderr("This is nutredis-%s" CRLF, NC_VERSION_STRING);
if (show_help) {
nc_show_usage();
}
Expand Down
2 changes: 1 addition & 1 deletion src/nc_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ conf_create(char *filename)
return cf;

error:
log_stderr("nutcracker: configuration file '%s' syntax is invalid",
log_stderr("nutredis: configuration file '%s' syntax is invalid",
filename);
fclose(cf->fh);
cf->fh = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/nc_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ stats_create(uint16_t stats_port, char *stats_ip, int stats_interval,
st->sd = -1;

string_set_text(&st->service_str, "service");
string_set_text(&st->service, "nutcracker");
string_set_text(&st->service, "nutredis");

string_set_text(&st->source_str, "source");
string_set_raw(&st->source, source);
Expand Down

0 comments on commit 9de9e99

Please sign in to comment.