Skip to content

Commit de57188

Browse files
author
bluenet13
committed
fork from redis-3.0.5, init version for dpdk-redis
1 parent 63e85ce commit de57188

File tree

506 files changed

+160010
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

506 files changed

+160010
-0
lines changed

00-RELEASENOTES

+720
Large diffs are not rendered by default.

BUGS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please check https://github.com/antirez/redis/issues

CONTRIBUTING

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Note: by contributing code to the Redis project in any form, including sending
2+
a pull request via Github, a code fragment or patch via private email or
3+
public discussion groups, you agree to release your code under the terms
4+
of the BSD license that you can find in the COPYING file included in the Redis
5+
source distribution. You will include BSD license in the COPYING file within
6+
each source file that you contribute.
7+
8+
# IMPORTANT: HOW TO USE REDIS GITHUB ISSUES
9+
10+
* Github issues SHOULD ONLY BE USED to report bugs, and for DETAILED feature
11+
requests. Everything else belongs to the Redis Google Group.
12+
13+
PLEASE DO NOT POST GENERAL QUESTIONS that are not about bugs or suspected
14+
bugs in the Github issues system. We'll be very happy to help you and provide
15+
all the support in the Redis Google Group.
16+
17+
Redis Google Group address:
18+
19+
https://groups.google.com/forum/?fromgroups#!forum/redis-db
20+
21+
# How to provide a patch for a new feature
22+
23+
1. Drop a message to the Redis Google Group with a proposal of semantics/API.
24+
25+
2. If in step 1 you get an acknowledge from the project leaders, use the
26+
following procedure to submit a patch:
27+
28+
a. Fork Redis on github ( http://help.github.com/fork-a-repo/ )
29+
b. Create a topic branch (git checkout -b my_branch)
30+
c. Push to your branch (git push origin my_branch)
31+
d. Initiate a pull request on github ( http://help.github.com/send-pull-requests/ )
32+
e. Done :)
33+
34+
Thanks!

COPYING

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Copyright (c) 2006-2015, Salvatore Sanfilippo
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
* Neither the name of Redis nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9+
10+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

INSTALL

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See README

MANIFESTO

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[Note: this is the Redis manifesto, for general information about
2+
installing and running Redis read the README file instead.]
3+
4+
Redis Manifesto
5+
===============
6+
7+
1 - A DSL for Abstract Data Types. Redis is a DSL (Domain Specific Language)
8+
that manipulates abstract data types and implemented as a TCP daemon.
9+
Commands manipulate a key space where keys are binary-safe strings and
10+
values are different kinds of abstract data types. Every data type
11+
represents an abstract version of a fundamental data structure. For instance
12+
Redis Lists are an abstract representation of linked lists. In Redis, the
13+
essence of a data type isn't just the kind of operations that the data types
14+
support, but also the space and time complexity of the data type and the
15+
operations performed upon it.
16+
17+
2 - Memory storage is #1. The Redis data set, composed of defined key-value
18+
pairs, is primarily stored in the computer's memory. The amount of memory in
19+
all kinds of computers, including entry-level servers, is increasing
20+
significantly each year. Memory is fast, and allows Redis to have very
21+
predictable performance. Datasets composed of 10k or 40 millions keys will
22+
perform similarly. Complex data types like Redis Sorted Sets are easy to
23+
implement and manipulate in memory with good performance, making Redis very
24+
simple. Redis will continue to explore alternative options (where data can
25+
be optionally stored on disk, say) but the main goal of the project remains
26+
the development of an in-memory database.
27+
28+
3 - Fundamental data structures for a fundamental API. The Redis API is a direct
29+
consequence of fundamental data structures. APIs can often be arbitrary but
30+
not an API that resembles the nature of fundamental data structures. If we
31+
ever meet intelligent life forms from another part of the universe, they'll
32+
likely know, understand and recognize the same basic data structures we have
33+
in our computer science books. Redis will avoid intermediate layers in API,
34+
so that the complexity is obvious and more complex operations can be
35+
performed as the sum of the basic operations.
36+
37+
4 - Code is like a poem; it's not just something we write to reach some
38+
practical result. Sometimes people that are far from the Redis philosophy
39+
suggest using other code written by other authors (frequently in other
40+
languages) in order to implement something Redis currently lacks. But to us
41+
this is like if Shakespeare decided to end Enrico IV using the Paradiso from
42+
the Divina Commedia. Is using any external code a bad idea? Not at all. Like
43+
in "One Thousand and One Nights" smaller self contained stories are embedded
44+
in a bigger story, we'll be happy to use beautiful self contained libraries
45+
when needed. At the same time, when writing the Redis story we're trying to
46+
write smaller stories that will fit in to other code.
47+
48+
5 - We're against complexity. We believe designing systems is a fight against
49+
complexity. We'll accept to fight the complexity when it's worthwhile but
50+
we'll try hard to recognize when a small feature is not worth 1000s of lines
51+
of code. Most of the time the best way to fight complexity is by not
52+
creating it at all.
53+
54+
6 - Two levels of API. The Redis API has two levels: 1) a subset of the API fits
55+
naturally into a distributed version of Redis and 2) a more complex API that
56+
supports multi-key operations. Both are useful if used judiciously but
57+
there's no way to make the more complex multi-keys API distributed in an
58+
opaque way without violating our other principles. We don't want to provide
59+
the illusion of something that will work magically when actually it can't in
60+
all cases. Instead we'll provide commands to quickly migrate keys from one
61+
instance to another to perform multi-key operations and expose the tradeoffs
62+
to the user.
63+
64+
7 - We optimize for joy. We believe writing code is a lot of hard work, and the
65+
only way it can be worth is by enjoying it. When there is no longer joy in
66+
writing code, the best thing to do is stop. To prevent this, we'll avoid
67+
taking paths that will make Redis less of a joy to develop.

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Top level makefile, the real shit is at src/Makefile
2+
3+
default: all
4+
5+
.DEFAULT:
6+
cd src && $(MAKE) $@
7+
8+
install:
9+
cd src && $(MAKE) $@
10+
11+
.PHONY: install

