Skip to content

Redis source code files description


Redis Event Loop


Explanation of source code files

File Function
adlist.c, adlist.h Implementation of the doubly linked list data structure.
ae.c, ae.h, ae_epoll.c, ae_evport.c, Event handler and its various specific implementations.
ae_kqueue.c, ae_select.c
anet.c, anet.h Redis’s asynchronous network framework, mainly for wrapping the socket library.
aof.c Implementation of AOF function.
asciilogo.h Stores the ASCII LOGO for Redis.
bio.c, bio.h Redis’s background I/O program, used to execute I/O operations in sub-threads to reduce blocking of the main thread by I/O operations.
bitops.c Implementation file for binary bit operation commands.
blocked.c Used to implement the blocking effect of the BLPOP and WAIT commands.
cluster.c, cluster.h Implementation of Redis’s clustering.
config.c, config.h Implementation of Redis’s configuration management, responsible for reading and analyzing the configuration file, and then modifying various options of the Redis server based on these configurations.
crc16.c, crc64.c, crc64.h Calculate CRC checksum.
db.c Implementation of the database.
debug.c Implementation of debugging.
dict.c, dict.h Implementation of the dictionary data structure.
endianconv.c, endianconv.h Functions for converting binary big-endian and little-endian.
fmacros.h Some macros for portability.
help.h Command help information automatically generated by the utils/generate-command-help.rb program.
hyperloglog.c Implementation of the HyperLogLog data structure.
intset.c, intset.h Implementation of the integer set data structure, used to optimize SET type.
lzf_c.c, lzf_d.c, lzf.h, lzfP.h Implementation of the LZF compression algorithm used by Redis to compress strings and RDB files.
Makefile, Makefile.dep Build files.
memtest.c Memory test. Script used to generate release information.
multi.c Implementation of Redis’s transaction.
networking.c Redis’s client network operation library, used to implement command request reception, send command reply, etc. The functions in the file are mostly wrappers for functions such as write, read, close, as well as various protocol analysis and construction functions.
notify.c Implementation of Redis’s database notification.
object.c Implementation of Redis’s object system.
pqsort.c, pqsort.h Implementation of the quicksort algorithm.
pubsub.c Implementation of the publish and subscribe function.
rand.c, rand.h Pseudo-random number generator.
rdb.c, rdb.h Implementation of the RDB persistence function.
redisassert.h Redis’s own assertion system.
redis-benchmark.c Performance testing program for Redis.
redis.c Responsible for the start, maintenance, and shutdown of the Redis server.
redis-check-aof.c, redis-check-dump.c Programs for checking the legality of RDB files and AOF files.
redis-cli.c Implementation of Redis client.
redis.h Redis’s main header file, which records most of the data structures in Redis, including server state and client state.
redis-trib.rb Management program for Redis clustering.
release.c, release.h Record and generate release version information for Redis.
replication.c Implementation of replication function.
rio.c, rio.h Redis’s wrapper for file I/O functions, which adds explicit caching and checksum calculation on top of ordinary I/O functions.
scripting.c Implementation of scripting function.
sds.c, sds.h Implementation of the SDS data structure, which is the default string representation for Redis.
sentinel.c Implementation of Redis Sentinel.
setproctitle.c Function for setting process environment.
sha1.c, sha1.h Function for calculating SHA1 checksum.
slowlog.c, slowlog.h Implementation of the slow query function.
solarisfixes.h Patch for Solaris system.
sort.c Implementation of the SORT command.
syncio.c Synchronous I/O operation.
testhelp.h Test auxiliary macro.
t_hash.c, t_list.c, t_set.c, t_string.c, Defines various data types in Redis and their commands.
util.c, util.h Various auxiliary functions.
valgrind.sup Valgrind suppression file.
version.h Records the version number of Redis.
ziplist.c, ziplist.h Implementation of the ZIPLIST data structure, used to optimize the LIST type.
zipmap.c, zipmap.h Implementation of the ZIPMAP data structure, used to optimize the HASH type before Redis 2.6, which has been deprecated since Redis 2.6.
zmalloc.c, zmalloc.h Memory management program.


Leave a message