README

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
Where to find complete Redis documentation?
2+
-------------------------------------------
3+
4+
This README is just a fast "quick start" document. You can find more detailed
5+
documentation at http://redis.io
6+
7+
Building Redis
8+
--------------
9+
10+
Redis can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD.
11+
We support big endian and little endian architectures.
12+
13+
It may compile on Solaris derived systems (for instance SmartOS) but our
14+
support for this platform is "best effort" and Redis is not guaranteed to
15+
work as well as in Linux, OSX, and *BSD there.
16+
17+
It is as simple as:
18+
19+
% make
20+
21+
You can run a 32 bit Redis binary using:
22+
23+
% make 32bit
24+
25+
After building Redis is a good idea to test it, using:
26+
27+
% make test
28+
29+
Fixing build problems with dependencies or cached build options
30+
—--------
31+
Redis has some dependencies which are included into the "deps" directory.
32+
"make" does not rebuild dependencies automatically, even if something in the
33+
source code of dependencies is changes.
34+
35+
When you update the source code with `git pull` or when code inside the
36+
dependencies tree is modified in any other way, make sure to use the following
37+
command in order to really clean everything and rebuild from scratch:
38+
39+
make distclean
40+
41+
This will clean: jemalloc, lua, hiredis, linenoise.
42+
43+
Also if you force certain build options like 32bit target, no C compiler
44+
optimizations (for debugging purposes), and other similar build time options,
45+
those options are cached indefinitely until you issue a "make distclean"
46+
command.
47+
48+
Fixing problems building 32 bit binaries
49+
---------
50+
51+
If after building Redis with a 32 bit target you need to rebuild it
52+
with a 64 bit target, or the other way around, you need to perform a
53+
"make distclean" in the root directory of the Redis distribution.
54+
55+
In case of build errors when trying to build a 32 bit binary of Redis, try
56+
the following steps:
57+
58+
* Install the packages libc6-dev-i386 (also try g++-multilib).
59+
* Try using the following command line instead of "make 32bit":
60+
61+
make CFLAGS="-m32 -march=native" LDFLAGS="-m32"
62+
63+
Allocator
64+
---------
65+
66+
Selecting a non-default memory allocator when building Redis is done by setting
67+
the `MALLOC` environment variable. Redis is compiled and linked against libc
68+
malloc by default, with the exception of jemalloc being the default on Linux
69+
systems. This default was picked because jemalloc has proven to have fewer
70+
fragmentation problems than libc malloc.
71+
72+
To force compiling against libc malloc, use:
73+
74+
% make MALLOC=libc
75+
76+
To compile against jemalloc on Mac OS X systems, use:
77+
78+
% make MALLOC=jemalloc
79+
80+
Verbose build
81+
-------------
82+
83+
Redis will build with a user friendly colorized output by default.
84+
If you want to see a more verbose output use the following:
85+
86+
% make V=1
87+
88+
Running Redis
89+
-------------
90+
91+
To run Redis with the default configuration just type:
92+
93+
% cd src
94+
% ./redis-server
95+
96+
If you want to provide your redis.conf, you have to run it using an additional
97+
parameter (the path of the configuration file):
98+
99+
% cd src
100+
% ./redis-server /path/to/redis.conf
101+
102+
It is possible to alter the Redis configuration passing parameters directly
103+
as options using the command line. Examples:
104+
105+
% ./redis-server --port 9999 --slaveof 127.0.0.1 6379
106+
% ./redis-server /etc/redis/6379.conf --loglevel debug
107+
108+
All the options in redis.conf are also supported as options using the command
109+
line, with exactly the same name.
110+
111+
Playing with Redis
112+
------------------
113+
114+
You can use redis-cli to play with Redis. Start a redis-server instance,
115+
then in another terminal try the following:
116+
117+
% cd src
118+
% ./redis-cli
119+
redis> ping
120+
PONG
121+
redis> set foo bar
122+
OK
123+
redis> get foo
124+
"bar"
125+
redis> incr mycounter
126+
(integer) 1
127+
redis> incr mycounter
128+
(integer) 2
129+
redis>
130+
131+
You can find the list of all the available commands here:
132+
133+
http://redis.io/commands
134+
135+
Installing Redis
136+
-----------------
137+
138+
In order to install Redis binaries into /usr/local/bin just use:
139+
140+
% make install
141+
142+
You can use "make PREFIX=/some/other/directory install" if you wish to use a
143+
different destination.
144+
145+
Make install will just install binaries in your system, but will not configure
146+
init scripts and configuration files in the appropriate place. This is not
147+
needed if you want just to play a bit with Redis, but if you are installing
148+
it the proper way for a production system, we have a script doing this
149+
for Ubuntu and Debian systems:
150+
151+
% cd utils
152+
% ./install_server.sh
153+
154+
The script will ask you a few questions and will setup everything you need
155+
to run Redis properly as a background daemon that will start again on
156+
system reboots.
157+
158+
You'll be able to stop and start Redis using the script named
159+
/etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379.
160+
161+
Code contributions
162+
---
163+
164+
Note: by contributing code to the Redis project in any form, including sending
165+
a pull request via Github, a code fragment or patch via private email or
166+
public discussion groups, you agree to release your code under the terms
167+
of the BSD license that you can find in the COPYING file included in the Redis
168+
source distribution.
169+
170+
Please see the CONTRIBUTING file in this source distribution for more
171+
information.
172+
173+
Enjoy!

deps/Makefile

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Redis dependency Makefile
2+
3+
uname_S:= $(shell sh -c 'uname -s 2>/dev/null || echo not')
4+
5+
CCCOLOR="\033[34m"
6+
LINKCOLOR="\033[34;1m"
7+
SRCCOLOR="\033[33m"
8+
BINCOLOR="\033[37;1m"
9+
MAKECOLOR="\033[32;1m"
10+
ENDCOLOR="\033[0m"
11+
12+
default:
13+
@echo "Explicit target required"
14+
15+
.PHONY: default
16+
17+
# Prerequisites target
18+
.make-prerequisites:
19+
@touch $@
20+
21+
# Clean everything when CFLAGS is different
22+
ifneq ($(shell sh -c '[ -f .make-cflags ] && cat .make-cflags || echo none'), $(CFLAGS))
23+
.make-cflags: distclean
24+
-(echo "$(CFLAGS)" > .make-cflags)
25+
.make-prerequisites: .make-cflags
26+
endif
27+
28+
# Clean everything when LDFLAGS is different
29+
ifneq ($(shell sh -c '[ -f .make-ldflags ] && cat .make-ldflags || echo none'), $(LDFLAGS))
30+
.make-ldflags: distclean
31+
-(echo "$(LDFLAGS)" > .make-ldflags)
32+
.make-prerequisites: .make-ldflags
33+
endif
34+
35+
distclean:
36+
-(cd hiredis && $(MAKE) clean) > /dev/null || true
37+
-(cd linenoise && $(MAKE) clean) > /dev/null || true
38+
-(cd lua && $(MAKE) clean) > /dev/null || true
39+
-(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true
40+
-(rm -f .make-*)
41+
42+
.PHONY: distclean
43+
44+
hiredis: .make-prerequisites
45+
@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
46+
cd hiredis && $(MAKE) static
47+
48+
.PHONY: hiredis
49+
50+
linenoise: .make-prerequisites
51+
@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
52+
cd linenoise && $(MAKE)
53+
54+
.PHONY: linenoise
55+
56+
ifeq ($(uname_S),SunOS)
57+
# Make isinf() available
58+
LUA_CFLAGS= -D__C99FEATURES__=1
59+
endif
60+
61+
LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL $(CFLAGS)
62+
LUA_LDFLAGS+= $(LDFLAGS)
63+
# lua's Makefile defines AR="ar rcu", which is unusual, and makes it more
64+
# challenging to cross-compile lua (and redis). These defines make it easier
65+
# to fit redis into cross-compilation environments, which typically set AR.
66+
AR=ar
67+
ARFLAGS=rcu
68+
69+
lua: .make-prerequisites
70+
@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
71+
cd lua/src && $(MAKE) all CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)" AR="$(AR) $(ARFLAGS)"
72+
73+
.PHONY: lua
74+
75+
JEMALLOC_CFLAGS= -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops $(CFLAGS)
76+
JEMALLOC_LDFLAGS= $(LDFLAGS)
77+
78+
jemalloc: .make-prerequisites
79+
@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
80+
cd jemalloc && ./configure --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
81+
cd jemalloc && $(MAKE) CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" lib/libjemalloc.a
82+
83+
.PHONY: jemalloc

deps/hiredis/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/hiredis-test
2+
/examples/hiredis-example*
3+
/*.o
4+
/*.so
5+
/*.dylib
6+
/*.a

0 commit comments

Comments
 (0)