├── .gitattributes
├── .gitignore
├── 00-RELEASENOTES
├── BUGS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── COPYING
├── INSTALL
├── MANIFESTO
├── Makefile
├── README.md
├── SECURITY.md
├── TLS.md
├── deps
├── Makefile
├── README.md
├── hdr_histogram
│ ├── COPYING.txt
│ ├── LICENSE.txt
│ ├── Makefile
│ ├── README.md
│ ├── hdr_atomic.h
│ ├── hdr_histogram.c
│ ├── hdr_histogram.h
│ ├── hdr_redis_malloc.h
│ └── hdr_tests.h
├── hiredis
│ ├── .github
│ │ └── workflows
│ │ │ └── build.yml
│ ├── .gitignore
│ ├── .travis.yml
│ ├── CHANGELOG.md
│ ├── CMakeLists.txt
│ ├── COPYING
│ ├── Makefile
│ ├── README.md
│ ├── adapters
│ │ ├── ae.h
│ │ ├── glib.h
│ │ ├── ivykis.h
│ │ ├── libev.h
│ │ ├── libevent.h
│ │ ├── libuv.h
│ │ ├── macosx.h
│ │ └── qt.h
│ ├── alloc.c
│ ├── alloc.h
│ ├── appveyor.yml
│ ├── async.c
│ ├── async.h
│ ├── async_private.h
│ ├── dict.c
│ ├── dict.h
│ ├── examples
│ │ ├── CMakeLists.txt
│ │ ├── example-ae.c
│ │ ├── example-glib.c
│ │ ├── example-ivykis.c
│ │ ├── example-libev.c
│ │ ├── example-libevent-ssl.c
│ │ ├── example-libevent.c
│ │ ├── example-libuv.c
│ │ ├── example-macosx.c
│ │ ├── example-push.c
│ │ ├── example-qt.cpp
│ │ ├── example-qt.h
│ │ ├── example-ssl.c
│ │ └── example.c
│ ├── fmacros.h
│ ├── fuzzing
│ │ └── format_command_fuzzer.c
│ ├── hiredis-config.cmake.in
│ ├── hiredis.c
│ ├── hiredis.h
│ ├── hiredis.pc.in
│ ├── hiredis.targets
│ ├── hiredis_ssl-config.cmake.in
│ ├── hiredis_ssl.h
│ ├── hiredis_ssl.pc.in
│ ├── net.c
│ ├── net.h
│ ├── read.c
│ ├── read.h
│ ├── sds.c
│ ├── sds.h
│ ├── sdsalloc.h
│ ├── sdscompat.h
│ ├── sockcompat.c
│ ├── sockcompat.h
│ ├── ssl.c
│ ├── test.c
│ ├── test.sh
│ └── win32.h
├── jemalloc
│ ├── .appveyor.yml
│ ├── .autom4te.cfg
│ ├── .cirrus.yml
│ ├── .gitattributes
│ ├── .gitignore
│ ├── .travis.yml
│ ├── COPYING
│ ├── ChangeLog
│ ├── INSTALL.md
│ ├── Makefile.in
│ ├── README
│ ├── TUNING.md
│ ├── VERSION
│ ├── autogen.sh
│ ├── bin
│ │ ├── jemalloc-config.in
│ │ ├── jemalloc.sh.in
│ │ └── jeprof.in
│ ├── build-aux
│ │ ├── config.guess
│ │ ├── config.sub
│ │ └── install-sh
│ ├── config.stamp.in
│ ├── configure
│ ├── configure.ac
│ ├── doc
│ │ ├── html.xsl.in
│ │ ├── jemalloc.xml.in
│ │ ├── manpages.xsl.in
│ │ └── stylesheet.xsl
│ ├── include
│ │ ├── jemalloc
│ │ │ ├── internal
│ │ │ │ ├── arena_externs.h
│ │ │ │ ├── arena_inlines_a.h
│ │ │ │ ├── arena_inlines_b.h
│ │ │ │ ├── arena_stats.h
│ │ │ │ ├── arena_structs_a.h
│ │ │ │ ├── arena_structs_b.h
│ │ │ │ ├── arena_types.h
│ │ │ │ ├── assert.h
│ │ │ │ ├── atomic.h
│ │ │ │ ├── atomic_c11.h
│ │ │ │ ├── atomic_gcc_atomic.h
│ │ │ │ ├── atomic_gcc_sync.h
│ │ │ │ ├── atomic_msvc.h
│ │ │ │ ├── background_thread_externs.h
│ │ │ │ ├── background_thread_inlines.h
│ │ │ │ ├── background_thread_structs.h
│ │ │ │ ├── base_externs.h
│ │ │ │ ├── base_inlines.h
│ │ │ │ ├── base_structs.h
│ │ │ │ ├── base_types.h
│ │ │ │ ├── bin.h
│ │ │ │ ├── bin_stats.h
│ │ │ │ ├── bin_types.h
│ │ │ │ ├── bit_util.h
│ │ │ │ ├── bitmap.h
│ │ │ │ ├── cache_bin.h
│ │ │ │ ├── ckh.h
│ │ │ │ ├── ctl.h
│ │ │ │ ├── div.h
│ │ │ │ ├── emitter.h
│ │ │ │ ├── extent_dss.h
│ │ │ │ ├── extent_externs.h
│ │ │ │ ├── extent_inlines.h
│ │ │ │ ├── extent_mmap.h
│ │ │ │ ├── extent_structs.h
│ │ │ │ ├── extent_types.h
│ │ │ │ ├── hash.h
│ │ │ │ ├── hook.h
│ │ │ │ ├── jemalloc_internal_decls.h
│ │ │ │ ├── jemalloc_internal_defs.h.in
│ │ │ │ ├── jemalloc_internal_externs.h
│ │ │ │ ├── jemalloc_internal_includes.h
│ │ │ │ ├── jemalloc_internal_inlines_a.h
│ │ │ │ ├── jemalloc_internal_inlines_b.h
│ │ │ │ ├── jemalloc_internal_inlines_c.h
│ │ │ │ ├── jemalloc_internal_macros.h
│ │ │ │ ├── jemalloc_internal_types.h
│ │ │ │ ├── jemalloc_preamble.h.in
│ │ │ │ ├── large_externs.h
│ │ │ │ ├── log.h
│ │ │ │ ├── malloc_io.h
│ │ │ │ ├── mutex.h
│ │ │ │ ├── mutex_pool.h
│ │ │ │ ├── mutex_prof.h
│ │ │ │ ├── nstime.h
│ │ │ │ ├── pages.h
│ │ │ │ ├── ph.h
│ │ │ │ ├── private_namespace.sh
│ │ │ │ ├── private_symbols.sh
│ │ │ │ ├── prng.h
│ │ │ │ ├── prof_externs.h
│ │ │ │ ├── prof_inlines_a.h
│ │ │ │ ├── prof_inlines_b.h
│ │ │ │ ├── prof_structs.h
│ │ │ │ ├── prof_types.h
│ │ │ │ ├── public_namespace.sh
│ │ │ │ ├── public_unnamespace.sh
│ │ │ │ ├── ql.h
│ │ │ │ ├── qr.h
│ │ │ │ ├── quantum.h
│ │ │ │ ├── rb.h
│ │ │ │ ├── rtree.h
│ │ │ │ ├── rtree_tsd.h
│ │ │ │ ├── safety_check.h
│ │ │ │ ├── sc.h
│ │ │ │ ├── seq.h
│ │ │ │ ├── smoothstep.h
│ │ │ │ ├── smoothstep.sh
│ │ │ │ ├── spin.h
│ │ │ │ ├── stats.h
│ │ │ │ ├── sz.h
│ │ │ │ ├── tcache_externs.h
│ │ │ │ ├── tcache_inlines.h
│ │ │ │ ├── tcache_structs.h
│ │ │ │ ├── tcache_types.h
│ │ │ │ ├── test_hooks.h
│ │ │ │ ├── ticker.h
│ │ │ │ ├── tsd.h
│ │ │ │ ├── tsd_generic.h
│ │ │ │ ├── tsd_malloc_thread_cleanup.h
│ │ │ │ ├── tsd_tls.h
│ │ │ │ ├── tsd_types.h
│ │ │ │ ├── tsd_win.h
│ │ │ │ ├── util.h
│ │ │ │ └── witness.h
│ │ │ ├── jemalloc.sh
│ │ │ ├── jemalloc_defs.h.in
│ │ │ ├── jemalloc_macros.h.in
│ │ │ ├── jemalloc_mangle.sh
│ │ │ ├── jemalloc_protos.h.in
│ │ │ ├── jemalloc_rename.sh
│ │ │ └── jemalloc_typedefs.h.in
│ │ └── msvc_compat
│ │ │ ├── C99
│ │ │ ├── stdbool.h
│ │ │ └── stdint.h
│ │ │ ├── strings.h
│ │ │ └── windows_extra.h
│ ├── jemalloc.pc.in
│ ├── m4
│ │ └── ax_cxx_compile_stdcxx.m4
│ ├── msvc
│ │ ├── ReadMe.txt
│ │ ├── jemalloc_vc2015.sln
│ │ ├── jemalloc_vc2017.sln
│ │ ├── projects
│ │ │ ├── vc2015
│ │ │ │ ├── jemalloc
│ │ │ │ │ ├── jemalloc.vcxproj
│ │ │ │ │ └── jemalloc.vcxproj.filters
│ │ │ │ └── test_threads
│ │ │ │ │ ├── test_threads.vcxproj
│ │ │ │ │ └── test_threads.vcxproj.filters
│ │ │ └── vc2017
│ │ │ │ ├── jemalloc
│ │ │ │ ├── jemalloc.vcxproj
│ │ │ │ └── jemalloc.vcxproj.filters
│ │ │ │ └── test_threads
│ │ │ │ ├── test_threads.vcxproj
│ │ │ │ └── test_threads.vcxproj.filters
│ │ └── test_threads
│ │ │ ├── test_threads.cpp
│ │ │ ├── test_threads.h
│ │ │ └── test_threads_main.cpp
│ ├── run_tests.sh
│ ├── scripts
│ │ ├── gen_run_tests.py
│ │ └── gen_travis.py
│ ├── src
│ │ ├── arena.c
│ │ ├── background_thread.c
│ │ ├── base.c
│ │ ├── bin.c
│ │ ├── bitmap.c
│ │ ├── ckh.c
│ │ ├── ctl.c
│ │ ├── div.c
│ │ ├── extent.c
│ │ ├── extent_dss.c
│ │ ├── extent_mmap.c
│ │ ├── hash.c
│ │ ├── hook.c
│ │ ├── jemalloc.c
│ │ ├── jemalloc_cpp.cpp
│ │ ├── large.c
│ │ ├── log.c
│ │ ├── malloc_io.c
│ │ ├── mutex.c
│ │ ├── mutex_pool.c
│ │ ├── nstime.c
│ │ ├── pages.c
│ │ ├── prng.c
│ │ ├── prof.c
│ │ ├── rtree.c
│ │ ├── safety_check.c
│ │ ├── sc.c
│ │ ├── stats.c
│ │ ├── sz.c
│ │ ├── tcache.c
│ │ ├── test_hooks.c
│ │ ├── ticker.c
│ │ ├── tsd.c
│ │ ├── witness.c
│ │ └── zone.c
│ └── test
│ │ ├── include
│ │ └── test
│ │ │ ├── SFMT-alti.h
│ │ │ ├── SFMT-params.h
│ │ │ ├── SFMT-params11213.h
│ │ │ ├── SFMT-params1279.h
│ │ │ ├── SFMT-params132049.h
│ │ │ ├── SFMT-params19937.h
│ │ │ ├── SFMT-params216091.h
│ │ │ ├── SFMT-params2281.h
│ │ │ ├── SFMT-params4253.h
│ │ │ ├── SFMT-params44497.h
│ │ │ ├── SFMT-params607.h
│ │ │ ├── SFMT-params86243.h
│ │ │ ├── SFMT-sse2.h
│ │ │ ├── SFMT.h
│ │ │ ├── btalloc.h
│ │ │ ├── extent_hooks.h
│ │ │ ├── jemalloc_test.h.in
│ │ │ ├── jemalloc_test_defs.h.in
│ │ │ ├── math.h
│ │ │ ├── mq.h
│ │ │ ├── mtx.h
│ │ │ ├── test.h
│ │ │ ├── thd.h
│ │ │ └── timer.h
│ │ ├── integration
│ │ ├── MALLOCX_ARENA.c
│ │ ├── aligned_alloc.c
│ │ ├── allocated.c
│ │ ├── cpp
│ │ │ └── basic.cpp
│ │ ├── extent.c
│ │ ├── extent.sh
│ │ ├── malloc.c
│ │ ├── mallocx.c
│ │ ├── mallocx.sh
│ │ ├── overflow.c
│ │ ├── posix_memalign.c
│ │ ├── rallocx.c
│ │ ├── sdallocx.c
│ │ ├── slab_sizes.c
│ │ ├── slab_sizes.sh
│ │ ├── smallocx.c
│ │ ├── smallocx.sh
│ │ ├── thread_arena.c
│ │ ├── thread_tcache_enabled.c
│ │ ├── xallocx.c
│ │ └── xallocx.sh
│ │ ├── src
│ │ ├── SFMT.c
│ │ ├── btalloc.c
│ │ ├── btalloc_0.c
│ │ ├── btalloc_1.c
│ │ ├── math.c
│ │ ├── mq.c
│ │ ├── mtx.c
│ │ ├── test.c
│ │ ├── thd.c
│ │ └── timer.c
│ │ ├── stress
│ │ ├── hookbench.c
│ │ └── microbench.c
│ │ ├── test.sh.in
│ │ └── unit
│ │ ├── SFMT.c
│ │ ├── a0.c
│ │ ├── arena_reset.c
│ │ ├── arena_reset_prof.c
│ │ ├── arena_reset_prof.sh
│ │ ├── atomic.c
│ │ ├── background_thread.c
│ │ ├── background_thread_enable.c
│ │ ├── base.c
│ │ ├── binshard.c
│ │ ├── binshard.sh
│ │ ├── bit_util.c
│ │ ├── bitmap.c
│ │ ├── ckh.c
│ │ ├── decay.c
│ │ ├── decay.sh
│ │ ├── div.c
│ │ ├── emitter.c
│ │ ├── extent_quantize.c
│ │ ├── extent_util.c
│ │ ├── fork.c
│ │ ├── hash.c
│ │ ├── hook.c
│ │ ├── huge.c
│ │ ├── junk.c
│ │ ├── junk.sh
│ │ ├── junk_alloc.c
│ │ ├── junk_alloc.sh
│ │ ├── junk_free.c
│ │ ├── junk_free.sh
│ │ ├── log.c
│ │ ├── mallctl.c
│ │ ├── malloc_io.c
│ │ ├── math.c
│ │ ├── mq.c
│ │ ├── mtx.c
│ │ ├── nstime.c
│ │ ├── pack.c
│ │ ├── pack.sh
│ │ ├── pages.c
│ │ ├── ph.c
│ │ ├── prng.c
│ │ ├── prof_accum.c
│ │ ├── prof_accum.sh
│ │ ├── prof_active.c
│ │ ├── prof_active.sh
│ │ ├── prof_gdump.c
│ │ ├── prof_gdump.sh
│ │ ├── prof_idump.c
│ │ ├── prof_idump.sh
│ │ ├── prof_log.c
│ │ ├── prof_log.sh
│ │ ├── prof_reset.c
│ │ ├── prof_reset.sh
│ │ ├── prof_tctx.c
│ │ ├── prof_tctx.sh
│ │ ├── prof_thread_name.c
│ │ ├── prof_thread_name.sh
│ │ ├── ql.c
│ │ ├── qr.c
│ │ ├── rb.c
│ │ ├── retained.c
│ │ ├── rtree.c
│ │ ├── safety_check.c
│ │ ├── safety_check.sh
│ │ ├── sc.c
│ │ ├── seq.c
│ │ ├── size_classes.c
│ │ ├── slab.c
│ │ ├── smoothstep.c
│ │ ├── spin.c
│ │ ├── stats.c
│ │ ├── stats_print.c
│ │ ├── test_hooks.c
│ │ ├── ticker.c
│ │ ├── tsd.c
│ │ ├── witness.c
│ │ ├── zero.c
│ │ └── zero.sh
├── linenoise
│ ├── .gitignore
│ ├── Makefile
│ ├── README.markdown
│ ├── example.c
│ ├── linenoise.c
│ └── linenoise.h
└── lua
│ ├── COPYRIGHT
│ ├── HISTORY
│ ├── INSTALL
│ ├── Makefile
│ ├── README
│ ├── doc
│ ├── contents.html
│ ├── cover.png
│ ├── logo.gif
│ ├── lua.1
│ ├── lua.css
│ ├── lua.html
│ ├── luac.1
│ ├── luac.html
│ ├── manual.css
│ ├── manual.html
│ └── readme.html
│ ├── etc
│ ├── Makefile
│ ├── README
│ ├── all.c
│ ├── lua.hpp
│ ├── lua.ico
│ ├── lua.pc
│ ├── luavs.bat
│ ├── min.c
│ ├── noparser.c
│ └── strict.lua
│ ├── src
│ ├── Makefile
│ ├── fpconv.c
│ ├── fpconv.h
│ ├── lapi.c
│ ├── lapi.h
│ ├── lauxlib.c
│ ├── lauxlib.h
│ ├── lbaselib.c
│ ├── lcode.c
│ ├── lcode.h
│ ├── ldblib.c
│ ├── ldebug.c
│ ├── ldebug.h
│ ├── ldo.c
│ ├── ldo.h
│ ├── ldump.c
│ ├── lfunc.c
│ ├── lfunc.h
│ ├── lgc.c
│ ├── lgc.h
│ ├── linit.c
│ ├── liolib.c
│ ├── llex.c
│ ├── llex.h
│ ├── llimits.h
│ ├── lmathlib.c
│ ├── lmem.c
│ ├── lmem.h
│ ├── loadlib.c
│ ├── lobject.c
│ ├── lobject.h
│ ├── lopcodes.c
│ ├── lopcodes.h
│ ├── loslib.c
│ ├── lparser.c
│ ├── lparser.h
│ ├── lstate.c
│ ├── lstate.h
│ ├── lstring.c
│ ├── lstring.h
│ ├── lstrlib.c
│ ├── ltable.c
│ ├── ltable.h
│ ├── ltablib.c
│ ├── ltm.c
│ ├── ltm.h
│ ├── lua.c
│ ├── lua.h
│ ├── lua_bit.c
│ ├── lua_cjson.c
│ ├── lua_cmsgpack.c
│ ├── lua_struct.c
│ ├── luac.c
│ ├── luaconf.h
│ ├── lualib.h
│ ├── lundump.c
│ ├── lundump.h
│ ├── lvm.c
│ ├── lvm.h
│ ├── lzio.c
│ ├── lzio.h
│ ├── print.c
│ ├── strbuf.c
│ └── strbuf.h
│ └── test
│ ├── README
│ ├── bisect.lua
│ ├── cf.lua
│ ├── echo.lua
│ ├── env.lua
│ ├── factorial.lua
│ ├── fib.lua
│ ├── fibfor.lua
│ ├── globals.lua
│ ├── hello.lua
│ ├── life.lua
│ ├── luac.lua
│ ├── printf.lua
│ ├── readonly.lua
│ ├── sieve.lua
│ ├── sort.lua
│ ├── table.lua
│ ├── trace-calls.lua
│ ├── trace-globals.lua
│ └── xd.lua
├── redis.conf
├── runtest
├── runtest-cluster
├── runtest-moduleapi
├── runtest-sentinel
├── sentinel.conf
├── src
├── .gitignore
├── Makefile
├── acl.c
├── adlist.c
├── adlist.h
├── ae.c
├── ae.h
├── ae_epoll.c
├── ae_evport.c
├── ae_kqueue.c
├── ae_select.c
├── anet.c
├── anet.h
├── aof.c
├── asciilogo.h
├── atomicvar.h
├── bio.c
├── bio.h
├── bitops.c
├── blocked.c
├── call_reply.c
├── call_reply.h
├── childinfo.c
├── cli_common.c
├── cli_common.h
├── cluster.c
├── cluster.h
├── commands.c
├── commands
│ ├── acl-cat.json
│ ├── acl-deluser.json
│ ├── acl-dryrun.json
│ ├── acl-genpass.json
│ ├── acl-getuser.json
│ ├── acl-help.json
│ ├── acl-list.json
│ ├── acl-load.json
│ ├── acl-log.json
│ ├── acl-save.json
│ ├── acl-setuser.json
│ ├── acl-users.json
│ ├── acl-whoami.json
│ ├── acl.json
│ ├── append.json
│ ├── asking.json
│ ├── auth.json
│ ├── bgrewriteaof.json
│ ├── bgsave.json
│ ├── bitcount.json
│ ├── bitfield.json
│ ├── bitfield_ro.json
│ ├── bitop.json
│ ├── bitpos.json
│ ├── blmove.json
│ ├── blmpop.json
│ ├── blpop.json
│ ├── brpop.json
│ ├── brpoplpush.json
│ ├── bzmpop.json
│ ├── bzpopmax.json
│ ├── bzpopmin.json
│ ├── client-caching.json
│ ├── client-getname.json
│ ├── client-getredir.json
│ ├── client-help.json
│ ├── client-id.json
│ ├── client-info.json
│ ├── client-kill.json
│ ├── client-list.json
│ ├── client-no-evict.json
│ ├── client-pause.json
│ ├── client-reply.json
│ ├── client-setname.json
│ ├── client-tracking.json
│ ├── client-trackinginfo.json
│ ├── client-unblock.json
│ ├── client-unpause.json
│ ├── client.json
│ ├── cluster-addslots.json
│ ├── cluster-addslotsrange.json
│ ├── cluster-bumpepoch.json
│ ├── cluster-count-failure-reports.json
│ ├── cluster-countkeysinslot.json
│ ├── cluster-delslots.json
│ ├── cluster-delslotsrange.json
│ ├── cluster-failover.json
│ ├── cluster-flushslots.json
│ ├── cluster-forget.json
│ ├── cluster-getkeysinslot.json
│ ├── cluster-help.json
│ ├── cluster-info.json
│ ├── cluster-keyslot.json
│ ├── cluster-links.json
│ ├── cluster-meet.json
│ ├── cluster-myid.json
│ ├── cluster-nodes.json
│ ├── cluster-replicas.json
│ ├── cluster-replicate.json
│ ├── cluster-reset.json
│ ├── cluster-saveconfig.json
│ ├── cluster-set-config-epoch.json
│ ├── cluster-setslot.json
│ ├── cluster-shards.json
│ ├── cluster-slaves.json
│ ├── cluster-slots.json
│ ├── cluster.json
│ ├── command-count.json
│ ├── command-docs.json
│ ├── command-getkeys.json
│ ├── command-getkeysandflags.json
│ ├── command-help.json
│ ├── command-info.json
│ ├── command-list.json
│ ├── command.json
│ ├── config-get.json
│ ├── config-help.json
│ ├── config-resetstat.json
│ ├── config-rewrite.json
│ ├── config-set.json
│ ├── config.json
│ ├── copy.json
│ ├── dbsize.json
│ ├── debug.json
│ ├── decr.json
│ ├── decrby.json
│ ├── del.json
│ ├── discard.json
│ ├── dump.json
│ ├── echo.json
│ ├── eval.json
│ ├── eval_ro.json
│ ├── evalsha.json
│ ├── evalsha_ro.json
│ ├── exec.json
│ ├── exists.json
│ ├── expire.json
│ ├── expireat.json
│ ├── expiretime.json
│ ├── failover.json
│ ├── fcall.json
│ ├── fcall_ro.json
│ ├── flushall.json
│ ├── flushdb.json
│ ├── function-delete.json
│ ├── function-dump.json
│ ├── function-flush.json
│ ├── function-help.json
│ ├── function-kill.json
│ ├── function-list.json
│ ├── function-load.json
│ ├── function-restore.json
│ ├── function-stats.json
│ ├── function.json
│ ├── geoadd.json
│ ├── geodist.json
│ ├── geohash.json
│ ├── geopos.json
│ ├── georadius.json
│ ├── georadius_ro.json
│ ├── georadiusbymember.json
│ ├── georadiusbymember_ro.json
│ ├── geosearch.json
│ ├── geosearchstore.json
│ ├── get.json
│ ├── getbit.json
│ ├── getdel.json
│ ├── getex.json
│ ├── getrange.json
│ ├── getset.json
│ ├── hdel.json
│ ├── hello.json
│ ├── hexists.json
│ ├── hget.json
│ ├── hgetall.json
│ ├── hincrby.json
│ ├── hincrbyfloat.json
│ ├── hkeys.json
│ ├── hlen.json
│ ├── hmget.json
│ ├── hmset.json
│ ├── hrandfield.json
│ ├── hscan.json
│ ├── hset.json
│ ├── hsetnx.json
│ ├── hstrlen.json
│ ├── hvals.json
│ ├── incr.json
│ ├── incrby.json
│ ├── incrbyfloat.json
│ ├── info.json
│ ├── keys.json
│ ├── lastsave.json
│ ├── latency-doctor.json
│ ├── latency-graph.json
│ ├── latency-help.json
│ ├── latency-histogram.json
│ ├── latency-history.json
│ ├── latency-latest.json
│ ├── latency-reset.json
│ ├── latency.json
│ ├── lcs.json
│ ├── lindex.json
│ ├── linsert.json
│ ├── llen.json
│ ├── lmove.json
│ ├── lmpop.json
│ ├── lolwut.json
│ ├── lpop.json
│ ├── lpos.json
│ ├── lpush.json
│ ├── lpushx.json
│ ├── lrange.json
│ ├── lrem.json
│ ├── lset.json
│ ├── ltrim.json
│ ├── memory-doctor.json
│ ├── memory-help.json
│ ├── memory-malloc-stats.json
│ ├── memory-purge.json
│ ├── memory-stats.json
│ ├── memory-usage.json
│ ├── memory.json
│ ├── mget.json
│ ├── migrate.json
│ ├── module-help.json
│ ├── module-list.json
│ ├── module-load.json
│ ├── module-loadex.json
│ ├── module-unload.json
│ ├── module.json
│ ├── monitor.json
│ ├── move.json
│ ├── mset.json
│ ├── msetnx.json
│ ├── multi.json
│ ├── object-encoding.json
│ ├── object-freq.json
│ ├── object-help.json
│ ├── object-idletime.json
│ ├── object-refcount.json
│ ├── object.json
│ ├── persist.json
│ ├── pexpire.json
│ ├── pexpireat.json
│ ├── pexpiretime.json
│ ├── pfadd.json
│ ├── pfcount.json
│ ├── pfdebug.json
│ ├── pfmerge.json
│ ├── pfselftest.json
│ ├── ping.json
│ ├── psetex.json
│ ├── psubscribe.json
│ ├── psync.json
│ ├── pttl.json
│ ├── publish.json
│ ├── pubsub-channels.json
│ ├── pubsub-help.json
│ ├── pubsub-numpat.json
│ ├── pubsub-numsub.json
│ ├── pubsub-shardchannels.json
│ ├── pubsub-shardnumsub.json
│ ├── pubsub.json
│ ├── punsubscribe.json
│ ├── quit.json
│ ├── randomkey.json
│ ├── readonly.json
│ ├── readwrite.json
│ ├── rename.json
│ ├── renamenx.json
│ ├── replconf.json
│ ├── replicaof.json
│ ├── reset.json
│ ├── restore-asking.json
│ ├── restore.json
│ ├── role.json
│ ├── rpop.json
│ ├── rpoplpush.json
│ ├── rpush.json
│ ├── rpushx.json
│ ├── sadd.json
│ ├── save.json
│ ├── scan.json
│ ├── scard.json
│ ├── script-debug.json
│ ├── script-exists.json
│ ├── script-flush.json
│ ├── script-help.json
│ ├── script-kill.json
│ ├── script-load.json
│ ├── script.json
│ ├── sdiff.json
│ ├── sdiffstore.json
│ ├── select.json
│ ├── sentinel-ckquorum.json
│ ├── sentinel-config.json
│ ├── sentinel-debug.json
│ ├── sentinel-failover.json
│ ├── sentinel-flushconfig.json
│ ├── sentinel-get-master-addr-by-name.json
│ ├── sentinel-help.json
│ ├── sentinel-info-cache.json
│ ├── sentinel-is-master-down-by-addr.json
│ ├── sentinel-master.json
│ ├── sentinel-masters.json
│ ├── sentinel-monitor.json
│ ├── sentinel-myid.json
│ ├── sentinel-pending-scripts.json
│ ├── sentinel-remove.json
│ ├── sentinel-replicas.json
│ ├── sentinel-reset.json
│ ├── sentinel-sentinels.json
│ ├── sentinel-set.json
│ ├── sentinel-simulate-failure.json
│ ├── sentinel-slaves.json
│ ├── sentinel.json
│ ├── set.json
│ ├── setbit.json
│ ├── setex.json
│ ├── setnx.json
│ ├── setrange.json
│ ├── shutdown.json
│ ├── sinter.json
│ ├── sintercard.json
│ ├── sinterstore.json
│ ├── sismember.json
│ ├── slaveof.json
│ ├── slowlog-get.json
│ ├── slowlog-help.json
│ ├── slowlog-len.json
│ ├── slowlog-reset.json
│ ├── slowlog.json
│ ├── smembers.json
│ ├── smismember.json
│ ├── smove.json
│ ├── sort.json
│ ├── sort_ro.json
│ ├── spop.json
│ ├── spublish.json
│ ├── srandmember.json
│ ├── srem.json
│ ├── sscan.json
│ ├── ssubscribe.json
│ ├── strlen.json
│ ├── subscribe.json
│ ├── substr.json
│ ├── sunion.json
│ ├── sunionstore.json
│ ├── sunsubscribe.json
│ ├── swapdb.json
│ ├── sync.json
│ ├── time.json
│ ├── touch.json
│ ├── ttl.json
│ ├── type.json
│ ├── unlink.json
│ ├── unsubscribe.json
│ ├── unwatch.json
│ ├── wait.json
│ ├── watch.json
│ ├── xack.json
│ ├── xadd.json
│ ├── xautoclaim.json
│ ├── xclaim.json
│ ├── xdel.json
│ ├── xgroup-create.json
│ ├── xgroup-createconsumer.json
│ ├── xgroup-delconsumer.json
│ ├── xgroup-destroy.json
│ ├── xgroup-help.json
│ ├── xgroup-setid.json
│ ├── xgroup.json
│ ├── xinfo-consumers.json
│ ├── xinfo-groups.json
│ ├── xinfo-help.json
│ ├── xinfo-stream.json
│ ├── xinfo.json
│ ├── xlen.json
│ ├── xpending.json
│ ├── xrange.json
│ ├── xread.json
│ ├── xreadgroup.json
│ ├── xrevrange.json
│ ├── xsetid.json
│ ├── xtrim.json
│ ├── zadd.json
│ ├── zcard.json
│ ├── zcount.json
│ ├── zdiff.json
│ ├── zdiffstore.json
│ ├── zincrby.json
│ ├── zinter.json
│ ├── zintercard.json
│ ├── zinterstore.json
│ ├── zlexcount.json
│ ├── zmpop.json
│ ├── zmscore.json
│ ├── zpopmax.json
│ ├── zpopmin.json
│ ├── zrandmember.json
│ ├── zrange.json
│ ├── zrangebylex.json
│ ├── zrangebyscore.json
│ ├── zrangestore.json
│ ├── zrank.json
│ ├── zrem.json
│ ├── zremrangebylex.json
│ ├── zremrangebyrank.json
│ ├── zremrangebyscore.json
│ ├── zrevrange.json
│ ├── zrevrangebylex.json
│ ├── zrevrangebyscore.json
│ ├── zrevrank.json
│ ├── zscan.json
│ ├── zscore.json
│ ├── zunion.json
│ └── zunionstore.json
├── config.c
├── config.h
├── connection.c
├── connection.h
├── connhelpers.h
├── crc16.c
├── crc16_slottable.h
├── crc64.c
├── crc64.h
├── crcspeed.c
├── crcspeed.h
├── db.c
├── debug.c
├── debugmacro.h
├── defrag.c
├── dict.c
├── dict.h
├── endianconv.c
├── endianconv.h
├── eval.c
├── evict.c
├── expire.c
├── fmacros.h
├── function_lua.c
├── functions.c
├── functions.h
├── geo.c
├── geo.h
├── geohash.c
├── geohash.h
├── geohash_helper.c
├── geohash_helper.h
├── help.h
├── hyperloglog.c
├── intset.c
├── intset.h
├── latency.c
├── latency.h
├── lazyfree.c
├── listpack.c
├── listpack.h
├── listpack_malloc.h
├── localtime.c
├── lolwut.c
├── lolwut.h
├── lolwut5.c
├── lolwut6.c
├── lzf.h
├── lzfP.h
├── lzf_c.c
├── lzf_d.c
├── memtest.c
├── mkreleasehdr.sh
├── module.c
├── modules
│ ├── .gitignore
│ ├── Makefile
│ ├── helloacl.c
│ ├── helloblock.c
│ ├── hellocluster.c
│ ├── hellodict.c
│ ├── hellohook.c
│ ├── hellotimer.c
│ ├── hellotype.c
│ └── helloworld.c
├── monotonic.c
├── monotonic.h
├── mt19937-64.c
├── mt19937-64.h
├── multi.c
├── networking.c
├── notify.c
├── object.c
├── pqsort.c
├── pqsort.h
├── pubsub.c
├── quicklist.c
├── quicklist.h
├── rand.c
├── rand.h
├── rax.c
├── rax.h
├── rax_malloc.h
├── rdb.c
├── rdb.h
├── redis-benchmark.c
├── redis-check-aof.c
├── redis-check-rdb.c
├── redis-cli.c
├── redis-trib.rb
├── redisassert.c
├── redisassert.h
├── redismodule.h
├── release.c
├── replication.c
├── resp_parser.c
├── resp_parser.h
├── rio.c
├── rio.h
├── script.c
├── script.h
├── script_lua.c
├── script_lua.h
├── sds.c
├── sds.h
├── sdsalloc.h
├── sentinel.c
├── server.c
├── server.h
├── setcpuaffinity.c
├── setproctitle.c
├── sha1.c
├── sha1.h
├── sha256.c
├── sha256.h
├── siphash.c
├── slowlog.c
├── slowlog.h
├── solarisfixes.h
├── sort.c
├── sparkline.c
├── sparkline.h
├── stream.h
├── syncio.c
├── syscheck.c
├── syscheck.h
├── t_hash.c
├── t_list.c
├── t_set.c
├── t_stream.c
├── t_string.c
├── t_zset.c
├── testhelp.h
├── timeout.c
├── tls.c
├── tracking.c
├── util.c
├── util.h
├── valgrind.sup
├── version.h
├── ziplist.c
├── ziplist.h
├── zipmap.c
├── zipmap.h
├── zmalloc.c
└── zmalloc.h
├── tests
├── README.md
├── assets
│ ├── corrupt_empty_keys.rdb
│ ├── corrupt_ziplist.rdb
│ ├── default.conf
│ ├── encodings.rdb
│ ├── hash-ziplist.rdb
│ ├── hash-zipmap.rdb
│ ├── list-quicklist.rdb
│ ├── minimal.conf
│ ├── nodefaultuser.acl
│ ├── rdb-preamble.aof
│ ├── scriptbackup.rdb
│ ├── user.acl
│ ├── userwithselectors.acl
│ └── zset-ziplist.rdb
├── cluster
│ ├── cluster.tcl
│ ├── run.tcl
│ ├── tests
│ │ ├── 00-base.tcl
│ │ ├── 01-faildet.tcl
│ │ ├── 02-failover.tcl
│ │ ├── 03-failover-loop.tcl
│ │ ├── 04-resharding.tcl
│ │ ├── 05-slave-selection.tcl
│ │ ├── 06-slave-stop-cond.tcl
│ │ ├── 07-replica-migration.tcl
│ │ ├── 08-update-msg.tcl
│ │ ├── 09-pubsub.tcl
│ │ ├── 10-manual-failover.tcl
│ │ ├── 11-manual-takeover.tcl
│ │ ├── 12-replica-migration-2.tcl
│ │ ├── 12.1-replica-migration-3.tcl
│ │ ├── 13-no-failover-option.tcl
│ │ ├── 14-consistency-check.tcl
│ │ ├── 15-cluster-slots.tcl
│ │ ├── 16-transactions-on-replica.tcl
│ │ ├── 17-diskless-load-swapdb.tcl
│ │ ├── 18-info.tcl
│ │ ├── 19-cluster-nodes-slots.tcl
│ │ ├── 20-half-migrated-slot.tcl
│ │ ├── 21-many-slot-migration.tcl
│ │ ├── 22-replica-in-sync.tcl
│ │ ├── 23-multiple-slot-operations.tcl
│ │ ├── 24-links.tcl
│ │ ├── 25-pubsubshard-slot-migration.tcl
│ │ ├── 26-pubsubshard.tcl
│ │ ├── 27-endpoints.tcl
│ │ ├── 28-cluster-shards.tcl
│ │ ├── 29-slot-migration-response.tcl
│ │ ├── helpers
│ │ │ └── onlydots.tcl
│ │ └── includes
│ │ │ ├── init-tests.tcl
│ │ │ └── utils.tcl
│ └── tmp
│ │ └── .gitignore
├── helpers
│ ├── bg_block_op.tcl
│ ├── bg_complex_data.tcl
│ ├── fake_redis_node.tcl
│ └── gen_write_load.tcl
├── instances.tcl
├── integration
│ ├── aof-multi-part.tcl
│ ├── aof-race.tcl
│ ├── aof.tcl
│ ├── block-repl.tcl
│ ├── convert-ziplist-hash-on-load.tcl
│ ├── convert-ziplist-zset-on-load.tcl
│ ├── convert-zipmap-hash-on-load.tcl
│ ├── corrupt-dump-fuzzer.tcl
│ ├── corrupt-dump.tcl
│ ├── dismiss-mem.tcl
│ ├── failover.tcl
│ ├── logging.tcl
│ ├── psync2-master-restart.tcl
│ ├── psync2-pingoff.tcl
│ ├── psync2-reg.tcl
│ ├── psync2.tcl
│ ├── rdb.tcl
│ ├── redis-benchmark.tcl
│ ├── redis-cli.tcl
│ ├── replication-2.tcl
│ ├── replication-3.tcl
│ ├── replication-4.tcl
│ ├── replication-buffer.tcl
│ ├── replication-psync.tcl
│ ├── replication.tcl
│ └── shutdown.tcl
├── modules
│ ├── Makefile
│ ├── aclcheck.c
│ ├── auth.c
│ ├── basics.c
│ ├── blockedclient.c
│ ├── blockonbackground.c
│ ├── blockonkeys.c
│ ├── cmdintrospection.c
│ ├── commandfilter.c
│ ├── datatype.c
│ ├── datatype2.c
│ ├── defragtest.c
│ ├── eventloop.c
│ ├── fork.c
│ ├── getchannels.c
│ ├── getkeys.c
│ ├── hash.c
│ ├── hooks.c
│ ├── infotest.c
│ ├── keyspace_events.c
│ ├── keyspecs.c
│ ├── list.c
│ ├── mallocsize.c
│ ├── misc.c
│ ├── moduleconfigs.c
│ ├── moduleconfigstwo.c
│ ├── propagate.c
│ ├── publish.c
│ ├── reply.c
│ ├── scan.c
│ ├── stream.c
│ ├── subcommands.c
│ ├── test_lazyfree.c
│ ├── testrdb.c
│ ├── timer.c
│ └── zset.c
├── sentinel
│ ├── run.tcl
│ ├── tests
│ │ ├── 00-base.tcl
│ │ ├── 01-conf-update.tcl
│ │ ├── 02-slaves-reconf.tcl
│ │ ├── 03-runtime-reconf.tcl
│ │ ├── 04-slave-selection.tcl
│ │ ├── 05-manual.tcl
│ │ ├── 06-ckquorum.tcl
│ │ ├── 07-down-conditions.tcl
│ │ ├── 08-hostname-conf.tcl
│ │ ├── 09-acl-support.tcl
│ │ ├── 10-replica-priority.tcl
│ │ ├── 11-port-0.tcl
│ │ ├── 12-master-reboot.tcl
│ │ ├── 13-info-command.tcl
│ │ ├── helpers
│ │ │ └── check_leaked_fds.tcl
│ │ └── includes
│ │ │ ├── init-tests.tcl
│ │ │ ├── sentinel.conf
│ │ │ ├── start-init-tests.tcl
│ │ │ └── utils.tcl
│ └── tmp
│ │ └── .gitignore
├── support
│ ├── aofmanifest.tcl
│ ├── benchmark.tcl
│ ├── cli.tcl
│ ├── cluster.tcl
│ ├── cluster_helper.tcl
│ ├── redis.tcl
│ ├── server.tcl
│ ├── test.tcl
│ ├── tmpfile.tcl
│ └── util.tcl
├── test_helper.tcl
├── tmp
│ └── .gitignore
└── unit
│ ├── acl-v2.tcl
│ ├── acl.tcl
│ ├── aofrw.tcl
│ ├── auth.tcl
│ ├── bitfield.tcl
│ ├── bitops.tcl
│ ├── client-eviction.tcl
│ ├── cluster-scripting.tcl
│ ├── cluster.tcl
│ ├── cluster
│ └── misc.tcl
│ ├── dump.tcl
│ ├── expire.tcl
│ ├── functions.tcl
│ ├── geo.tcl
│ ├── hyperloglog.tcl
│ ├── info-command.tcl
│ ├── info.tcl
│ ├── introspection-2.tcl
│ ├── introspection.tcl
│ ├── keyspace.tcl
│ ├── latency-monitor.tcl
│ ├── lazyfree.tcl
│ ├── limits.tcl
│ ├── maxmemory.tcl
│ ├── memefficiency.tcl
│ ├── moduleapi
│ ├── aclcheck.tcl
│ ├── auth.tcl
│ ├── basics.tcl
│ ├── blockedclient.tcl
│ ├── blockonbackground.tcl
│ ├── blockonkeys.tcl
│ ├── cluster.tcl
│ ├── cmdintrospection.tcl
│ ├── commandfilter.tcl
│ ├── datatype.tcl
│ ├── datatype2.tcl
│ ├── defrag.tcl
│ ├── eventloop.tcl
│ ├── fork.tcl
│ ├── getchannels.tcl
│ ├── getkeys.tcl
│ ├── hash.tcl
│ ├── hooks.tcl
│ ├── infotest.tcl
│ ├── infra.tcl
│ ├── keyspace_events.tcl
│ ├── keyspecs.tcl
│ ├── list.tcl
│ ├── mallocsize.tcl
│ ├── misc.tcl
│ ├── moduleconfigs.tcl
│ ├── propagate.tcl
│ ├── publish.tcl
│ ├── reply.tcl
│ ├── scan.tcl
│ ├── stream.tcl
│ ├── subcommands.tcl
│ ├── test_lazyfree.tcl
│ ├── testrdb.tcl
│ ├── timer.tcl
│ └── zset.tcl
│ ├── multi.tcl
│ ├── networking.tcl
│ ├── obuf-limits.tcl
│ ├── oom-score-adj.tcl
│ ├── other.tcl
│ ├── pause.tcl
│ ├── pendingquerybuf.tcl
│ ├── printver.tcl
│ ├── protocol.tcl
│ ├── pubsub.tcl
│ ├── pubsubshard.tcl
│ ├── querybuf.tcl
│ ├── quit.tcl
│ ├── replybufsize.tcl
│ ├── scan.tcl
│ ├── scripting.tcl
│ ├── shutdown.tcl
│ ├── slowlog.tcl
│ ├── sort.tcl
│ ├── tls.tcl
│ ├── tracking.tcl
│ ├── type
│ ├── hash.tcl
│ ├── incr.tcl
│ ├── list-2.tcl
│ ├── list-3.tcl
│ ├── list-common.tcl
│ ├── list.tcl
│ ├── set.tcl
│ ├── stream-cgroups.tcl
│ ├── stream.tcl
│ ├── string.tcl
│ └── zset.tcl
│ ├── violations.tcl
│ └── wait.tcl
└── utils
├── build-static-symbols.tcl
├── cluster_fail_time.tcl
├── corrupt_rdb.c
├── create-cluster
├── .gitignore
├── README
└── create-cluster
├── gen-test-certs.sh
├── generate-command-code.py
├── generate-command-help.rb
├── generate-commands-json.py
├── generate-module-api-doc.rb
├── graphs
└── commits-over-time
│ ├── README.md
│ └── genhtml.tcl
├── hyperloglog
├── .gitignore
├── hll-err.rb
└── hll-gnuplot-graph.rb
├── install_server.sh
├── lru
├── README
├── lfu-simulation.c
└── test-lru.rb
├── redis-copy.rb
├── redis-sha1.rb
├── redis_init_script
├── redis_init_script.tpl
├── releasetools
├── 01_create_tarball.sh
├── 02_upload_tarball.sh
├── 03_test_release.sh
├── 04_release_hash.sh
└── changelog.tcl
├── speed-regression.tcl
├── srandmember
├── README.md
├── showdist.rb
└── showfreq.rb
├── systemd-redis_multiple_servers@.service
├── systemd-redis_server.service
├── tracking_collisions.c
└── whatisdoing.sh
/.gitattributes:
--------------------------------------------------------------------------------
1 | # We set commands.c's merge driver to `binary` so when it conflicts during a
2 | # merge git will leave the local version unmodified. This way our Makefile
3 | # will rebuild it based on src/commands/*.json before trying to compile it.
4 | # Otherwise the file gets modified and gets the same timestamp as the .json
5 | # files. So the Makefile doesn't attempt to rebuild it before compiling.
6 | src/commands.c merge=binary
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .*.swp
2 | *.o
3 | *.xo
4 | *.so
5 | *.d
6 | *.log
7 | dump.rdb
8 | redis-benchmark
9 | redis-check-aof
10 | redis-check-rdb
11 | redis-check-dump
12 | redis-cli
13 | redis-sentinel
14 | redis-server
15 | doc-tools
16 | release
17 | misc/*
18 | src/release.h
19 | appendonly.aof*
20 | appendonlydir
21 | SHORT_TERM_TODO
22 | release.h
23 | src/transfer.sh
24 | src/configs
25 | redis.ds
26 | src/redis.conf
27 | src/nodes.conf
28 | deps/lua/src/lua
29 | deps/lua/src/luac
30 | deps/lua/src/liblua.a
31 | deps/hdr_histogram/libhdrhistogram.a
32 | tests/tls/*
33 | .make-*
34 | .prerequisites
35 | *.dSYM
36 | Makefile.dep
37 | .vscode/*
38 | .idea/*
39 | .ccls
40 | .ccls-cache/*
41 | compile_commands.json
42 | redis.code-workspace
43 |
--------------------------------------------------------------------------------
/BUGS:
--------------------------------------------------------------------------------
1 | Please check https://github.com/redis/redis/issues
2 |
--------------------------------------------------------------------------------
/INSTALL:
--------------------------------------------------------------------------------
1 | See README
2 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Top level makefile, the real shit is at src/Makefile
2 |
3 | default: all
4 |
5 | # $(MAKE) $@:递归调用子目录的 Makefile,并传递当前目标名
6 | .DEFAULT:
7 | cd src && $(MAKE) $@
8 |
9 | install:
10 | cd src && $(MAKE) $@
11 |
12 | .PHONY: install
13 |
--------------------------------------------------------------------------------
/deps/hdr_histogram/Makefile:
--------------------------------------------------------------------------------
1 | STD= -std=c99
2 | WARN= -Wall
3 | OPT= -Os
4 |
5 | R_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) -DHDR_MALLOC_INCLUDE=\"hdr_redis_malloc.h\"
6 | R_LDFLAGS= $(LDFLAGS)
7 | DEBUG= -g
8 |
9 | R_CC=$(CC) $(R_CFLAGS)
10 | R_LD=$(CC) $(R_LDFLAGS)
11 |
12 | AR= ar
13 | ARFLAGS= rcs
14 |
15 | libhdrhistogram.a: hdr_histogram.o
16 | $(AR) $(ARFLAGS) $@ $+
17 |
18 | hdr_histogram.o: hdr_histogram.h hdr_histogram.c
19 |
20 | .c.o:
21 | $(R_CC) -c $<
22 |
23 | clean:
24 | rm -f *.o
25 | rm -f *.a
26 |
27 |
28 |
--------------------------------------------------------------------------------
/deps/hdr_histogram/hdr_redis_malloc.h:
--------------------------------------------------------------------------------
1 | #ifndef HDR_MALLOC_H__
2 | #define HDR_MALLOC_H__
3 |
4 | void *zmalloc(size_t size);
5 | void *zcalloc_num(size_t num, size_t size);
6 | void *zrealloc(void *ptr, size_t size);
7 | void zfree(void *ptr);
8 |
9 | #define hdr_malloc zmalloc
10 | #define hdr_calloc zcalloc_num
11 | #define hdr_realloc zrealloc
12 | #define hdr_free zfree
13 | #endif
14 |
--------------------------------------------------------------------------------
/deps/hdr_histogram/hdr_tests.h:
--------------------------------------------------------------------------------
1 | #ifndef HDR_TESTS_H
2 | #define HDR_TESTS_H
3 |
4 | /* These are functions used in tests and are not intended for normal usage. */
5 |
6 | #include "hdr_histogram.h"
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | int32_t counts_index_for(const struct hdr_histogram* h, int64_t value);
13 | int hdr_encode_compressed(struct hdr_histogram* h, uint8_t** compressed_histogram, size_t* compressed_len);
14 | int hdr_decode_compressed(uint8_t* buffer, size_t length, struct hdr_histogram** histogram);
15 | void hdr_base64_decode_block(const char* input, uint8_t* output);
16 | void hdr_base64_encode_block(const uint8_t* input, char* output);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/deps/hiredis/.gitignore:
--------------------------------------------------------------------------------
1 | /hiredis-test
2 | /examples/hiredis-example*
3 | /*.o
4 | /*.so
5 | /*.dylib
6 | /*.a
7 | /*.pc
8 | *.dSYM
9 | tags
10 |
--------------------------------------------------------------------------------
/deps/hiredis/appveyor.yml:
--------------------------------------------------------------------------------
1 | # Appveyor configuration file for CI build of hiredis on Windows (under Cygwin)
2 | environment:
3 | matrix:
4 | - CYG_BASH: C:\cygwin64\bin\bash
5 | CC: gcc
6 | - CYG_BASH: C:\cygwin\bin\bash
7 | CC: gcc
8 | CFLAGS: -m32
9 | CXXFLAGS: -m32
10 | LDFLAGS: -m32
11 |
12 | clone_depth: 1
13 |
14 | # Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
15 | init:
16 | - git config --global core.autocrlf input
17 |
18 | # Install needed build dependencies
19 | install:
20 | - '%CYG_BASH% -lc "cygcheck -dc cygwin"'
21 |
22 | build_script:
23 | - 'echo building...'
24 | - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0
5 |
6 | class ExampleQt : public QObject {
7 |
8 | Q_OBJECT
9 |
10 | public:
11 | ExampleQt(const char * value, QObject * parent = 0)
12 | : QObject(parent), m_value(value) {}
13 |
14 | signals:
15 | void finished();
16 |
17 | public slots:
18 | void run();
19 |
20 | private:
21 | void finish() { emit finished(); }
22 |
23 | private:
24 | const char * m_value;
25 | redisAsyncContext * m_ctx;
26 | RedisQtAdapter m_adapter;
27 |
28 | friend
29 | void getCallback(redisAsyncContext *, void *, void *);
30 | };
31 |
32 | #endif /* !__HIREDIS_EXAMPLE_QT_H */
33 |
--------------------------------------------------------------------------------
/deps/hiredis/fmacros.h:
--------------------------------------------------------------------------------
1 | #ifndef __HIREDIS_FMACRO_H
2 | #define __HIREDIS_FMACRO_H
3 |
4 | #ifndef _AIX
5 | #define _XOPEN_SOURCE 600
6 | #define _POSIX_C_SOURCE 200112L
7 | #endif
8 |
9 | #if defined(__APPLE__) && defined(__MACH__)
10 | /* Enable TCP_KEEPALIVE */
11 | #define _DARWIN_C_SOURCE
12 | #endif
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/deps/hiredis/hiredis-config.cmake.in:
--------------------------------------------------------------------------------
1 | @PACKAGE_INIT@
2 |
3 | set_and_check(hiredis_INCLUDEDIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
4 |
5 | IF (NOT TARGET hiredis::hiredis)
6 | INCLUDE(${CMAKE_CURRENT_LIST_DIR}/hiredis-targets.cmake)
7 | ENDIF()
8 |
9 | SET(hiredis_LIBRARIES hiredis::hiredis)
10 | SET(hiredis_INCLUDE_DIRS ${hiredis_INCLUDEDIR})
11 |
12 | check_required_components(hiredis)
13 |
14 |
--------------------------------------------------------------------------------
/deps/hiredis/hiredis.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@CMAKE_INSTALL_PREFIX@
2 | install_libdir=@CMAKE_INSTALL_LIBDIR@
3 | exec_prefix=${prefix}
4 | libdir=${exec_prefix}/${install_libdir}
5 | includedir=${prefix}/include
6 | pkgincludedir=${includedir}/hiredis
7 |
8 | Name: hiredis
9 | Description: Minimalistic C client library for Redis.
10 | Version: @PROJECT_VERSION@
11 | Libs: -L${libdir} -lhiredis
12 | Cflags: -I${pkgincludedir} -D_FILE_OFFSET_BITS=64
13 |
--------------------------------------------------------------------------------
/deps/hiredis/hiredis.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | $(MSBuildThisFileDirectory)\..\..\include;%(AdditionalIncludeDirectories)
6 |
7 |
8 | $(MSBuildThisFileDirectory)\..\..\lib;%(AdditionalLibraryDirectories)
9 |
10 |
11 |
--------------------------------------------------------------------------------
/deps/hiredis/hiredis_ssl-config.cmake.in:
--------------------------------------------------------------------------------
1 | @PACKAGE_INIT@
2 |
3 | set_and_check(hiredis_ssl_INCLUDEDIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
4 |
5 | IF (NOT TARGET hiredis::hiredis_ssl)
6 | INCLUDE(${CMAKE_CURRENT_LIST_DIR}/hiredis_ssl-targets.cmake)
7 | ENDIF()
8 |
9 | SET(hiredis_ssl_LIBRARIES hiredis::hiredis_ssl)
10 | SET(hiredis_ssl_INCLUDE_DIRS ${hiredis_ssl_INCLUDEDIR})
11 |
12 | check_required_components(hiredis_ssl)
13 |
14 |
--------------------------------------------------------------------------------
/deps/hiredis/hiredis_ssl.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@CMAKE_INSTALL_PREFIX@
2 | exec_prefix=${prefix}
3 | libdir=${exec_prefix}/lib
4 | includedir=${prefix}/include
5 | pkgincludedir=${includedir}/hiredis
6 |
7 | Name: hiredis_ssl
8 | Description: SSL Support for hiredis.
9 | Version: @PROJECT_VERSION@
10 | Requires: hiredis
11 | Libs: -L${libdir} -lhiredis_ssl
12 | Libs.private: -lssl -lcrypto
13 |
--------------------------------------------------------------------------------
/deps/jemalloc/.autom4te.cfg:
--------------------------------------------------------------------------------
1 | begin-language: "Autoconf-without-aclocal-m4"
2 | args: --no-cache
3 | end-language: "Autoconf-without-aclocal-m4"
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/.cirrus.yml:
--------------------------------------------------------------------------------
1 | env:
2 | CIRRUS_CLONE_DEPTH: 1
3 | ARCH: amd64
4 |
5 | task:
6 | freebsd_instance:
7 | matrix:
8 | image: freebsd-12-0-release-amd64
9 | image: freebsd-11-2-release-amd64
10 | install_script:
11 | - sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf
12 | - pkg upgrade -y
13 | - pkg install -y autoconf gmake
14 | script:
15 | - autoconf
16 | #- ./configure ${COMPILER_FLAGS:+ CC="$CC $COMPILER_FLAGS" CXX="$CXX $COMPILER_FLAGS" } $CONFIGURE_FLAGS
17 | - ./configure
18 | - export JFLAG=`sysctl -n kern.smp.cpus`
19 | - gmake -j${JFLAG}
20 | - gmake -j${JFLAG} tests
21 | - gmake check
22 |
--------------------------------------------------------------------------------
/deps/jemalloc/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto eol=lf
2 |
--------------------------------------------------------------------------------
/deps/jemalloc/VERSION:
--------------------------------------------------------------------------------
1 | 5.2.1-0-g0
2 |
--------------------------------------------------------------------------------
/deps/jemalloc/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | for i in autoconf; do
4 | echo "$i"
5 | $i
6 | if [ $? -ne 0 ]; then
7 | echo "Error $? in $i"
8 | exit 1
9 | fi
10 | done
11 |
12 | echo "./configure --enable-autogen $@"
13 | ./configure --enable-autogen $@
14 | if [ $? -ne 0 ]; then
15 | echo "Error $? in ./configure"
16 | exit 1
17 | fi
18 |
--------------------------------------------------------------------------------
/deps/jemalloc/bin/jemalloc.sh.in:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | prefix=@prefix@
4 | exec_prefix=@exec_prefix@
5 | libdir=@libdir@
6 |
7 | @LD_PRELOAD_VAR@=${libdir}/libjemalloc.@SOREV@
8 | export @LD_PRELOAD_VAR@
9 | exec "$@"
10 |
--------------------------------------------------------------------------------
/deps/jemalloc/config.stamp.in:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/deps/jemalloc/config.stamp.in
--------------------------------------------------------------------------------
/deps/jemalloc/doc/html.xsl.in:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/doc/manpages.xsl.in:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/deps/jemalloc/doc/stylesheet.xsl:
--------------------------------------------------------------------------------
1 |
2 | ansi
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/arena_structs_a.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_ARENA_STRUCTS_A_H
2 | #define JEMALLOC_INTERNAL_ARENA_STRUCTS_A_H
3 |
4 | #include "jemalloc/internal/bitmap.h"
5 |
6 | struct arena_slab_data_s {
7 | /* Per region allocated/deallocated bitmap. */
8 | bitmap_t bitmap[BITMAP_GROUPS_MAX];
9 | };
10 |
11 | #endif /* JEMALLOC_INTERNAL_ARENA_STRUCTS_A_H */
12 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/base_externs.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_BASE_EXTERNS_H
2 | #define JEMALLOC_INTERNAL_BASE_EXTERNS_H
3 |
4 | extern metadata_thp_mode_t opt_metadata_thp;
5 | extern const char *metadata_thp_mode_names[];
6 |
7 | base_t *b0get(void);
8 | base_t *base_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks);
9 | void base_delete(tsdn_t *tsdn, base_t *base);
10 | extent_hooks_t *base_extent_hooks_get(base_t *base);
11 | extent_hooks_t *base_extent_hooks_set(base_t *base,
12 | extent_hooks_t *extent_hooks);
13 | void *base_alloc(tsdn_t *tsdn, base_t *base, size_t size, size_t alignment);
14 | extent_t *base_alloc_extent(tsdn_t *tsdn, base_t *base);
15 | void base_stats_get(tsdn_t *tsdn, base_t *base, size_t *allocated,
16 | size_t *resident, size_t *mapped, size_t *n_thp);
17 | void base_prefork(tsdn_t *tsdn, base_t *base);
18 | void base_postfork_parent(tsdn_t *tsdn, base_t *base);
19 | void base_postfork_child(tsdn_t *tsdn, base_t *base);
20 | bool base_boot(tsdn_t *tsdn);
21 |
22 | #endif /* JEMALLOC_INTERNAL_BASE_EXTERNS_H */
23 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/base_inlines.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_BASE_INLINES_H
2 | #define JEMALLOC_INTERNAL_BASE_INLINES_H
3 |
4 | static inline unsigned
5 | base_ind_get(const base_t *base) {
6 | return base->ind;
7 | }
8 |
9 | static inline bool
10 | metadata_thp_enabled(void) {
11 | return (opt_metadata_thp != metadata_thp_disabled);
12 | }
13 | #endif /* JEMALLOC_INTERNAL_BASE_INLINES_H */
14 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/bin_types.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_BIN_TYPES_H
2 | #define JEMALLOC_INTERNAL_BIN_TYPES_H
3 |
4 | #include "jemalloc/internal/sc.h"
5 |
6 | #define BIN_SHARDS_MAX (1 << EXTENT_BITS_BINSHARD_WIDTH)
7 | #define N_BIN_SHARDS_DEFAULT 1
8 |
9 | /* Used in TSD static initializer only. Real init in arena_bind(). */
10 | #define TSD_BINSHARDS_ZERO_INITIALIZER {{UINT8_MAX}}
11 |
12 | typedef struct tsd_binshards_s tsd_binshards_t;
13 | struct tsd_binshards_s {
14 | uint8_t binshard[SC_NBINS];
15 | };
16 |
17 | #endif /* JEMALLOC_INTERNAL_BIN_TYPES_H */
18 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/extent_dss.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_EXTENT_DSS_H
2 | #define JEMALLOC_INTERNAL_EXTENT_DSS_H
3 |
4 | typedef enum {
5 | dss_prec_disabled = 0,
6 | dss_prec_primary = 1,
7 | dss_prec_secondary = 2,
8 |
9 | dss_prec_limit = 3
10 | } dss_prec_t;
11 | #define DSS_PREC_DEFAULT dss_prec_secondary
12 | #define DSS_DEFAULT "secondary"
13 |
14 | extern const char *dss_prec_names[];
15 |
16 | extern const char *opt_dss;
17 |
18 | dss_prec_t extent_dss_prec_get(void);
19 | bool extent_dss_prec_set(dss_prec_t dss_prec);
20 | void *extent_alloc_dss(tsdn_t *tsdn, arena_t *arena, void *new_addr,
21 | size_t size, size_t alignment, bool *zero, bool *commit);
22 | bool extent_in_dss(void *addr);
23 | bool extent_dss_mergeable(void *addr_a, void *addr_b);
24 | void extent_dss_boot(void);
25 |
26 | #endif /* JEMALLOC_INTERNAL_EXTENT_DSS_H */
27 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/extent_mmap.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_EXTENT_MMAP_EXTERNS_H
2 | #define JEMALLOC_INTERNAL_EXTENT_MMAP_EXTERNS_H
3 |
4 | extern bool opt_retain;
5 |
6 | void *extent_alloc_mmap(void *new_addr, size_t size, size_t alignment,
7 | bool *zero, bool *commit);
8 | bool extent_dalloc_mmap(void *addr, size_t size);
9 |
10 | #endif /* JEMALLOC_INTERNAL_EXTENT_MMAP_EXTERNS_H */
11 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/extent_types.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_EXTENT_TYPES_H
2 | #define JEMALLOC_INTERNAL_EXTENT_TYPES_H
3 |
4 | typedef struct extent_s extent_t;
5 | typedef struct extents_s extents_t;
6 |
7 | typedef struct extent_util_stats_s extent_util_stats_t;
8 | typedef struct extent_util_stats_verbose_s extent_util_stats_verbose_t;
9 |
10 | #define EXTENT_HOOKS_INITIALIZER NULL
11 |
12 | /*
13 | * When reuse (and split) an active extent, (1U << opt_lg_extent_max_active_fit)
14 | * is the max ratio between the size of the active extent and the new extent.
15 | */
16 | #define LG_EXTENT_MAX_ACTIVE_FIT_DEFAULT 6
17 |
18 | typedef enum {
19 | EXTENT_NOT_HEAD,
20 | EXTENT_IS_HEAD /* Only relevant for Windows && opt.retain. */
21 | } extent_head_state_t;
22 |
23 | #endif /* JEMALLOC_INTERNAL_EXTENT_TYPES_H */
24 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/private_namespace.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | for symbol in `cat "$@"` ; do
4 | echo "#define ${symbol} JEMALLOC_N(${symbol})"
5 | done
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/public_namespace.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | for nm in `cat $1` ; do
4 | n=`echo ${nm} |tr ':' ' ' |awk '{print $1}'`
5 | echo "#define je_${n} JEMALLOC_N(${n})"
6 | done
7 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/public_unnamespace.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | for nm in `cat $1` ; do
4 | n=`echo ${nm} |tr ':' ' ' |awk '{print $1}'`
5 | echo "#undef je_${n}"
6 | done
7 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/safety_check.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_SAFETY_CHECK_H
2 | #define JEMALLOC_INTERNAL_SAFETY_CHECK_H
3 |
4 | void safety_check_fail(const char *format, ...);
5 | /* Can set to NULL for a default. */
6 | void safety_check_set_abort(void (*abort_fn)());
7 |
8 | JEMALLOC_ALWAYS_INLINE void
9 | safety_check_set_redzone(void *ptr, size_t usize, size_t bumped_usize) {
10 | assert(usize < bumped_usize);
11 | for (size_t i = usize; i < bumped_usize && i < usize + 32; ++i) {
12 | *((unsigned char *)ptr + i) = 0xBC;
13 | }
14 | }
15 |
16 | JEMALLOC_ALWAYS_INLINE void
17 | safety_check_verify_redzone(const void *ptr, size_t usize, size_t bumped_usize)
18 | {
19 | for (size_t i = usize; i < bumped_usize && i < usize + 32; ++i) {
20 | if (unlikely(*((unsigned char *)ptr + i) != 0xBC)) {
21 | safety_check_fail("Use after free error\n");
22 | }
23 | }
24 | }
25 |
26 | #endif /*JEMALLOC_INTERNAL_SAFETY_CHECK_H */
27 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/spin.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_SPIN_H
2 | #define JEMALLOC_INTERNAL_SPIN_H
3 |
4 | #define SPIN_INITIALIZER {0U}
5 |
6 | typedef struct {
7 | unsigned iteration;
8 | } spin_t;
9 |
10 | static inline void
11 | spin_cpu_spinwait() {
12 | # if HAVE_CPU_SPINWAIT
13 | CPU_SPINWAIT;
14 | # else
15 | volatile int x = 0;
16 | x = x;
17 | # endif
18 | }
19 |
20 | static inline void
21 | spin_adaptive(spin_t *spin) {
22 | volatile uint32_t i;
23 |
24 | if (spin->iteration < 5) {
25 | for (i = 0; i < (1U << spin->iteration); i++) {
26 | spin_cpu_spinwait();
27 | }
28 | spin->iteration++;
29 | } else {
30 | #ifdef _WIN32
31 | SwitchToThread();
32 | #else
33 | sched_yield();
34 | #endif
35 | }
36 | }
37 |
38 | #undef SPIN_INLINE
39 |
40 | #endif /* JEMALLOC_INTERNAL_SPIN_H */
41 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/test_hooks.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_TEST_HOOKS_H
2 | #define JEMALLOC_INTERNAL_TEST_HOOKS_H
3 |
4 | extern JEMALLOC_EXPORT void (*test_hooks_arena_new_hook)();
5 | extern JEMALLOC_EXPORT void (*test_hooks_libc_hook)();
6 |
7 | #define JEMALLOC_HOOK(fn, hook) ((void)(hook != NULL && (hook(), 0)), fn)
8 |
9 | #define open JEMALLOC_HOOK(open, test_hooks_libc_hook)
10 | #define read JEMALLOC_HOOK(read, test_hooks_libc_hook)
11 | #define write JEMALLOC_HOOK(write, test_hooks_libc_hook)
12 | #define readlink JEMALLOC_HOOK(readlink, test_hooks_libc_hook)
13 | #define close JEMALLOC_HOOK(close, test_hooks_libc_hook)
14 | #define creat JEMALLOC_HOOK(creat, test_hooks_libc_hook)
15 | #define secure_getenv JEMALLOC_HOOK(secure_getenv, test_hooks_libc_hook)
16 | /* Note that this is undef'd and re-define'd in src/prof.c. */
17 | #define _Unwind_Backtrace JEMALLOC_HOOK(_Unwind_Backtrace, test_hooks_libc_hook)
18 |
19 | #endif /* JEMALLOC_INTERNAL_TEST_HOOKS_H */
20 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/internal/tsd_types.h:
--------------------------------------------------------------------------------
1 | #ifndef JEMALLOC_INTERNAL_TSD_TYPES_H
2 | #define JEMALLOC_INTERNAL_TSD_TYPES_H
3 |
4 | #define MALLOC_TSD_CLEANUPS_MAX 2
5 |
6 | typedef struct tsd_s tsd_t;
7 | typedef struct tsdn_s tsdn_t;
8 | typedef bool (*malloc_tsd_cleanup_t)(void);
9 |
10 | #endif /* JEMALLOC_INTERNAL_TSD_TYPES_H */
11 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/jemalloc/jemalloc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | objroot=$1
4 |
5 | cat <
5 |
6 | /* MSVC doesn't define _Bool or bool in C, but does have BOOL */
7 | /* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
8 | /* Clang-cl uses MSVC headers, so needs msvc_compat, but has _Bool as
9 | * a built-in type. */
10 | #ifndef __clang__
11 | typedef BOOL _Bool;
12 | #endif
13 |
14 | #define bool _Bool
15 | #define true 1
16 | #define false 0
17 |
18 | #define __bool_true_false_are_defined 1
19 |
20 | #endif /* stdbool_h */
21 |
--------------------------------------------------------------------------------
/deps/jemalloc/include/msvc_compat/windows_extra.h:
--------------------------------------------------------------------------------
1 | #ifndef MSVC_COMPAT_WINDOWS_EXTRA_H
2 | #define MSVC_COMPAT_WINDOWS_EXTRA_H
3 |
4 | #include
5 |
6 | #endif /* MSVC_COMPAT_WINDOWS_EXTRA_H */
7 |
--------------------------------------------------------------------------------
/deps/jemalloc/jemalloc.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@prefix@
2 | exec_prefix=@exec_prefix@
3 | libdir=@libdir@
4 | includedir=@includedir@
5 | install_suffix=@install_suffix@
6 |
7 | Name: jemalloc
8 | Description: A general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.
9 | URL: http://jemalloc.net/
10 | Version: @jemalloc_version_major@.@jemalloc_version_minor@.@jemalloc_version_bugfix@_@jemalloc_version_nrev@
11 | Cflags: -I${includedir}
12 | Libs: -L${libdir} -ljemalloc${install_suffix}
13 |
--------------------------------------------------------------------------------
/deps/jemalloc/msvc/ReadMe.txt:
--------------------------------------------------------------------------------
1 |
2 | How to build jemalloc for Windows
3 | =================================
4 |
5 | 1. Install Cygwin with at least the following packages:
6 | * autoconf
7 | * autogen
8 | * gawk
9 | * grep
10 | * sed
11 |
12 | 2. Install Visual Studio 2015 or 2017 with Visual C++
13 |
14 | 3. Add Cygwin\bin to the PATH environment variable
15 |
16 | 4. Open "x64 Native Tools Command Prompt for VS 2017"
17 | (note: x86/x64 doesn't matter at this point)
18 |
19 | 5. Generate header files:
20 | sh -c "CC=cl ./autogen.sh"
21 |
22 | 6. Now the project can be opened and built in Visual Studio:
23 | msvc\jemalloc_vc2017.sln
24 |
--------------------------------------------------------------------------------
/deps/jemalloc/msvc/test_threads/test_threads.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | int test_threads();
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/msvc/test_threads/test_threads_main.cpp:
--------------------------------------------------------------------------------
1 | #include "test_threads.h"
2 | #include
3 | #include
4 | #include
5 |
6 | using namespace std::chrono_literals;
7 |
8 | int main(int argc, char** argv) {
9 | int rc = test_threads();
10 | return rc;
11 | }
12 |
--------------------------------------------------------------------------------
/deps/jemalloc/run_tests.sh:
--------------------------------------------------------------------------------
1 | $(dirname "$)")/scripts/gen_run_tests.py | bash
2 |
--------------------------------------------------------------------------------
/deps/jemalloc/src/hash.c:
--------------------------------------------------------------------------------
1 | #define JEMALLOC_HASH_C_
2 | #include "jemalloc/internal/jemalloc_preamble.h"
3 | #include "jemalloc/internal/jemalloc_internal_includes.h"
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/src/mutex_pool.c:
--------------------------------------------------------------------------------
1 | #define JEMALLOC_MUTEX_POOL_C_
2 |
3 | #include "jemalloc/internal/jemalloc_preamble.h"
4 | #include "jemalloc/internal/jemalloc_internal_includes.h"
5 |
6 | #include "jemalloc/internal/mutex.h"
7 | #include "jemalloc/internal/mutex_pool.h"
8 |
9 | bool
10 | mutex_pool_init(mutex_pool_t *pool, const char *name, witness_rank_t rank) {
11 | for (int i = 0; i < MUTEX_POOL_SIZE; ++i) {
12 | if (malloc_mutex_init(&pool->mutexes[i], name, rank,
13 | malloc_mutex_address_ordered)) {
14 | return true;
15 | }
16 | }
17 | return false;
18 | }
19 |
--------------------------------------------------------------------------------
/deps/jemalloc/src/prng.c:
--------------------------------------------------------------------------------
1 | #define JEMALLOC_PRNG_C_
2 | #include "jemalloc/internal/jemalloc_preamble.h"
3 | #include "jemalloc/internal/jemalloc_internal_includes.h"
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/src/safety_check.c:
--------------------------------------------------------------------------------
1 | #include "jemalloc/internal/jemalloc_preamble.h"
2 | #include "jemalloc/internal/jemalloc_internal_includes.h"
3 |
4 | static void (*safety_check_abort)(const char *message);
5 |
6 | void safety_check_set_abort(void (*abort_fn)(const char *)) {
7 | safety_check_abort = abort_fn;
8 | }
9 |
10 | void safety_check_fail(const char *format, ...) {
11 | char buf[MALLOC_PRINTF_BUFSIZE];
12 |
13 | va_list ap;
14 | va_start(ap, format);
15 | malloc_vsnprintf(buf, MALLOC_PRINTF_BUFSIZE, format, ap);
16 | va_end(ap);
17 |
18 | if (safety_check_abort == NULL) {
19 | malloc_write(buf);
20 | abort();
21 | } else {
22 | safety_check_abort(buf);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/deps/jemalloc/src/test_hooks.c:
--------------------------------------------------------------------------------
1 | #include "jemalloc/internal/jemalloc_preamble.h"
2 |
3 | /*
4 | * The hooks are a little bit screwy -- they're not genuinely exported in the
5 | * sense that we want them available to end-users, but we do want them visible
6 | * from outside the generated library, so that we can use them in test code.
7 | */
8 | JEMALLOC_EXPORT
9 | void (*test_hooks_arena_new_hook)() = NULL;
10 |
11 | JEMALLOC_EXPORT
12 | void (*test_hooks_libc_hook)() = NULL;
13 |
--------------------------------------------------------------------------------
/deps/jemalloc/src/ticker.c:
--------------------------------------------------------------------------------
1 | #define JEMALLOC_TICKER_C_
2 | #include "jemalloc/internal/jemalloc_preamble.h"
3 | #include "jemalloc/internal/jemalloc_internal_includes.h"
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/include/test/btalloc.h:
--------------------------------------------------------------------------------
1 | /* btalloc() provides a mechanism for allocating via permuted backtraces. */
2 | void *btalloc(size_t size, unsigned bits);
3 |
4 | #define btalloc_n_proto(n) \
5 | void *btalloc_##n(size_t size, unsigned bits);
6 | btalloc_n_proto(0)
7 | btalloc_n_proto(1)
8 |
9 | #define btalloc_n_gen(n) \
10 | void * \
11 | btalloc_##n(size_t size, unsigned bits) { \
12 | void *p; \
13 | \
14 | if (bits == 0) { \
15 | p = mallocx(size, 0); \
16 | } else { \
17 | switch (bits & 0x1U) { \
18 | case 0: \
19 | p = (btalloc_0(size, bits >> 1)); \
20 | break; \
21 | case 1: \
22 | p = (btalloc_1(size, bits >> 1)); \
23 | break; \
24 | default: not_reached(); \
25 | } \
26 | } \
27 | /* Intentionally sabotage tail call optimization. */ \
28 | assert_ptr_not_null(p, "Unexpected mallocx() failure"); \
29 | return p; \
30 | }
31 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/include/test/jemalloc_test_defs.h.in:
--------------------------------------------------------------------------------
1 | #include "jemalloc/internal/jemalloc_internal_defs.h"
2 | #include "jemalloc/internal/jemalloc_internal_decls.h"
3 |
4 | /*
5 | * For use by SFMT. configure.ac doesn't actually define HAVE_SSE2 because its
6 | * dependencies are notoriously unportable in practice.
7 | */
8 | #undef HAVE_SSE2
9 | #undef HAVE_ALTIVEC
10 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/include/test/mtx.h:
--------------------------------------------------------------------------------
1 | /*
2 | * mtx is a slightly simplified version of malloc_mutex. This code duplication
3 | * is unfortunate, but there are allocator bootstrapping considerations that
4 | * would leak into the test infrastructure if malloc_mutex were used directly
5 | * in tests.
6 | */
7 |
8 | typedef struct {
9 | #ifdef _WIN32
10 | CRITICAL_SECTION lock;
11 | #elif (defined(JEMALLOC_OS_UNFAIR_LOCK))
12 | os_unfair_lock lock;
13 | #else
14 | pthread_mutex_t lock;
15 | #endif
16 | } mtx_t;
17 |
18 | bool mtx_init(mtx_t *mtx);
19 | void mtx_fini(mtx_t *mtx);
20 | void mtx_lock(mtx_t *mtx);
21 | void mtx_unlock(mtx_t *mtx);
22 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/include/test/thd.h:
--------------------------------------------------------------------------------
1 | /* Abstraction layer for threading in tests. */
2 | #ifdef _WIN32
3 | typedef HANDLE thd_t;
4 | #else
5 | typedef pthread_t thd_t;
6 | #endif
7 |
8 | void thd_create(thd_t *thd, void *(*proc)(void *), void *arg);
9 | void thd_join(thd_t thd, void **ret);
10 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/include/test/timer.h:
--------------------------------------------------------------------------------
1 | /* Simple timer, for use in benchmark reporting. */
2 |
3 | typedef struct {
4 | nstime_t t0;
5 | nstime_t t1;
6 | } timedelta_t;
7 |
8 | void timer_start(timedelta_t *timer);
9 | void timer_stop(timedelta_t *timer);
10 | uint64_t timer_usec(const timedelta_t *timer);
11 | void timer_ratio(timedelta_t *a, timedelta_t *b, char *buf, size_t buflen);
12 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/integration/cpp/basic.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "test/jemalloc_test.h"
3 |
4 | TEST_BEGIN(test_basic) {
5 | auto foo = new long(4);
6 | assert_ptr_not_null(foo, "Unexpected new[] failure");
7 | delete foo;
8 | // Test nullptr handling.
9 | foo = nullptr;
10 | delete foo;
11 |
12 | auto bar = new long;
13 | assert_ptr_not_null(bar, "Unexpected new failure");
14 | delete bar;
15 | // Test nullptr handling.
16 | bar = nullptr;
17 | delete bar;
18 | }
19 | TEST_END
20 |
21 | int
22 | main() {
23 | return test(
24 | test_basic);
25 | }
26 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/integration/extent.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="junk:false"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/integration/malloc.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | TEST_BEGIN(test_zero_alloc) {
4 | void *res = malloc(0);
5 | assert(res);
6 | size_t usable = malloc_usable_size(res);
7 | assert(usable > 0);
8 | free(res);
9 | }
10 | TEST_END
11 |
12 | int
13 | main(void) {
14 | return test(
15 | test_zero_alloc);
16 | }
17 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/integration/mallocx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="junk:false"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/integration/slab_sizes.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Some screwy-looking slab sizes.
4 | export MALLOC_CONF="slab_sizes:1-4096:17|100-200:1|128-128:2"
5 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/integration/smallocx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="junk:false"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/integration/xallocx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="junk:false"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/src/btalloc.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | void *
4 | btalloc(size_t size, unsigned bits) {
5 | return btalloc_0(size, bits);
6 | }
7 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/src/btalloc_0.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | btalloc_n_gen(0)
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/src/btalloc_1.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | btalloc_n_gen(1)
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/src/math.c:
--------------------------------------------------------------------------------
1 | #define MATH_C_
2 | #include "test/jemalloc_test.h"
3 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/src/mq.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | /*
4 | * Sleep for approximately ns nanoseconds. No lower *nor* upper bound on sleep
5 | * time is guaranteed.
6 | */
7 | void
8 | mq_nanosleep(unsigned ns) {
9 | assert(ns <= 1000*1000*1000);
10 |
11 | #ifdef _WIN32
12 | Sleep(ns / 1000);
13 | #else
14 | {
15 | struct timespec timeout;
16 |
17 | if (ns < 1000*1000*1000) {
18 | timeout.tv_sec = 0;
19 | timeout.tv_nsec = ns;
20 | } else {
21 | timeout.tv_sec = 1;
22 | timeout.tv_nsec = 0;
23 | }
24 | nanosleep(&timeout, NULL);
25 | }
26 | #endif
27 | }
28 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/src/thd.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | #ifdef _WIN32
4 | void
5 | thd_create(thd_t *thd, void *(*proc)(void *), void *arg) {
6 | LPTHREAD_START_ROUTINE routine = (LPTHREAD_START_ROUTINE)proc;
7 | *thd = CreateThread(NULL, 0, routine, arg, 0, NULL);
8 | if (*thd == NULL) {
9 | test_fail("Error in CreateThread()\n");
10 | }
11 | }
12 |
13 | void
14 | thd_join(thd_t thd, void **ret) {
15 | if (WaitForSingleObject(thd, INFINITE) == WAIT_OBJECT_0 && ret) {
16 | DWORD exit_code;
17 | GetExitCodeThread(thd, (LPDWORD) &exit_code);
18 | *ret = (void *)(uintptr_t)exit_code;
19 | }
20 | }
21 |
22 | #else
23 | void
24 | thd_create(thd_t *thd, void *(*proc)(void *), void *arg) {
25 | if (pthread_create(thd, NULL, proc, arg) != 0) {
26 | test_fail("Error in pthread_create()\n");
27 | }
28 | }
29 |
30 | void
31 | thd_join(thd_t thd, void **ret) {
32 | pthread_join(thd, ret);
33 | }
34 | #endif
35 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/a0.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | TEST_BEGIN(test_a0) {
4 | void *p;
5 |
6 | p = a0malloc(1);
7 | assert_ptr_not_null(p, "Unexpected a0malloc() error");
8 | a0dalloc(p);
9 | }
10 | TEST_END
11 |
12 | int
13 | main(void) {
14 | return test_no_malloc_init(
15 | test_a0);
16 | }
17 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/arena_reset_prof.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 | #define ARENA_RESET_PROF_C_
3 |
4 | #include "arena_reset.c"
5 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/arena_reset_prof.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | export MALLOC_CONF="prof:true,lg_prof_sample:0"
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/binshard.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | export MALLOC_CONF="narenas:1,bin_shards:1-160:16|129-512:4|256-256:8"
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/decay.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | export MALLOC_CONF="dirty_decay_ms:1000,muzzy_decay_ms:1000,lg_tcache_max:0"
4 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/div.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | #include "jemalloc/internal/div.h"
4 |
5 | TEST_BEGIN(test_div_exhaustive) {
6 | for (size_t divisor = 2; divisor < 1000 * 1000; ++divisor) {
7 | div_info_t div_info;
8 | div_init(&div_info, divisor);
9 | size_t max = 1000 * divisor;
10 | if (max < 1000 * 1000) {
11 | max = 1000 * 1000;
12 | }
13 | for (size_t dividend = 0; dividend < 1000 * divisor;
14 | dividend += divisor) {
15 | size_t quotient = div_compute(
16 | &div_info, dividend);
17 | assert_zu_eq(dividend, quotient * divisor,
18 | "With divisor = %zu, dividend = %zu, "
19 | "got quotient %zu", divisor, dividend, quotient);
20 | }
21 | }
22 | }
23 | TEST_END
24 |
25 | int
26 | main(void) {
27 | return test_no_reentrancy(
28 | test_div_exhaustive);
29 | }
30 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/junk.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="abort:false,zero:false,junk:true"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/junk_alloc.c:
--------------------------------------------------------------------------------
1 | #include "junk.c"
2 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/junk_alloc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="abort:false,zero:false,junk:alloc"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/junk_free.c:
--------------------------------------------------------------------------------
1 | #include "junk.c"
2 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/junk_free.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="abort:false,zero:false,junk:free"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/pack.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Immediately purge to minimize fragmentation.
4 | export MALLOC_CONF="dirty_decay_ms:0,muzzy_decay_ms:0"
5 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/pages.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | TEST_BEGIN(test_pages_huge) {
4 | size_t alloc_size;
5 | bool commit;
6 | void *pages, *hugepage;
7 |
8 | alloc_size = HUGEPAGE * 2 - PAGE;
9 | commit = true;
10 | pages = pages_map(NULL, alloc_size, PAGE, &commit);
11 | assert_ptr_not_null(pages, "Unexpected pages_map() error");
12 |
13 | if (init_system_thp_mode == thp_mode_default) {
14 | hugepage = (void *)(ALIGNMENT_CEILING((uintptr_t)pages, HUGEPAGE));
15 | assert_b_ne(pages_huge(hugepage, HUGEPAGE), have_madvise_huge,
16 | "Unexpected pages_huge() result");
17 | assert_false(pages_nohuge(hugepage, HUGEPAGE),
18 | "Unexpected pages_nohuge() result");
19 | }
20 |
21 | pages_unmap(pages, alloc_size);
22 | }
23 | TEST_END
24 |
25 | int
26 | main(void) {
27 | return test(
28 | test_pages_huge);
29 | }
30 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_accum.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,prof_accum:true,prof_active:false,lg_prof_sample:0"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_active.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,prof_thread_active_init:false,lg_prof_sample:0"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_gdump.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,prof_active:false,prof_gdump:true"
5 | fi
6 |
7 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_idump.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | static bool did_prof_dump_open;
4 |
5 | static int
6 | prof_dump_open_intercept(bool propagate_err, const char *filename) {
7 | int fd;
8 |
9 | did_prof_dump_open = true;
10 |
11 | fd = open("/dev/null", O_WRONLY);
12 | assert_d_ne(fd, -1, "Unexpected open() failure");
13 |
14 | return fd;
15 | }
16 |
17 | TEST_BEGIN(test_idump) {
18 | bool active;
19 | void *p;
20 |
21 | test_skip_if(!config_prof);
22 |
23 | active = true;
24 | assert_d_eq(mallctl("prof.active", NULL, NULL, (void *)&active,
25 | sizeof(active)), 0,
26 | "Unexpected mallctl failure while activating profiling");
27 |
28 | prof_dump_open = prof_dump_open_intercept;
29 |
30 | did_prof_dump_open = false;
31 | p = mallocx(1, 0);
32 | assert_ptr_not_null(p, "Unexpected mallocx() failure");
33 | dallocx(p, 0);
34 | assert_true(did_prof_dump_open, "Expected a profile dump");
35 | }
36 | TEST_END
37 |
38 | int
39 | main(void) {
40 | return test(
41 | test_idump);
42 | }
43 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_idump.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | export MALLOC_CONF="tcache:false"
4 | if [ "x${enable_prof}" = "x1" ] ; then
5 | export MALLOC_CONF="${MALLOC_CONF},prof:true,prof_accum:true,prof_active:false,lg_prof_sample:0,lg_prof_interval:0"
6 | fi
7 |
8 |
9 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_log.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,lg_prof_sample:0"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_reset.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,prof_active:false,lg_prof_sample:0"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_tctx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,lg_prof_sample:0"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/prof_thread_name.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,prof_active:false"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/safety_check.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_prof}" = "x1" ] ; then
4 | export MALLOC_CONF="prof:true,lg_prof_sample:0"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/slab.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | TEST_BEGIN(test_arena_slab_regind) {
4 | szind_t binind;
5 |
6 | for (binind = 0; binind < SC_NBINS; binind++) {
7 | size_t regind;
8 | extent_t slab;
9 | const bin_info_t *bin_info = &bin_infos[binind];
10 | extent_init(&slab, NULL, mallocx(bin_info->slab_size,
11 | MALLOCX_LG_ALIGN(LG_PAGE)), bin_info->slab_size, true,
12 | binind, 0, extent_state_active, false, true, true,
13 | EXTENT_NOT_HEAD);
14 | assert_ptr_not_null(extent_addr_get(&slab),
15 | "Unexpected malloc() failure");
16 | for (regind = 0; regind < bin_info->nregs; regind++) {
17 | void *reg = (void *)((uintptr_t)extent_addr_get(&slab) +
18 | (bin_info->reg_size * regind));
19 | assert_zu_eq(arena_slab_regind(&slab, binind, reg),
20 | regind,
21 | "Incorrect region index computed for size %zu",
22 | bin_info->reg_size);
23 | }
24 | free(extent_addr_get(&slab));
25 | }
26 | }
27 | TEST_END
28 |
29 | int
30 | main(void) {
31 | return test(
32 | test_arena_slab_regind);
33 | }
34 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/spin.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | #include "jemalloc/internal/spin.h"
4 |
5 | TEST_BEGIN(test_spin) {
6 | spin_t spinner = SPIN_INITIALIZER;
7 |
8 | for (unsigned i = 0; i < 100; i++) {
9 | spin_adaptive(&spinner);
10 | }
11 | }
12 | TEST_END
13 |
14 | int
15 | main(void) {
16 | return test(
17 | test_spin);
18 | }
19 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/test_hooks.c:
--------------------------------------------------------------------------------
1 | #include "test/jemalloc_test.h"
2 |
3 | static bool hook_called = false;
4 |
5 | static void
6 | hook() {
7 | hook_called = true;
8 | }
9 |
10 | static int
11 | func_to_hook(int arg1, int arg2) {
12 | return arg1 + arg2;
13 | }
14 |
15 | #define func_to_hook JEMALLOC_HOOK(func_to_hook, test_hooks_libc_hook)
16 |
17 | TEST_BEGIN(unhooked_call) {
18 | test_hooks_libc_hook = NULL;
19 | hook_called = false;
20 | assert_d_eq(3, func_to_hook(1, 2), "Hooking changed return value.");
21 | assert_false(hook_called, "Nulling out hook didn't take.");
22 | }
23 | TEST_END
24 |
25 | TEST_BEGIN(hooked_call) {
26 | test_hooks_libc_hook = &hook;
27 | hook_called = false;
28 | assert_d_eq(3, func_to_hook(1, 2), "Hooking changed return value.");
29 | assert_true(hook_called, "Hook should have executed.");
30 | }
31 | TEST_END
32 |
33 | int
34 | main(void) {
35 | return test(
36 | unhooked_call,
37 | hooked_call);
38 | }
39 |
--------------------------------------------------------------------------------
/deps/jemalloc/test/unit/zero.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "x${enable_fill}" = "x1" ] ; then
4 | export MALLOC_CONF="abort:false,junk:false,zero:true"
5 | fi
6 |
--------------------------------------------------------------------------------
/deps/linenoise/.gitignore:
--------------------------------------------------------------------------------
1 | linenoise_example
2 | *.dSYM
3 | history.txt
4 |
--------------------------------------------------------------------------------
/deps/linenoise/Makefile:
--------------------------------------------------------------------------------
1 | STD=
2 | WARN= -Wall
3 | OPT= -Os
4 |
5 | R_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
6 | R_LDFLAGS= $(LDFLAGS)
7 | DEBUG= -g
8 |
9 | R_CC=$(CC) $(R_CFLAGS)
10 | R_LD=$(CC) $(R_LDFLAGS)
11 |
12 | linenoise.o: linenoise.h linenoise.c
13 |
14 | linenoise_example: linenoise.o example.o
15 | $(R_LD) -o $@ $^
16 |
17 | .c.o:
18 | $(R_CC) -c $<
19 |
20 | clean:
21 | rm -f linenoise_example *.o
22 |
--------------------------------------------------------------------------------
/deps/lua/doc/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/deps/lua/doc/cover.png
--------------------------------------------------------------------------------
/deps/lua/doc/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/deps/lua/doc/logo.gif
--------------------------------------------------------------------------------
/deps/lua/doc/manual.css:
--------------------------------------------------------------------------------
1 | h3 code {
2 | font-family: inherit ;
3 | font-size: inherit ;
4 | }
5 |
6 | pre, code {
7 | font-size: 12pt ;
8 | }
9 |
10 | span.apii {
11 | float: right ;
12 | font-family: inherit ;
13 | font-style: normal ;
14 | font-size: small ;
15 | color: gray ;
16 | }
17 |
18 | p+h1, ul+h1 {
19 | padding-top: 0.4em ;
20 | padding-bottom: 0.4em ;
21 | padding-left: 30px ;
22 | margin-left: -30px ;
23 | background-color: #E0E0FF ;
24 | }
25 |
--------------------------------------------------------------------------------
/deps/lua/doc/readme.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Lua documentation
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Documentation
13 |
14 |
15 | This is the documentation included in the source distribution of Lua 5.1.5.
16 |
17 |
25 |
26 | Lua's
27 | official web site
28 | contains updated documentation,
29 | especially the
30 | reference manual.
31 |
32 |
33 |
34 |
35 | Last update:
36 | Fri Feb 3 09:44:42 BRST 2012
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/deps/lua/etc/all.c:
--------------------------------------------------------------------------------
1 | /*
2 | * all.c -- Lua core, libraries and interpreter in a single file
3 | */
4 |
5 | #define luaall_c
6 |
7 | #include "lapi.c"
8 | #include "lcode.c"
9 | #include "ldebug.c"
10 | #include "ldo.c"
11 | #include "ldump.c"
12 | #include "lfunc.c"
13 | #include "lgc.c"
14 | #include "llex.c"
15 | #include "lmem.c"
16 | #include "lobject.c"
17 | #include "lopcodes.c"
18 | #include "lparser.c"
19 | #include "lstate.c"
20 | #include "lstring.c"
21 | #include "ltable.c"
22 | #include "ltm.c"
23 | #include "lundump.c"
24 | #include "lvm.c"
25 | #include "lzio.c"
26 |
27 | #include "lauxlib.c"
28 | #include "lbaselib.c"
29 | #include "ldblib.c"
30 | #include "liolib.c"
31 | #include "linit.c"
32 | #include "lmathlib.c"
33 | #include "loadlib.c"
34 | #include "loslib.c"
35 | #include "lstrlib.c"
36 | #include "ltablib.c"
37 |
38 | #include "lua.c"
39 |
--------------------------------------------------------------------------------
/deps/lua/etc/lua.hpp:
--------------------------------------------------------------------------------
1 | // lua.hpp
2 | // Lua header files for C++
3 | // <> not supplied automatically because Lua also compiles as C++
4 |
5 | extern "C" {
6 | #include "lua.h"
7 | #include "lualib.h"
8 | #include "lauxlib.h"
9 | }
10 |
--------------------------------------------------------------------------------
/deps/lua/etc/lua.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/deps/lua/etc/lua.ico
--------------------------------------------------------------------------------
/deps/lua/etc/lua.pc:
--------------------------------------------------------------------------------
1 | # lua.pc -- pkg-config data for Lua
2 |
3 | # vars from install Makefile
4 |
5 | # grep '^V=' ../Makefile
6 | V= 5.1
7 | # grep '^R=' ../Makefile
8 | R= 5.1.5
9 |
10 | # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
11 | prefix= /usr/local
12 | INSTALL_BIN= ${prefix}/bin
13 | INSTALL_INC= ${prefix}/include
14 | INSTALL_LIB= ${prefix}/lib
15 | INSTALL_MAN= ${prefix}/man/man1
16 | INSTALL_LMOD= ${prefix}/share/lua/${V}
17 | INSTALL_CMOD= ${prefix}/lib/lua/${V}
18 |
19 | # canonical vars
20 | exec_prefix=${prefix}
21 | libdir=${exec_prefix}/lib
22 | includedir=${prefix}/include
23 |
24 | Name: Lua
25 | Description: An Extensible Extension Language
26 | Version: ${R}
27 | Requires:
28 | Libs: -L${libdir} -llua -lm
29 | Cflags: -I${includedir}
30 |
31 | # (end of lua.pc)
32 |
--------------------------------------------------------------------------------
/deps/lua/etc/min.c:
--------------------------------------------------------------------------------
1 | /*
2 | * min.c -- a minimal Lua interpreter
3 | * loads stdin only with minimal error handling.
4 | * no interaction, and no standard library, only a "print" function.
5 | */
6 |
7 | #include
8 |
9 | #include "lua.h"
10 | #include "lauxlib.h"
11 |
12 | static int print(lua_State *L)
13 | {
14 | int n=lua_gettop(L);
15 | int i;
16 | for (i=1; i<=n; i++)
17 | {
18 | if (i>1) printf("\t");
19 | if (lua_isstring(L,i))
20 | printf("%s",lua_tostring(L,i));
21 | else if (lua_isnil(L,i))
22 | printf("%s","nil");
23 | else if (lua_isboolean(L,i))
24 | printf("%s",lua_toboolean(L,i) ? "true" : "false");
25 | else
26 | printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i));
27 | }
28 | printf("\n");
29 | return 0;
30 | }
31 |
32 | int main(void)
33 | {
34 | lua_State *L=lua_open();
35 | lua_register(L,"print",print);
36 | if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1));
37 | lua_close(L);
38 | return 0;
39 | }
40 |
--------------------------------------------------------------------------------
/deps/lua/src/fpconv.h:
--------------------------------------------------------------------------------
1 | /* Lua CJSON floating point conversion routines */
2 |
3 | /* Buffer required to store the largest string representation of a double.
4 | *
5 | * Longest double printed with %.14g is 21 characters long:
6 | * -1.7976931348623e+308 */
7 | # define FPCONV_G_FMT_BUFSIZE 32
8 |
9 | #ifdef USE_INTERNAL_FPCONV
10 | static inline void fpconv_init()
11 | {
12 | /* Do nothing - not required */
13 | }
14 | #else
15 | extern void fpconv_init();
16 | #endif
17 |
18 | extern int fpconv_g_fmt(char*, double, int);
19 | extern double fpconv_strtod(const char*, char**);
20 |
21 | /* vi:ai et sw=4 ts=4:
22 | */
23 |
--------------------------------------------------------------------------------
/deps/lua/src/lapi.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Auxiliary functions from Lua API
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lapi_h
8 | #define lapi_h
9 |
10 |
11 | #include "lobject.h"
12 |
13 |
14 | LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/deps/lua/src/linit.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Initialization of libraries for lua.c
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #define linit_c
9 | #define LUA_LIB
10 |
11 | #include "lua.h"
12 |
13 | #include "lualib.h"
14 | #include "lauxlib.h"
15 |
16 |
17 | static const luaL_Reg lualibs[] = {
18 | {"", luaopen_base},
19 | {LUA_LOADLIBNAME, luaopen_package},
20 | {LUA_TABLIBNAME, luaopen_table},
21 | {LUA_IOLIBNAME, luaopen_io},
22 | {LUA_OSLIBNAME, luaopen_os},
23 | {LUA_STRLIBNAME, luaopen_string},
24 | {LUA_MATHLIBNAME, luaopen_math},
25 | {LUA_DBLIBNAME, luaopen_debug},
26 | {NULL, NULL}
27 | };
28 |
29 |
30 | LUALIB_API void luaL_openlibs (lua_State *L) {
31 | const luaL_Reg *lib = lualibs;
32 | for (; lib->func; lib++) {
33 | lua_pushcfunction(L, lib->func);
34 | lua_pushstring(L, lib->name);
35 | lua_call(L, 1, 0);
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/deps/lua/src/lstring.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** String table (keep all strings handled by Lua)
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lstring_h
8 | #define lstring_h
9 |
10 |
11 | #include "lgc.h"
12 | #include "lobject.h"
13 | #include "lstate.h"
14 |
15 |
16 | #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
17 |
18 | #define sizeudata(u) (sizeof(union Udata)+(u)->len)
19 |
20 | #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
21 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
22 | (sizeof(s)/sizeof(char))-1))
23 |
24 | #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
25 |
26 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
27 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
28 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
29 |
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/deps/lua/src/lundump.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** load precompiled Lua chunks
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lundump_h
8 | #define lundump_h
9 |
10 | #include "lobject.h"
11 | #include "lzio.h"
12 |
13 | /* load one chunk; from lundump.c */
14 | LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);
15 |
16 | /* make header; from lundump.c */
17 | LUAI_FUNC void luaU_header (char* h);
18 |
19 | /* dump one chunk; from ldump.c */
20 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
21 |
22 | #ifdef luac_c
23 | /* print one chunk; from print.c */
24 | LUAI_FUNC void luaU_print (const Proto* f, int full);
25 | #endif
26 |
27 | /* for header of binary files -- this is Lua 5.1 */
28 | #define LUAC_VERSION 0x51
29 |
30 | /* for header of binary files -- this is the official format */
31 | #define LUAC_FORMAT 0
32 |
33 | /* size of header of binary files */
34 | #define LUAC_HEADERSIZE 12
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/deps/lua/test/bisect.lua:
--------------------------------------------------------------------------------
1 | -- bisection method for solving non-linear equations
2 |
3 | delta=1e-6 -- tolerance
4 |
5 | function bisect(f,a,b,fa,fb)
6 | local c=(a+b)/2
7 | io.write(n," c=",c," a=",a," b=",b,"\n")
8 | if c==a or c==b or math.abs(a-b)>> ",string.rep(" ",level))
9 | if t~=nil and t.currentline>=0 then io.write(t.short_src,":",t.currentline," ") end
10 | t=debug.getinfo(2)
11 | if event=="call" then
12 | level=level+1
13 | else
14 | level=level-1 if level<0 then level=0 end
15 | end
16 | if t.what=="main" then
17 | if event=="call" then
18 | io.write("begin ",t.short_src)
19 | else
20 | io.write("end ",t.short_src)
21 | end
22 | elseif t.what=="Lua" then
23 | -- table.foreach(t,print)
24 | io.write(event," ",t.name or "(Lua)"," <",t.linedefined,":",t.short_src,">")
25 | else
26 | io.write(event," ",t.name or "(C)"," [",t.what,"] ")
27 | end
28 | io.write("\n")
29 | end
30 |
31 | debug.sethook(hook,"cr")
32 | level=0
33 |
--------------------------------------------------------------------------------
/deps/lua/test/trace-globals.lua:
--------------------------------------------------------------------------------
1 | -- trace assigments to global variables
2 |
3 | do
4 | -- a tostring that quotes strings. note the use of the original tostring.
5 | local _tostring=tostring
6 | local tostring=function(a)
7 | if type(a)=="string" then
8 | return string.format("%q",a)
9 | else
10 | return _tostring(a)
11 | end
12 | end
13 |
14 | local log=function (name,old,new)
15 | local t=debug.getinfo(3,"Sl")
16 | local line=t.currentline
17 | io.write(t.short_src)
18 | if line>=0 then io.write(":",line) end
19 | io.write(": ",name," is now ",tostring(new)," (was ",tostring(old),")","\n")
20 | end
21 |
22 | local g={}
23 | local set=function (t,name,value)
24 | log(name,g[name],value)
25 | g[name]=value
26 | end
27 | setmetatable(getfenv(),{__index=g,__newindex=set})
28 | end
29 |
30 | -- an example
31 |
32 | a=1
33 | b=2
34 | a=10
35 | b=20
36 | b=nil
37 | b=200
38 | print(a,b,c)
39 |
--------------------------------------------------------------------------------
/deps/lua/test/xd.lua:
--------------------------------------------------------------------------------
1 | -- hex dump
2 | -- usage: lua xd.lua < file
3 |
4 | local offset=0
5 | while true do
6 | local s=io.read(16)
7 | if s==nil then return end
8 | io.write(string.format("%08X ",offset))
9 | string.gsub(s,"(.)",
10 | function (c) io.write(string.format("%02X ",string.byte(c))) end)
11 | io.write(string.rep(" ",3*(16-string.len(s))))
12 | io.write(" ",string.gsub(s,"%c","."),"\n")
13 | offset=offset+16
14 | end
15 |
--------------------------------------------------------------------------------
/runtest:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | TCL_VERSIONS="8.5 8.6 8.7"
3 | TCLSH=""
4 |
5 | for VERSION in $TCL_VERSIONS; do
6 | TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
7 | done
8 |
9 | if [ -z $TCLSH ]
10 | then
11 | echo "You need tcl 8.5 or newer in order to run the Redis test"
12 | exit 1
13 | fi
14 | $TCLSH tests/test_helper.tcl "${@}"
15 |
--------------------------------------------------------------------------------
/runtest-cluster:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | TCL_VERSIONS="8.5 8.6 8.7"
3 | TCLSH=""
4 |
5 | for VERSION in $TCL_VERSIONS; do
6 | TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
7 | done
8 |
9 | if [ -z $TCLSH ]
10 | then
11 | echo "You need tcl 8.5 or newer in order to run the Redis Cluster test"
12 | exit 1
13 | fi
14 | $TCLSH tests/cluster/run.tcl $*
15 |
--------------------------------------------------------------------------------
/runtest-sentinel:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | TCL_VERSIONS="8.5 8.6 8.7"
3 | TCLSH=""
4 |
5 | for VERSION in $TCL_VERSIONS; do
6 | TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
7 | done
8 |
9 | if [ -z $TCLSH ]
10 | then
11 | echo "You need tcl 8.5 or newer in order to run the Redis Sentinel test"
12 | exit 1
13 | fi
14 | $TCLSH tests/sentinel/run.tcl $*
15 |
--------------------------------------------------------------------------------
/src/.gitignore:
--------------------------------------------------------------------------------
1 | *.gcda
2 | *.gcno
3 | *.gcov
4 | redis.info
5 | lcov-html
6 |
--------------------------------------------------------------------------------
/src/commands/acl-cat.json:
--------------------------------------------------------------------------------
1 | {
2 | "CAT": {
3 | "summary": "List the ACL categories or the commands inside a category",
4 | "complexity": "O(1) since the categories and commands are a fixed set.",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": -2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "categoryname",
19 | "type": "string",
20 | "optional": true
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/acl-deluser.json:
--------------------------------------------------------------------------------
1 | {
2 | "DELUSER": {
3 | "summary": "Remove the specified ACL users and the associated rules",
4 | "complexity": "O(1) amortized time considering the typical user.",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": -3,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE",
15 | "SENTINEL"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "username",
20 | "type": "string",
21 | "multiple": true
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/commands/acl-dryrun.json:
--------------------------------------------------------------------------------
1 | {
2 | "DRYRUN": {
3 | "summary": "Returns whether the user can execute the given command without executing the command.",
4 | "complexity": "O(1).",
5 | "group": "server",
6 | "since": "7.0.0",
7 | "arity": -4,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "history": [],
11 | "command_flags": [
12 | "ADMIN",
13 | "NOSCRIPT",
14 | "LOADING",
15 | "STALE",
16 | "SENTINEL"
17 | ],
18 | "arguments": [
19 | {
20 | "name": "username",
21 | "type": "string"
22 | },
23 | {
24 | "name": "command",
25 | "type": "string"
26 | },
27 | {
28 | "name": "arg",
29 | "type": "string",
30 | "optional": true,
31 | "multiple": true
32 | }
33 | ]
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/commands/acl-genpass.json:
--------------------------------------------------------------------------------
1 | {
2 | "GENPASS": {
3 | "summary": "Generate a pseudorandom secure password to use for ACL users",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": -2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "bits",
19 | "type": "integer",
20 | "optional": true
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/acl-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": 2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/acl-list.json:
--------------------------------------------------------------------------------
1 | {
2 | "LIST": {
3 | "summary": "List the current ACL rules in ACL config file format",
4 | "complexity": "O(N). Where N is the number of configured users.",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": 2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE",
15 | "SENTINEL"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/acl-load.json:
--------------------------------------------------------------------------------
1 | {
2 | "LOAD": {
3 | "summary": "Reload the ACLs from the configured ACL file",
4 | "complexity": "O(N). Where N is the number of configured users.",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": 2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE",
15 | "SENTINEL"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/acl-save.json:
--------------------------------------------------------------------------------
1 | {
2 | "SAVE": {
3 | "summary": "Save the current ACL rules in the configured ACL file",
4 | "complexity": "O(N). Where N is the number of configured users.",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": 2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE",
15 | "SENTINEL"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/acl-users.json:
--------------------------------------------------------------------------------
1 | {
2 | "USERS": {
3 | "summary": "List the username of all the configured ACL rules",
4 | "complexity": "O(N). Where N is the number of configured users.",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": 2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE",
15 | "SENTINEL"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/acl-whoami.json:
--------------------------------------------------------------------------------
1 | {
2 | "WHOAMI": {
3 | "summary": "Return the name of the user associated to the current connection",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": 2,
8 | "container": "ACL",
9 | "function": "aclCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/acl.json:
--------------------------------------------------------------------------------
1 | {
2 | "ACL": {
3 | "summary": "A container for Access List Control commands ",
4 | "complexity": "Depends on subcommand.",
5 | "group": "server",
6 | "since": "6.0.0",
7 | "arity": -2,
8 | "command_flags": [
9 | "SENTINEL"
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/commands/asking.json:
--------------------------------------------------------------------------------
1 | {
2 | "ASKING": {
3 | "summary": "Sent by cluster clients after an -ASK redirect",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 1,
8 | "function": "askingCommand",
9 | "command_flags": [
10 | "FAST"
11 | ],
12 | "acl_categories": [
13 | "CONNECTION"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/bgrewriteaof.json:
--------------------------------------------------------------------------------
1 | {
2 | "BGREWRITEAOF": {
3 | "summary": "Asynchronously rewrite the append-only file",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": 1,
8 | "function": "bgrewriteaofCommand",
9 | "command_flags": [
10 | "NO_ASYNC_LOADING",
11 | "ADMIN",
12 | "NOSCRIPT"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/bgsave.json:
--------------------------------------------------------------------------------
1 | {
2 | "BGSAVE": {
3 | "summary": "Asynchronously save the dataset to disk",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": -1,
8 | "function": "bgsaveCommand",
9 | "history": [
10 | [
11 | "3.2.2",
12 | "Added the `SCHEDULE` option."
13 | ]
14 | ],
15 | "command_flags": [
16 | "NO_ASYNC_LOADING",
17 | "ADMIN",
18 | "NOSCRIPT"
19 | ],
20 | "arguments": [
21 | {
22 | "name": "schedule",
23 | "token": "SCHEDULE",
24 | "type": "pure-token",
25 | "optional": true,
26 | "since": "3.2.2"
27 | }
28 | ]
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/commands/client-getname.json:
--------------------------------------------------------------------------------
1 | {
2 | "GETNAME": {
3 | "summary": "Get the current connection name",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "2.6.9",
7 | "arity": 2,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "acl_categories": [
17 | "CONNECTION"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/client-getredir.json:
--------------------------------------------------------------------------------
1 | {
2 | "GETREDIR": {
3 | "summary": "Get tracking notifications redirection client ID if any",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "6.0.0",
7 | "arity": 2,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "acl_categories": [
17 | "CONNECTION"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/client-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL"
14 | ],
15 | "acl_categories": [
16 | "CONNECTION"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/client-id.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": {
3 | "summary": "Returns the client ID for the current connection",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "acl_categories": [
17 | "CONNECTION"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/client-info.json:
--------------------------------------------------------------------------------
1 | {
2 | "INFO": {
3 | "summary": "Returns information about the current client connection.",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "acl_categories": [
17 | "CONNECTION"
18 | ],
19 | "command_tips": [
20 | "NONDETERMINISTIC_OUTPUT"
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/client-setname.json:
--------------------------------------------------------------------------------
1 | {
2 | "SETNAME": {
3 | "summary": "Set the current connection name",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "2.6.9",
7 | "arity": 3,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "acl_categories": [
17 | "CONNECTION"
18 | ],
19 | "arguments": [
20 | {
21 | "name": "connection-name",
22 | "type": "string"
23 | }
24 | ]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/commands/client-trackinginfo.json:
--------------------------------------------------------------------------------
1 | {
2 | "TRACKINGINFO": {
3 | "summary": "Return information about server assisted client side caching for the current connection",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "acl_categories": [
17 | "CONNECTION"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/client-unpause.json:
--------------------------------------------------------------------------------
1 | {
2 | "UNPAUSE": {
3 | "summary": "Resume processing of clients that were paused",
4 | "complexity": "O(N) Where N is the number of paused clients",
5 | "group": "connection",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "CLIENT",
9 | "function": "clientCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE",
15 | "SENTINEL"
16 | ],
17 | "acl_categories": [
18 | "CONNECTION"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/client.json:
--------------------------------------------------------------------------------
1 | {
2 | "CLIENT": {
3 | "summary": "A container for client connection commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "connection",
6 | "since": "2.4.0",
7 | "arity": -2,
8 | "command_flags": [
9 | "SENTINEL"
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/commands/cluster-addslots.json:
--------------------------------------------------------------------------------
1 | {
2 | "ADDSLOTS": {
3 | "summary": "Assign new hash slots to receiving node",
4 | "complexity": "O(N) where N is the total number of hash slot arguments",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": -3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "slot",
18 | "type": "integer",
19 | "multiple": true
20 | }
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/cluster-bumpepoch.json:
--------------------------------------------------------------------------------
1 | {
2 | "BUMPEPOCH": {
3 | "summary": "Advance the cluster config epoch",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ],
15 | "command_tips": [
16 | "NONDETERMINISTIC_OUTPUT"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/cluster-count-failure-reports.json:
--------------------------------------------------------------------------------
1 | {
2 | "COUNT-FAILURE-REPORTS": {
3 | "summary": "Return the number of failure reports active for a given node",
4 | "complexity": "O(N) where N is the number of failure reports",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "STALE"
13 | ],
14 | "command_tips": [
15 | "NONDETERMINISTIC_OUTPUT"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "node-id",
20 | "type": "string"
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/cluster-countkeysinslot.json:
--------------------------------------------------------------------------------
1 | {
2 | "COUNTKEYSINSLOT": {
3 | "summary": "Return the number of local keys in the specified hash slot",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "STALE"
12 | ],
13 | "arguments": [
14 | {
15 | "name": "slot",
16 | "type": "integer"
17 | }
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/cluster-delslots.json:
--------------------------------------------------------------------------------
1 | {
2 | "DELSLOTS": {
3 | "summary": "Set hash slots as unbound in receiving node",
4 | "complexity": "O(N) where N is the total number of hash slot arguments",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": -3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "slot",
18 | "type": "integer",
19 | "multiple": true
20 | }
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/cluster-flushslots.json:
--------------------------------------------------------------------------------
1 | {
2 | "FLUSHSLOTS": {
3 | "summary": "Delete a node's own slots information",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/cluster-forget.json:
--------------------------------------------------------------------------------
1 | {
2 | "FORGET": {
3 | "summary": "Remove a node from the nodes table",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "node-id",
18 | "type": "string"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/cluster-getkeysinslot.json:
--------------------------------------------------------------------------------
1 | {
2 | "GETKEYSINSLOT": {
3 | "summary": "Return local key names in the specified hash slot",
4 | "complexity": "O(log(N)) where N is the number of requested keys",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 4,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "STALE"
12 | ],
13 | "command_tips": [
14 | "NONDETERMINISTIC_OUTPUT"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "slot",
19 | "type": "integer"
20 | },
21 | {
22 | "name": "count",
23 | "type": "integer"
24 | }
25 | ]
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/commands/cluster-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/cluster-info.json:
--------------------------------------------------------------------------------
1 | {
2 | "INFO": {
3 | "summary": "Provides info about Redis Cluster node state",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "STALE"
12 | ],
13 | "command_tips": [
14 | "NONDETERMINISTIC_OUTPUT"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/cluster-keyslot.json:
--------------------------------------------------------------------------------
1 | {
2 | "KEYSLOT": {
3 | "summary": "Returns the hash slot of the specified key",
4 | "complexity": "O(N) where N is the number of bytes in the key",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "STALE"
12 | ],
13 | "arguments": [
14 | {
15 | "name": "key",
16 | "type": "string"
17 | }
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/cluster-links.json:
--------------------------------------------------------------------------------
1 | {
2 | "LINKS": {
3 | "summary": "Returns a list of all TCP links to and from peer nodes in cluster",
4 | "complexity": "O(N) where N is the total number of Cluster nodes",
5 | "group": "cluster",
6 | "since": "7.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "STALE"
12 | ],
13 | "command_tips": [
14 | "NONDETERMINISTIC_OUTPUT"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/cluster-myid.json:
--------------------------------------------------------------------------------
1 | {
2 | "MYID": {
3 | "summary": "Return the node id",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "STALE"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/commands/cluster-nodes.json:
--------------------------------------------------------------------------------
1 | {
2 | "NODES": {
3 | "summary": "Get Cluster config for the node",
4 | "complexity": "O(N) where N is the total number of Cluster nodes",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "STALE"
12 | ],
13 | "command_tips": [
14 | "NONDETERMINISTIC_OUTPUT"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/cluster-replicas.json:
--------------------------------------------------------------------------------
1 | {
2 | "REPLICAS": {
3 | "summary": "List replica nodes of the specified master node",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "5.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "STALE"
13 | ],
14 | "command_tips": [
15 | "NONDETERMINISTIC_OUTPUT"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "node-id",
20 | "type": "string"
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/cluster-replicate.json:
--------------------------------------------------------------------------------
1 | {
2 | "REPLICATE": {
3 | "summary": "Reconfigure a node as a replica of the specified master node",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "node-id",
18 | "type": "string"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/cluster-saveconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "SAVECONFIG": {
3 | "summary": "Forces the node to save cluster state on disk",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/cluster-set-config-epoch.json:
--------------------------------------------------------------------------------
1 | {
2 | "SET-CONFIG-EPOCH": {
3 | "summary": "Set the configuration epoch in a new node",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "config-epoch",
18 | "type": "integer"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/cluster-shards.json:
--------------------------------------------------------------------------------
1 | {
2 | "SHARDS": {
3 | "summary": "Get array of cluster slots to node mappings",
4 | "complexity": "O(N) where N is the total number of cluster nodes",
5 | "group": "cluster",
6 | "since": "7.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "history": [],
11 | "command_flags": [
12 | "STALE"
13 | ],
14 | "command_tips": [
15 | "NONDETERMINISTIC_OUTPUT"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/cluster-slaves.json:
--------------------------------------------------------------------------------
1 | {
2 | "SLAVES": {
3 | "summary": "List replica nodes of the specified master node",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "deprecated_since": "5.0.0",
11 | "replaced_by": "`CLUSTER REPLICAS`",
12 | "doc_flags": [
13 | "DEPRECATED"
14 | ],
15 | "command_flags": [
16 | "ADMIN",
17 | "STALE"
18 | ],
19 | "command_tips": [
20 | "NONDETERMINISTIC_OUTPUT"
21 | ],
22 | "arguments": [
23 | {
24 | "name": "node-id",
25 | "type": "string"
26 | }
27 | ]
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/commands/cluster-slots.json:
--------------------------------------------------------------------------------
1 | {
2 | "SLOTS": {
3 | "summary": "Get array of Cluster slot to node mappings",
4 | "complexity": "O(N) where N is the total number of Cluster nodes",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 2,
8 | "container": "CLUSTER",
9 | "function": "clusterCommand",
10 | "deprecated_since": "7.0.0",
11 | "replaced_by": "`CLUSTER SHARDS`",
12 | "doc_flags": [
13 | "DEPRECATED"
14 | ],
15 | "history": [
16 | [
17 | "4.0.0",
18 | "Added node IDs."
19 | ],
20 | [
21 | "7.0.0",
22 | "Added additional networking metadata field."
23 | ]
24 | ],
25 | "command_flags": [
26 | "STALE"
27 | ],
28 | "command_tips": [
29 | "NONDETERMINISTIC_OUTPUT"
30 | ]
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/commands/cluster.json:
--------------------------------------------------------------------------------
1 | {
2 | "CLUSTER": {
3 | "summary": "A container for cluster commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/command-count.json:
--------------------------------------------------------------------------------
1 | {
2 | "COUNT": {
3 | "summary": "Get total number of Redis commands",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": 2,
8 | "container": "COMMAND",
9 | "function": "commandCountCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL"
14 | ],
15 | "acl_categories": [
16 | "CONNECTION"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/command-docs.json:
--------------------------------------------------------------------------------
1 | {
2 | "DOCS": {
3 | "summary": "Get array of specific Redis command documentation",
4 | "complexity": "O(N) where N is the number of commands to look up",
5 | "group": "server",
6 | "since": "7.0.0",
7 | "arity": -2,
8 | "container": "COMMAND",
9 | "function": "commandDocsCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL"
14 | ],
15 | "acl_categories": [
16 | "CONNECTION"
17 | ],
18 | "command_tips": [
19 | "NONDETERMINISTIC_OUTPUT_ORDER"
20 | ],
21 | "arguments": [
22 | {
23 | "name": "command-name",
24 | "type": "string",
25 | "optional": true,
26 | "multiple": true
27 | }
28 | ]
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/commands/command-getkeys.json:
--------------------------------------------------------------------------------
1 | {
2 | "GETKEYS": {
3 | "summary": "Extract keys given a full Redis command",
4 | "complexity": "O(N) where N is the number of arguments to the command",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": -4,
8 | "container": "COMMAND",
9 | "function": "commandGetKeysCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL"
14 | ],
15 | "acl_categories": [
16 | "CONNECTION"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/command-getkeysandflags.json:
--------------------------------------------------------------------------------
1 | {
2 | "GETKEYSANDFLAGS": {
3 | "summary": "Extract keys and access flags given a full Redis command",
4 | "complexity": "O(N) where N is the number of arguments to the command",
5 | "group": "server",
6 | "since": "7.0.0",
7 | "arity": -4,
8 | "container": "COMMAND",
9 | "function": "commandGetKeysAndFlagsCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL"
14 | ],
15 | "acl_categories": [
16 | "CONNECTION"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/command-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "COMMAND",
9 | "function": "commandHelpCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL"
14 | ],
15 | "acl_categories": [
16 | "CONNECTION"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/command.json:
--------------------------------------------------------------------------------
1 | {
2 | "COMMAND": {
3 | "summary": "Get array of Redis command details",
4 | "complexity": "O(N) where N is the total number of Redis commands",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": -1,
8 | "function": "commandCommand",
9 | "command_flags": [
10 | "LOADING",
11 | "STALE",
12 | "SENTINEL"
13 | ],
14 | "acl_categories": [
15 | "CONNECTION"
16 | ],
17 | "command_tips": [
18 | "NONDETERMINISTIC_OUTPUT_ORDER"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/config-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "CONFIG",
9 | "function": "configHelpCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/config-resetstat.json:
--------------------------------------------------------------------------------
1 | {
2 | "RESETSTAT": {
3 | "summary": "Reset the stats returned by INFO",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.0.0",
7 | "arity": 2,
8 | "container": "CONFIG",
9 | "function": "configResetStatCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/config-rewrite.json:
--------------------------------------------------------------------------------
1 | {
2 | "REWRITE": {
3 | "summary": "Rewrite the configuration file with the in memory configuration",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.0",
7 | "arity": 2,
8 | "container": "CONFIG",
9 | "function": "configRewriteCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "CONFIG": {
3 | "summary": "A container for server configuration commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "server",
6 | "since": "2.0.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/dbsize.json:
--------------------------------------------------------------------------------
1 | {
2 | "DBSIZE": {
3 | "summary": "Return the number of keys in the selected database",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": 1,
8 | "function": "dbsizeCommand",
9 | "command_flags": [
10 | "READONLY",
11 | "FAST"
12 | ],
13 | "acl_categories": [
14 | "KEYSPACE"
15 | ],
16 | "command_tips": [
17 | "REQUEST_POLICY:ALL_SHARDS",
18 | "RESPONSE_POLICY:AGG_SUM"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/debug.json:
--------------------------------------------------------------------------------
1 | {
2 | "DEBUG": {
3 | "summary": "A container for debugging commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": -2,
8 | "function": "debugCommand",
9 | "doc_flags": [
10 | "SYSCMD"
11 | ],
12 | "command_flags": [
13 | "ADMIN",
14 | "NOSCRIPT",
15 | "LOADING",
16 | "STALE",
17 | "PROTECTED"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/discard.json:
--------------------------------------------------------------------------------
1 | {
2 | "DISCARD": {
3 | "summary": "Discard all commands issued after MULTI",
4 | "complexity": "O(N), when N is the number of queued commands",
5 | "group": "transactions",
6 | "since": "2.0.0",
7 | "arity": 1,
8 | "function": "discardCommand",
9 | "command_flags": [
10 | "NOSCRIPT",
11 | "LOADING",
12 | "STALE",
13 | "FAST",
14 | "ALLOW_BUSY"
15 | ],
16 | "acl_categories": [
17 | "TRANSACTION"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/echo.json:
--------------------------------------------------------------------------------
1 | {
2 | "ECHO": {
3 | "summary": "Echo the given string",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "1.0.0",
7 | "arity": 2,
8 | "function": "echoCommand",
9 | "command_flags": [
10 | "LOADING",
11 | "STALE",
12 | "FAST"
13 | ],
14 | "acl_categories": [
15 | "CONNECTION"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "message",
20 | "type": "string"
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/exec.json:
--------------------------------------------------------------------------------
1 | {
2 | "EXEC": {
3 | "summary": "Execute all commands issued after MULTI",
4 | "complexity": "Depends on commands in the transaction",
5 | "group": "transactions",
6 | "since": "1.2.0",
7 | "arity": 1,
8 | "function": "execCommand",
9 | "command_flags": [
10 | "NOSCRIPT",
11 | "LOADING",
12 | "STALE",
13 | "SKIP_SLOWLOG"
14 | ],
15 | "acl_categories": [
16 | "TRANSACTION"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/function-delete.json:
--------------------------------------------------------------------------------
1 | {
2 | "DELETE": {
3 | "summary": "Delete a function by name",
4 | "complexity": "O(1)",
5 | "group": "scripting",
6 | "since": "7.0.0",
7 | "arity": 3,
8 | "container": "FUNCTION",
9 | "function": "functionDeleteCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "WRITE"
13 | ],
14 | "acl_categories": [
15 | "SCRIPTING"
16 | ],
17 | "command_tips": [
18 | "REQUEST_POLICY:ALL_SHARDS",
19 | "RESPONSE_POLICY:ALL_SUCCEEDED"
20 | ],
21 | "arguments": [
22 | {
23 | "name": "library-name",
24 | "type": "string"
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/function-dump.json:
--------------------------------------------------------------------------------
1 | {
2 | "DUMP": {
3 | "summary": "Dump all functions into a serialized binary payload",
4 | "complexity": "O(N) where N is the number of functions",
5 | "group": "scripting",
6 | "since": "7.0.0",
7 | "arity": 2,
8 | "container": "FUNCTION",
9 | "function": "functionDumpCommand",
10 | "command_flags": [
11 | "NOSCRIPT"
12 | ],
13 | "acl_categories": [
14 | "SCRIPTING"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/function-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "scripting",
6 | "since": "7.0.0",
7 | "arity": 2,
8 | "container": "FUNCTION",
9 | "function": "functionHelpCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "SCRIPTING"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/function-kill.json:
--------------------------------------------------------------------------------
1 | {
2 | "KILL": {
3 | "summary": "Kill the function currently in execution.",
4 | "complexity": "O(1)",
5 | "group": "scripting",
6 | "since": "7.0.0",
7 | "arity": 2,
8 | "container": "FUNCTION",
9 | "function": "functionKillCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "ALLOW_BUSY"
13 | ],
14 | "acl_categories": [
15 | "SCRIPTING"
16 | ],
17 | "command_tips": [
18 | "REQUEST_POLICY:ALL_SHARDS",
19 | "RESPONSE_POLICY:ONE_SUCCEEDED"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/function-list.json:
--------------------------------------------------------------------------------
1 | {
2 | "LIST": {
3 | "summary": "List information about all the functions",
4 | "complexity": "O(N) where N is the number of functions",
5 | "group": "scripting",
6 | "since": "7.0.0",
7 | "arity": -2,
8 | "container": "FUNCTION",
9 | "function": "functionListCommand",
10 | "command_flags": [
11 | "NOSCRIPT"
12 | ],
13 | "command_tips": [
14 | "NONDETERMINISTIC_OUTPUT_ORDER"
15 | ],
16 | "acl_categories": [
17 | "SCRIPTING"
18 | ],
19 | "arguments": [
20 | {
21 | "name": "library-name-pattern",
22 | "type": "string",
23 | "token": "LIBRARYNAME",
24 | "optional": true
25 | },
26 | {
27 | "name": "withcode",
28 | "type": "pure-token",
29 | "token": "WITHCODE",
30 | "optional": true
31 | }
32 | ]
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/commands/function-stats.json:
--------------------------------------------------------------------------------
1 | {
2 | "STATS": {
3 | "summary": "Return information about the function currently running (name, description, duration)",
4 | "complexity": "O(1)",
5 | "group": "scripting",
6 | "since": "7.0.0",
7 | "arity": 2,
8 | "container": "FUNCTION",
9 | "function": "functionStatsCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "ALLOW_BUSY"
13 | ],
14 | "acl_categories": [
15 | "SCRIPTING"
16 | ],
17 | "command_tips": [
18 | "NONDETERMINISTIC_OUTPUT",
19 | "REQUEST_POLICY:ALL_SHARDS",
20 | "RESPONSE_POLICY:SPECIAL"
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/function.json:
--------------------------------------------------------------------------------
1 | {
2 | "FUNCTION": {
3 | "summary": "A container for function commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "scripting",
6 | "since": "7.0.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/info.json:
--------------------------------------------------------------------------------
1 | {
2 | "INFO": {
3 | "summary": "Get information and statistics about the server",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": -1,
8 | "function": "infoCommand",
9 | "history": [
10 | [
11 | "7.0.0",
12 | "Added support for taking multiple section arguments."
13 | ]
14 | ],
15 | "command_flags": [
16 | "LOADING",
17 | "STALE",
18 | "SENTINEL"
19 | ],
20 | "acl_categories": [
21 | "DANGEROUS"
22 | ],
23 | "command_tips": [
24 | "NONDETERMINISTIC_OUTPUT",
25 | "REQUEST_POLICY:ALL_SHARDS",
26 | "RESPONSE_POLICY:SPECIAL"
27 | ],
28 | "arguments": [
29 | {
30 | "name": "section",
31 | "type": "string",
32 | "multiple": true,
33 | "optional": true
34 | }
35 | ]
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/commands/keys.json:
--------------------------------------------------------------------------------
1 | {
2 | "KEYS": {
3 | "summary": "Find all keys matching the given pattern",
4 | "complexity": "O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length.",
5 | "group": "generic",
6 | "since": "1.0.0",
7 | "arity": 2,
8 | "function": "keysCommand",
9 | "command_flags": [
10 | "READONLY"
11 | ],
12 | "acl_categories": [
13 | "KEYSPACE",
14 | "DANGEROUS"
15 | ],
16 | "command_tips": [
17 | "REQUEST_POLICY:ALL_SHARDS",
18 | "NONDETERMINISTIC_OUTPUT_ORDER"
19 | ],
20 | "arguments": [
21 | {
22 | "name": "pattern",
23 | "type": "pattern"
24 | }
25 | ]
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/commands/lastsave.json:
--------------------------------------------------------------------------------
1 | {
2 | "LASTSAVE": {
3 | "summary": "Get the UNIX time stamp of the last successful save to disk",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": 1,
8 | "function": "lastsaveCommand",
9 | "command_flags": [
10 | "LOADING",
11 | "STALE",
12 | "FAST"
13 | ],
14 | "command_tips": [
15 | "NONDETERMINISTIC_OUTPUT"
16 | ],
17 | "acl_categories": [
18 | "ADMIN",
19 | "DANGEROUS"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/latency-doctor.json:
--------------------------------------------------------------------------------
1 | {
2 | "DOCTOR": {
3 | "summary": "Return a human readable latency analysis report.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": 2,
8 | "container": "LATENCY",
9 | "function": "latencyCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ],
16 | "command_tips": [
17 | "NONDETERMINISTIC_OUTPUT",
18 | "REQUEST_POLICY:ALL_NODES",
19 | "RESPONSE_POLICY:SPECIAL"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/latency-graph.json:
--------------------------------------------------------------------------------
1 | {
2 | "GRAPH": {
3 | "summary": "Return a latency graph for the event.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": 3,
8 | "container": "LATENCY",
9 | "function": "latencyCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ],
16 | "command_tips": [
17 | "NONDETERMINISTIC_OUTPUT",
18 | "REQUEST_POLICY:ALL_NODES",
19 | "RESPONSE_POLICY:SPECIAL"
20 | ],
21 | "arguments": [
22 | {
23 | "name": "event",
24 | "type": "string"
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/latency-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": 2,
8 | "container": "LATENCY",
9 | "function": "latencyCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/latency-histogram.json:
--------------------------------------------------------------------------------
1 | {
2 | "HISTOGRAM": {
3 | "summary": "Return the cumulative distribution of latencies of a subset of commands or all.",
4 | "complexity": "O(N) where N is the number of commands with latency information being retrieved.",
5 | "group": "server",
6 | "since": "7.0.0",
7 | "arity": -2,
8 | "container": "LATENCY",
9 | "function": "latencyCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ],
16 | "command_tips": [
17 | "NONDETERMINISTIC_OUTPUT",
18 | "REQUEST_POLICY:ALL_NODES",
19 | "RESPONSE_POLICY:SPECIAL"
20 | ],
21 | "arguments": [
22 | {
23 | "name": "COMMAND",
24 | "type": "string",
25 | "optional": true,
26 | "multiple": true
27 | }
28 | ]
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/commands/latency-history.json:
--------------------------------------------------------------------------------
1 | {
2 | "HISTORY": {
3 | "summary": "Return timestamp-latency samples for the event.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": 3,
8 | "container": "LATENCY",
9 | "function": "latencyCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ],
16 | "command_tips": [
17 | "NONDETERMINISTIC_OUTPUT",
18 | "REQUEST_POLICY:ALL_NODES",
19 | "RESPONSE_POLICY:SPECIAL"
20 | ],
21 | "arguments": [
22 | {
23 | "name": "event",
24 | "type": "string"
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/latency-latest.json:
--------------------------------------------------------------------------------
1 | {
2 | "LATEST": {
3 | "summary": "Return the latest latency samples for all events.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": 2,
8 | "container": "LATENCY",
9 | "function": "latencyCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ],
16 | "command_tips": [
17 | "NONDETERMINISTIC_OUTPUT",
18 | "REQUEST_POLICY:ALL_NODES",
19 | "RESPONSE_POLICY:SPECIAL"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/latency-reset.json:
--------------------------------------------------------------------------------
1 | {
2 | "RESET": {
3 | "summary": "Reset latency data for one or more events.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": -2,
8 | "container": "LATENCY",
9 | "function": "latencyCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE"
15 | ],
16 | "command_tips": [
17 | "REQUEST_POLICY:ALL_NODES",
18 | "RESPONSE_POLICY:ALL_SUCCEEDED"
19 | ],
20 | "arguments": [
21 | {
22 | "name": "event",
23 | "type": "string",
24 | "optional": true,
25 | "multiple": true
26 | }
27 | ]
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/commands/latency.json:
--------------------------------------------------------------------------------
1 | {
2 | "LATENCY": {
3 | "summary": "A container for latency diagnostics commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "server",
6 | "since": "2.8.13",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/lolwut.json:
--------------------------------------------------------------------------------
1 | {
2 | "LOLWUT": {
3 | "summary": "Display some computer art and the Redis version",
4 | "group": "server",
5 | "since": "5.0.0",
6 | "arity": -1,
7 | "function": "lolwutCommand",
8 | "command_flags": [
9 | "READONLY",
10 | "FAST"
11 | ],
12 | "arguments": [
13 | {
14 | "token": "VERSION",
15 | "name": "version",
16 | "type": "integer",
17 | "optional": true
18 | }
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/memory-doctor.json:
--------------------------------------------------------------------------------
1 | {
2 | "DOCTOR": {
3 | "summary": "Outputs memory problems report",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 2,
8 | "container": "MEMORY",
9 | "function": "memoryCommand",
10 | "command_tips": [
11 | "NONDETERMINISTIC_OUTPUT",
12 | "REQUEST_POLICY:ALL_SHARDS",
13 | "RESPONSE_POLICY:SPECIAL"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/memory-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 2,
8 | "container": "MEMORY",
9 | "function": "memoryCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/memory-malloc-stats.json:
--------------------------------------------------------------------------------
1 | {
2 | "MALLOC-STATS": {
3 | "summary": "Show allocator internal stats",
4 | "complexity": "Depends on how much memory is allocated, could be slow",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 2,
8 | "container": "MEMORY",
9 | "function": "memoryCommand",
10 | "command_tips": [
11 | "NONDETERMINISTIC_OUTPUT",
12 | "REQUEST_POLICY:ALL_SHARDS",
13 | "RESPONSE_POLICY:SPECIAL"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/memory-purge.json:
--------------------------------------------------------------------------------
1 | {
2 | "PURGE": {
3 | "summary": "Ask the allocator to release memory",
4 | "complexity": "Depends on how much memory is allocated, could be slow",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 2,
8 | "container": "MEMORY",
9 | "function": "memoryCommand",
10 | "command_tips": [
11 | "REQUEST_POLICY:ALL_SHARDS",
12 | "RESPONSE_POLICY:ALL_SUCCEEDED"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/memory-stats.json:
--------------------------------------------------------------------------------
1 | {
2 | "STATS": {
3 | "summary": "Show memory usage details",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 2,
8 | "container": "MEMORY",
9 | "function": "memoryCommand",
10 | "command_tips": [
11 | "NONDETERMINISTIC_OUTPUT",
12 | "REQUEST_POLICY:ALL_SHARDS",
13 | "RESPONSE_POLICY:SPECIAL"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/memory.json:
--------------------------------------------------------------------------------
1 | {
2 | "MEMORY": {
3 | "summary": "A container for memory diagnostics commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/module-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "MODULE",
9 | "function": "moduleCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/module-list.json:
--------------------------------------------------------------------------------
1 | {
2 | "LIST": {
3 | "summary": "List all modules loaded by the server",
4 | "complexity": "O(N) where N is the number of loaded modules.",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 2,
8 | "container": "MODULE",
9 | "function": "moduleCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "NOSCRIPT"
13 | ],
14 | "command_tips": [
15 | "NONDETERMINISTIC_OUTPUT_ORDER"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/module-load.json:
--------------------------------------------------------------------------------
1 | {
2 | "LOAD": {
3 | "summary": "Load a module",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": -3,
8 | "container": "MODULE",
9 | "function": "moduleCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "NOSCRIPT",
14 | "PROTECTED"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "path",
19 | "type": "string"
20 | },
21 | {
22 | "name": "arg",
23 | "type": "string",
24 | "optional": true,
25 | "multiple": true
26 | }
27 | ]
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/commands/module-unload.json:
--------------------------------------------------------------------------------
1 | {
2 | "UNLOAD": {
3 | "summary": "Unload a module",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 3,
8 | "container": "MODULE",
9 | "function": "moduleCommand",
10 | "command_flags": [
11 | "NO_ASYNC_LOADING",
12 | "ADMIN",
13 | "NOSCRIPT",
14 | "PROTECTED"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "name",
19 | "type": "string"
20 | }
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/module.json:
--------------------------------------------------------------------------------
1 | {
2 | "MODULE": {
3 | "summary": "A container for module commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/monitor.json:
--------------------------------------------------------------------------------
1 | {
2 | "MONITOR": {
3 | "summary": "Listen for all requests received by the server in real time",
4 | "group": "server",
5 | "since": "1.0.0",
6 | "arity": 1,
7 | "function": "monitorCommand",
8 | "history": [],
9 | "command_flags": [
10 | "ADMIN",
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/multi.json:
--------------------------------------------------------------------------------
1 | {
2 | "MULTI": {
3 | "summary": "Mark the start of a transaction block",
4 | "complexity": "O(1)",
5 | "group": "transactions",
6 | "since": "1.2.0",
7 | "arity": 1,
8 | "function": "multiCommand",
9 | "command_flags": [
10 | "NOSCRIPT",
11 | "LOADING",
12 | "STALE",
13 | "FAST",
14 | "ALLOW_BUSY"
15 | ],
16 | "acl_categories": [
17 | "TRANSACTION"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/object-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "generic",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "OBJECT",
9 | "function": "objectCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "KEYSPACE"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/object.json:
--------------------------------------------------------------------------------
1 | {
2 | "OBJECT": {
3 | "summary": "A container for object introspection commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "generic",
6 | "since": "2.2.3",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/pfselftest.json:
--------------------------------------------------------------------------------
1 | {
2 | "PFSELFTEST": {
3 | "summary": "An internal command for testing HyperLogLog values",
4 | "complexity": "N/A",
5 | "group": "hyperloglog",
6 | "since": "2.8.9",
7 | "arity": 1,
8 | "function": "pfselftestCommand",
9 | "doc_flags": [
10 | "SYSCMD"
11 | ],
12 | "command_flags": [
13 | "ADMIN"
14 | ],
15 | "acl_categories": [
16 | "HYPERLOGLOG"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/commands/ping.json:
--------------------------------------------------------------------------------
1 | {
2 | "PING": {
3 | "summary": "Ping the server",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "1.0.0",
7 | "arity": -1,
8 | "function": "pingCommand",
9 | "command_flags": [
10 | "FAST",
11 | "SENTINEL"
12 | ],
13 | "acl_categories": [
14 | "CONNECTION"
15 | ],
16 | "command_tips": [
17 | "REQUEST_POLICY:ALL_SHARDS",
18 | "RESPONSE_POLICY:ALL_SUCCEEDED"
19 | ],
20 | "arguments": [
21 | {
22 | "name": "message",
23 | "type": "string",
24 | "optional": true
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/psubscribe.json:
--------------------------------------------------------------------------------
1 | {
2 | "PSUBSCRIBE": {
3 | "summary": "Listen for messages published to channels matching the given patterns",
4 | "complexity": "O(N) where N is the number of patterns the client is already subscribed to.",
5 | "group": "pubsub",
6 | "since": "2.0.0",
7 | "arity": -2,
8 | "function": "psubscribeCommand",
9 | "command_flags": [
10 | "PUBSUB",
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "pattern",
19 | "type": "block",
20 | "multiple": true,
21 | "arguments": [
22 | {
23 | "name": "pattern",
24 | "type": "pattern"
25 | }
26 | ]
27 | }
28 | ]
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/commands/psync.json:
--------------------------------------------------------------------------------
1 | {
2 | "PSYNC": {
3 | "summary": "Internal command used for replication",
4 | "group": "server",
5 | "since": "2.8.0",
6 | "arity": -3,
7 | "function": "syncCommand",
8 | "command_flags": [
9 | "NO_ASYNC_LOADING",
10 | "ADMIN",
11 | "NO_MULTI",
12 | "NOSCRIPT"
13 | ],
14 | "arguments": [
15 | {
16 | "name": "replicationid",
17 | "type": "string"
18 | },
19 | {
20 | "name": "offset",
21 | "type": "integer"
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/commands/publish.json:
--------------------------------------------------------------------------------
1 | {
2 | "PUBLISH": {
3 | "summary": "Post a message to a channel",
4 | "complexity": "O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).",
5 | "group": "pubsub",
6 | "since": "2.0.0",
7 | "arity": 3,
8 | "function": "publishCommand",
9 | "command_flags": [
10 | "PUBSUB",
11 | "LOADING",
12 | "STALE",
13 | "FAST",
14 | "MAY_REPLICATE",
15 | "SENTINEL"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "channel",
20 | "type": "string"
21 | },
22 | {
23 | "name": "message",
24 | "type": "string"
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/pubsub-channels.json:
--------------------------------------------------------------------------------
1 | {
2 | "CHANNELS": {
3 | "summary": "List active channels",
4 | "complexity": "O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns)",
5 | "group": "pubsub",
6 | "since": "2.8.0",
7 | "arity": -2,
8 | "container": "PUBSUB",
9 | "function": "pubsubCommand",
10 | "command_flags": [
11 | "PUBSUB",
12 | "LOADING",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "pattern",
18 | "type": "pattern",
19 | "optional": true
20 | }
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/pubsub-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "pubsub",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "PUBSUB",
9 | "function": "pubsubCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/pubsub-numpat.json:
--------------------------------------------------------------------------------
1 | {
2 | "NUMPAT": {
3 | "summary": "Get the count of unique patterns pattern subscriptions",
4 | "complexity": "O(1)",
5 | "group": "pubsub",
6 | "since": "2.8.0",
7 | "arity": 2,
8 | "container": "PUBSUB",
9 | "function": "pubsubCommand",
10 | "command_flags": [
11 | "PUBSUB",
12 | "LOADING",
13 | "STALE"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/pubsub-numsub.json:
--------------------------------------------------------------------------------
1 | {
2 | "NUMSUB": {
3 | "summary": "Get the count of subscribers for channels",
4 | "complexity": "O(N) for the NUMSUB subcommand, where N is the number of requested channels",
5 | "group": "pubsub",
6 | "since": "2.8.0",
7 | "arity": -2,
8 | "container": "PUBSUB",
9 | "function": "pubsubCommand",
10 | "command_flags": [
11 | "PUBSUB",
12 | "LOADING",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "channel",
18 | "type": "string",
19 | "optional": true,
20 | "multiple": true
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/pubsub-shardchannels.json:
--------------------------------------------------------------------------------
1 | {
2 | "SHARDCHANNELS": {
3 | "summary": "List active shard channels",
4 | "complexity": "O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short shard channels).",
5 | "group": "pubsub",
6 | "since": "7.0.0",
7 | "arity": -2,
8 | "container": "PUBSUB",
9 | "function": "pubsubCommand",
10 | "command_flags": [
11 | "PUBSUB",
12 | "LOADING",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "pattern",
18 | "type": "pattern",
19 | "optional": true
20 | }
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/pubsub-shardnumsub.json:
--------------------------------------------------------------------------------
1 | {
2 | "SHARDNUMSUB": {
3 | "summary": "Get the count of subscribers for shard channels",
4 | "complexity": "O(N) for the SHARDNUMSUB subcommand, where N is the number of requested shard channels",
5 | "group": "pubsub",
6 | "since": "7.0.0",
7 | "arity": -2,
8 | "container": "PUBSUB",
9 | "function": "pubsubCommand",
10 | "command_flags": [
11 | "PUBSUB",
12 | "LOADING",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "shardchannel",
18 | "type": "string",
19 | "optional": true,
20 | "multiple": true
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/pubsub.json:
--------------------------------------------------------------------------------
1 | {
2 | "PUBSUB": {
3 | "summary": "A container for Pub/Sub commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "pubsub",
6 | "since": "2.8.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/punsubscribe.json:
--------------------------------------------------------------------------------
1 | {
2 | "PUNSUBSCRIBE": {
3 | "summary": "Stop listening for messages posted to channels matching the given patterns",
4 | "complexity": "O(N+M) where N is the number of patterns the client is already subscribed and M is the number of total patterns subscribed in the system (by any client).",
5 | "group": "pubsub",
6 | "since": "2.0.0",
7 | "arity": -1,
8 | "function": "punsubscribeCommand",
9 | "command_flags": [
10 | "PUBSUB",
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "pattern",
19 | "type": "pattern",
20 | "optional": true,
21 | "multiple": true
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/commands/quit.json:
--------------------------------------------------------------------------------
1 | {
2 | "QUIT": {
3 | "summary": "Close the connection",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "1.0.0",
7 | "arity": -1,
8 | "function": "quitCommand",
9 | "command_flags": [
10 | "ALLOW_BUSY",
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "FAST",
15 | "NO_AUTH"
16 | ],
17 | "acl_categories": [
18 | "CONNECTION"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/randomkey.json:
--------------------------------------------------------------------------------
1 | {
2 | "RANDOMKEY": {
3 | "summary": "Return a random key from the keyspace",
4 | "complexity": "O(1)",
5 | "group": "generic",
6 | "since": "1.0.0",
7 | "arity": 1,
8 | "function": "randomkeyCommand",
9 | "command_flags": [
10 | "READONLY"
11 | ],
12 | "acl_categories": [
13 | "KEYSPACE"
14 | ],
15 | "command_tips": [
16 | "REQUEST_POLICY:ALL_SHARDS",
17 | "NONDETERMINISTIC_OUTPUT"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/readonly.json:
--------------------------------------------------------------------------------
1 | {
2 | "READONLY": {
3 | "summary": "Enables read queries for a connection to a cluster replica node",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 1,
8 | "function": "readonlyCommand",
9 | "command_flags": [
10 | "FAST",
11 | "LOADING",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "CONNECTION"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/readwrite.json:
--------------------------------------------------------------------------------
1 | {
2 | "READWRITE": {
3 | "summary": "Disables read queries for a connection to a cluster replica node",
4 | "complexity": "O(1)",
5 | "group": "cluster",
6 | "since": "3.0.0",
7 | "arity": 1,
8 | "function": "readwriteCommand",
9 | "command_flags": [
10 | "FAST",
11 | "LOADING",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "CONNECTION"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/replconf.json:
--------------------------------------------------------------------------------
1 | {
2 | "REPLCONF": {
3 | "summary": "An internal command for configuring the replication stream",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "3.0.0",
7 | "arity": -1,
8 | "function": "replconfCommand",
9 | "doc_flags": [
10 | "SYSCMD"
11 | ],
12 | "command_flags": [
13 | "ADMIN",
14 | "NOSCRIPT",
15 | "LOADING",
16 | "STALE",
17 | "ALLOW_BUSY"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/replicaof.json:
--------------------------------------------------------------------------------
1 | {
2 | "REPLICAOF": {
3 | "summary": "Make the server a replica of another instance, or promote it as master.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "5.0.0",
7 | "arity": 3,
8 | "function": "replicaofCommand",
9 | "command_flags": [
10 | "NO_ASYNC_LOADING",
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "STALE"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "host",
18 | "type": "string"
19 | },
20 | {
21 | "name": "port",
22 | "type": "integer"
23 | }
24 | ]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/commands/reset.json:
--------------------------------------------------------------------------------
1 | {
2 | "RESET": {
3 | "summary": "Reset the connection",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "6.2.0",
7 | "arity": 1,
8 | "function": "resetCommand",
9 | "command_flags": [
10 | "NOSCRIPT",
11 | "LOADING",
12 | "STALE",
13 | "FAST",
14 | "NO_AUTH",
15 | "ALLOW_BUSY"
16 | ],
17 | "acl_categories": [
18 | "CONNECTION"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/role.json:
--------------------------------------------------------------------------------
1 | {
2 | "ROLE": {
3 | "summary": "Return the role of the instance in the context of replication",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.8.12",
7 | "arity": 1,
8 | "function": "roleCommand",
9 | "command_flags": [
10 | "NOSCRIPT",
11 | "LOADING",
12 | "STALE",
13 | "FAST",
14 | "SENTINEL"
15 | ],
16 | "acl_categories": [
17 | "ADMIN",
18 | "DANGEROUS"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/save.json:
--------------------------------------------------------------------------------
1 | {
2 | "SAVE": {
3 | "summary": "Synchronously save the dataset to disk",
4 | "complexity": "O(N) where N is the total number of keys in all databases",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": 1,
8 | "function": "saveCommand",
9 | "command_flags": [
10 | "NO_ASYNC_LOADING",
11 | "ADMIN",
12 | "NOSCRIPT",
13 | "NO_MULTI"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/script-exists.json:
--------------------------------------------------------------------------------
1 | {
2 | "EXISTS": {
3 | "summary": "Check existence of scripts in the script cache.",
4 | "complexity": "O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).",
5 | "group": "scripting",
6 | "since": "2.6.0",
7 | "arity": -3,
8 | "container": "SCRIPT",
9 | "function": "scriptCommand",
10 | "command_flags": [
11 | "NOSCRIPT"
12 | ],
13 | "acl_categories": [
14 | "SCRIPTING"
15 | ],
16 | "command_tips": [
17 | "REQUEST_POLICY:ALL_SHARDS",
18 | "RESPONSE_POLICY:AGG_LOGICAL_AND"
19 | ],
20 | "arguments": [
21 | {
22 | "name": "sha1",
23 | "type": "string",
24 | "multiple": true
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/script-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "scripting",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "SCRIPT",
9 | "function": "scriptCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "SCRIPTING"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/script-kill.json:
--------------------------------------------------------------------------------
1 | {
2 | "KILL": {
3 | "summary": "Kill the script currently in execution.",
4 | "complexity": "O(1)",
5 | "group": "scripting",
6 | "since": "2.6.0",
7 | "arity": 2,
8 | "container": "SCRIPT",
9 | "function": "scriptCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "ALLOW_BUSY"
13 | ],
14 | "acl_categories": [
15 | "SCRIPTING"
16 | ],
17 | "command_tips": [
18 | "REQUEST_POLICY:ALL_SHARDS",
19 | "RESPONSE_POLICY:ONE_SUCCEEDED"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/script-load.json:
--------------------------------------------------------------------------------
1 | {
2 | "LOAD": {
3 | "summary": "Load the specified Lua script into the script cache.",
4 | "complexity": "O(N) with N being the length in bytes of the script body.",
5 | "group": "scripting",
6 | "since": "2.6.0",
7 | "arity": 3,
8 | "container": "SCRIPT",
9 | "function": "scriptCommand",
10 | "command_flags": [
11 | "NOSCRIPT",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "SCRIPTING"
16 | ],
17 | "command_tips": [
18 | "REQUEST_POLICY:ALL_NODES",
19 | "RESPONSE_POLICY:ALL_SUCCEEDED"
20 | ],
21 | "arguments": [
22 | {
23 | "name": "script",
24 | "type": "string"
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/script.json:
--------------------------------------------------------------------------------
1 | {
2 | "SCRIPT": {
3 | "summary": "A container for Lua scripts management commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "scripting",
6 | "since": "2.6.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/select.json:
--------------------------------------------------------------------------------
1 | {
2 | "SELECT": {
3 | "summary": "Change the selected database for the current connection",
4 | "complexity": "O(1)",
5 | "group": "connection",
6 | "since": "1.0.0",
7 | "arity": 2,
8 | "function": "selectCommand",
9 | "command_flags": [
10 | "LOADING",
11 | "STALE",
12 | "FAST"
13 | ],
14 | "acl_categories": [
15 | "CONNECTION"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "index",
20 | "type": "integer"
21 | }
22 | ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/commands/sentinel-ckquorum.json:
--------------------------------------------------------------------------------
1 | {
2 | "CKQUORUM": {
3 | "summary": "Check for a Sentinel quorum",
4 | "group": "sentinel",
5 | "since": "2.8.4",
6 | "arity": 3,
7 | "container": "SENTINEL",
8 | "function": "sentinelCommand",
9 | "command_flags": [
10 | "ADMIN",
11 | "SENTINEL",
12 | "ONLY_SENTINEL"
13 | ],
14 | "arguments": [
15 | {
16 | "name": "master-name",
17 | "type": "string"
18 | }
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/sentinel-debug.json:
--------------------------------------------------------------------------------
1 | {
2 | "DEBUG": {
3 | "summary": "List or update the current configurable parameters",
4 | "complexity": "O(N) where N is the number of configurable parameters",
5 | "group": "sentinel",
6 | "since": "7.0.0",
7 | "arity": -2,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "parameter_value",
18 | "type": "block",
19 | "multiple": true,
20 | "arguments": [
21 | {
22 | "name": "parameter",
23 | "type": "string"
24 | },
25 | {
26 | "name": "value",
27 | "type": "string"
28 | }
29 | ]
30 | }
31 | ]
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/commands/sentinel-failover.json:
--------------------------------------------------------------------------------
1 | {
2 | "FAILOVER": {
3 | "summary": "Force a failover",
4 | "group": "sentinel",
5 | "since": "2.8.4",
6 | "arity": 3,
7 | "container": "SENTINEL",
8 | "function": "sentinelCommand",
9 | "command_flags": [
10 | "ADMIN",
11 | "SENTINEL",
12 | "ONLY_SENTINEL"
13 | ],
14 | "arguments": [
15 | {
16 | "name": "master-name",
17 | "type": "string"
18 | }
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/sentinel-flushconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "FLUSHCONFIG": {
3 | "summary": "Rewrite configuration file",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 2,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/sentinel-get-master-addr-by-name.json:
--------------------------------------------------------------------------------
1 | {
2 | "GET-MASTER-ADDR-BY-NAME": {
3 | "summary": "Get port and address of a master",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "master-name",
18 | "type": "string"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/sentinel-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE",
13 | "SENTINEL",
14 | "ONLY_SENTINEL"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/commands/sentinel-info-cache.json:
--------------------------------------------------------------------------------
1 | {
2 | "INFO-CACHE": {
3 | "summary": "Get cached INFO from the instances in the deployment",
4 | "complexity": "O(N) where N is the number of instances",
5 | "group": "sentinel",
6 | "since": "3.2.0",
7 | "arity": -3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "nodename",
18 | "type": "string",
19 | "multiple": true
20 | }
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/commands/sentinel-is-master-down-by-addr.json:
--------------------------------------------------------------------------------
1 | {
2 | "IS-MASTER-DOWN-BY-ADDR": {
3 | "summary": "Check if a master is down",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 6,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "ip",
18 | "type": "string"
19 | },
20 | {
21 | "name": "port",
22 | "type": "integer"
23 | },
24 | {
25 | "name": "current-epoch",
26 | "type": "integer"
27 | },
28 | {
29 | "name": "runid",
30 | "type": "string"
31 | }
32 | ]
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/commands/sentinel-master.json:
--------------------------------------------------------------------------------
1 | {
2 | "MASTER": {
3 | "summary": "Shows the state of a master",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "master-name",
18 | "type": "string"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/sentinel-masters.json:
--------------------------------------------------------------------------------
1 | {
2 | "MASTERS": {
3 | "summary": "List the monitored masters",
4 | "complexity": "O(N) where N is the number of masters",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 2,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/sentinel-monitor.json:
--------------------------------------------------------------------------------
1 | {
2 | "MONITOR": {
3 | "summary": "Start monitoring",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 6,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "name",
18 | "type": "string"
19 | },
20 | {
21 | "name": "ip",
22 | "type": "string"
23 | },
24 | {
25 | "name": "port",
26 | "type": "integer"
27 | },
28 | {
29 | "name": "quorum",
30 | "type": "integer"
31 | }
32 | ]
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/commands/sentinel-myid.json:
--------------------------------------------------------------------------------
1 | {
2 | "MYID": {
3 | "summary": "Get the Sentinel instance ID",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/commands/sentinel-pending-scripts.json:
--------------------------------------------------------------------------------
1 | {
2 | "PENDING-SCRIPTS": {
3 | "summary": "Get information about pending scripts",
4 | "group": "sentinel",
5 | "since": "2.8.4",
6 | "arity": 2,
7 | "container": "SENTINEL",
8 | "function": "sentinelCommand",
9 | "command_flags": [
10 | "ADMIN",
11 | "SENTINEL",
12 | "ONLY_SENTINEL"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/sentinel-remove.json:
--------------------------------------------------------------------------------
1 | {
2 | "REMOVE": {
3 | "summary": "Stop monitoring",
4 | "complexity": "O(1)",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "master-name",
18 | "type": "string"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/sentinel-replicas.json:
--------------------------------------------------------------------------------
1 | {
2 | "REPLICAS": {
3 | "summary": "List the monitored replicas",
4 | "complexity": "O(N) where N is the number of replicas",
5 | "group": "sentinel",
6 | "since": "5.0.0",
7 | "arity": 3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "master-name",
18 | "type": "string"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/sentinel-reset.json:
--------------------------------------------------------------------------------
1 | {
2 | "RESET": {
3 | "summary": "Reset masters by name pattern",
4 | "complexity": "O(N) where N is the number of monitored masters",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "pattern",
18 | "type": "pattern"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/sentinel-sentinels.json:
--------------------------------------------------------------------------------
1 | {
2 | "SENTINELS": {
3 | "summary": "List the Sentinel instances",
4 | "complexity": "O(N) where N is the number of Sentinels",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": 3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "SENTINEL",
13 | "ONLY_SENTINEL"
14 | ],
15 | "arguments": [
16 | {
17 | "name": "master-name",
18 | "type": "string"
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/commands/sentinel-slaves.json:
--------------------------------------------------------------------------------
1 | {
2 | "SLAVES": {
3 | "summary": "List the monitored slaves",
4 | "complexity": "O(N) where N is the number of slaves",
5 | "group": "sentinel",
6 | "since": "2.8.0",
7 | "arity": 3,
8 | "container": "SENTINEL",
9 | "function": "sentinelCommand",
10 | "deprecated_since": "5.0.0",
11 | "replaced_by": "`SENTINEL REPLICAS`",
12 | "doc_flags": [
13 | "DEPRECATED"
14 | ],
15 | "command_flags": [
16 | "ADMIN",
17 | "SENTINEL",
18 | "ONLY_SENTINEL"
19 | ],
20 | "arguments": [
21 | {
22 | "name": "master-name",
23 | "type": "string"
24 | }
25 | ]
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/commands/sentinel.json:
--------------------------------------------------------------------------------
1 | {
2 | "SENTINEL": {
3 | "summary": "A container for Sentinel commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "sentinel",
6 | "since": "2.8.4",
7 | "arity": -2,
8 | "command_flags": [
9 | "ADMIN",
10 | "SENTINEL",
11 | "ONLY_SENTINEL"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/commands/slaveof.json:
--------------------------------------------------------------------------------
1 | {
2 | "SLAVEOF": {
3 | "summary": "Make the server a replica of another instance, or promote it as master.",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "1.0.0",
7 | "arity": 3,
8 | "function": "replicaofCommand",
9 | "deprecated_since": "5.0.0",
10 | "replaced_by": "`REPLICAOF`",
11 | "doc_flags": [
12 | "DEPRECATED"
13 | ],
14 | "command_flags": [
15 | "NO_ASYNC_LOADING",
16 | "ADMIN",
17 | "NOSCRIPT",
18 | "STALE"
19 | ],
20 | "arguments": [
21 | {
22 | "name": "host",
23 | "type": "string"
24 | },
25 | {
26 | "name": "port",
27 | "type": "integer"
28 | }
29 | ]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/commands/slowlog-get.json:
--------------------------------------------------------------------------------
1 | {
2 | "GET": {
3 | "summary": "Get the slow log's entries",
4 | "complexity": "O(N) where N is the number of entries returned",
5 | "group": "server",
6 | "since": "2.2.12",
7 | "arity": -2,
8 | "container": "SLOWLOG",
9 | "function": "slowlogCommand",
10 | "history": [
11 | [
12 | "4.0.0",
13 | "Added client IP address, port and name to the reply."
14 | ]
15 | ],
16 | "command_flags": [
17 | "ADMIN",
18 | "LOADING",
19 | "STALE"
20 | ],
21 | "command_tips": [
22 | "REQUEST_POLICY:ALL_NODES",
23 | "NONDETERMINISTIC_OUTPUT"
24 | ],
25 | "arguments": [
26 | {
27 | "name": "count",
28 | "type": "integer",
29 | "optional": true
30 | }
31 | ]
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/commands/slowlog-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "6.2.0",
7 | "arity": 2,
8 | "container": "SLOWLOG",
9 | "function": "slowlogCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/slowlog-len.json:
--------------------------------------------------------------------------------
1 | {
2 | "LEN": {
3 | "summary": "Get the slow log's length",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.2.12",
7 | "arity": 2,
8 | "container": "SLOWLOG",
9 | "function": "slowlogCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "LOADING",
13 | "STALE"
14 | ],
15 | "command_tips": [
16 | "REQUEST_POLICY:ALL_NODES",
17 | "RESPONSE_POLICY:AGG_SUM",
18 | "NONDETERMINISTIC_OUTPUT"
19 | ]
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/commands/slowlog-reset.json:
--------------------------------------------------------------------------------
1 | {
2 | "RESET": {
3 | "summary": "Clear all entries from the slow log",
4 | "complexity": "O(N) where N is the number of entries in the slowlog",
5 | "group": "server",
6 | "since": "2.2.12",
7 | "arity": 2,
8 | "container": "SLOWLOG",
9 | "function": "slowlogCommand",
10 | "command_flags": [
11 | "ADMIN",
12 | "LOADING",
13 | "STALE"
14 | ],
15 | "command_tips": [
16 | "REQUEST_POLICY:ALL_NODES",
17 | "RESPONSE_POLICY:ALL_SUCCEEDED"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/slowlog.json:
--------------------------------------------------------------------------------
1 | {
2 | "SLOWLOG": {
3 | "summary": "A container for slow log commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "server",
6 | "since": "2.2.12",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/subscribe.json:
--------------------------------------------------------------------------------
1 | {
2 | "SUBSCRIBE": {
3 | "summary": "Listen for messages published to the given channels",
4 | "complexity": "O(N) where N is the number of channels to subscribe to.",
5 | "group": "pubsub",
6 | "since": "2.0.0",
7 | "arity": -2,
8 | "function": "subscribeCommand",
9 | "history": [],
10 | "command_flags": [
11 | "PUBSUB",
12 | "NOSCRIPT",
13 | "LOADING",
14 | "STALE",
15 | "SENTINEL"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "channel",
20 | "type": "string",
21 | "multiple": true
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/commands/swapdb.json:
--------------------------------------------------------------------------------
1 | {
2 | "SWAPDB": {
3 | "summary": "Swaps two Redis databases",
4 | "complexity": "O(N) where N is the count of clients watching or blocking on keys from both databases.",
5 | "group": "server",
6 | "since": "4.0.0",
7 | "arity": 3,
8 | "function": "swapdbCommand",
9 | "command_flags": [
10 | "WRITE",
11 | "FAST"
12 | ],
13 | "acl_categories": [
14 | "KEYSPACE",
15 | "DANGEROUS"
16 | ],
17 | "arguments": [
18 | {
19 | "name": "index1",
20 | "type": "integer"
21 | },
22 | {
23 | "name": "index2",
24 | "type": "integer"
25 | }
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/commands/sync.json:
--------------------------------------------------------------------------------
1 | {
2 | "SYNC": {
3 | "summary": "Internal command used for replication",
4 | "group": "server",
5 | "since": "1.0.0",
6 | "arity": 1,
7 | "function": "syncCommand",
8 | "command_flags": [
9 | "NO_ASYNC_LOADING",
10 | "ADMIN",
11 | "NO_MULTI",
12 | "NOSCRIPT"
13 | ]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/commands/time.json:
--------------------------------------------------------------------------------
1 | {
2 | "TIME": {
3 | "summary": "Return the current server time",
4 | "complexity": "O(1)",
5 | "group": "server",
6 | "since": "2.6.0",
7 | "arity": 1,
8 | "function": "timeCommand",
9 | "command_flags": [
10 | "LOADING",
11 | "STALE",
12 | "FAST"
13 | ],
14 | "command_tips": [
15 | "NONDETERMINISTIC_OUTPUT"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/unsubscribe.json:
--------------------------------------------------------------------------------
1 | {
2 | "UNSUBSCRIBE": {
3 | "summary": "Stop listening for messages posted to the given channels",
4 | "complexity": "O(N) where N is the number of clients already subscribed to a channel.",
5 | "group": "pubsub",
6 | "since": "2.0.0",
7 | "arity": -1,
8 | "function": "unsubscribeCommand",
9 | "command_flags": [
10 | "PUBSUB",
11 | "NOSCRIPT",
12 | "LOADING",
13 | "STALE",
14 | "SENTINEL"
15 | ],
16 | "arguments": [
17 | {
18 | "name": "channel",
19 | "type": "string",
20 | "optional": true,
21 | "multiple": true
22 | }
23 | ]
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/commands/unwatch.json:
--------------------------------------------------------------------------------
1 | {
2 | "UNWATCH": {
3 | "summary": "Forget about all watched keys",
4 | "complexity": "O(1)",
5 | "group": "transactions",
6 | "since": "2.2.0",
7 | "arity": 1,
8 | "function": "unwatchCommand",
9 | "command_flags": [
10 | "NOSCRIPT",
11 | "LOADING",
12 | "STALE",
13 | "FAST",
14 | "ALLOW_BUSY"
15 | ],
16 | "acl_categories": [
17 | "TRANSACTION"
18 | ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/commands/wait.json:
--------------------------------------------------------------------------------
1 | {
2 | "WAIT": {
3 | "summary": "Wait for the synchronous replication of all the write commands sent in the context of the current connection",
4 | "complexity": "O(1)",
5 | "group": "generic",
6 | "since": "3.0.0",
7 | "arity": 3,
8 | "function": "waitCommand",
9 | "command_flags": [
10 | "NOSCRIPT"
11 | ],
12 | "acl_categories": [
13 | "CONNECTION"
14 | ],
15 | "command_tips": [
16 | "REQUEST_POLICY:ALL_SHARDS",
17 | "RESPONSE_POLICY:AGG_MIN"
18 | ],
19 | "arguments": [
20 | {
21 | "name": "numreplicas",
22 | "type": "integer"
23 | },
24 | {
25 | "name": "timeout",
26 | "type": "integer"
27 | }
28 | ]
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/commands/xgroup-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "stream",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "XGROUP",
9 | "function": "xgroupCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "STREAM"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/xgroup.json:
--------------------------------------------------------------------------------
1 | {
2 | "XGROUP": {
3 | "summary": "A container for consumer groups commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "stream",
6 | "since": "5.0.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/commands/xinfo-help.json:
--------------------------------------------------------------------------------
1 | {
2 | "HELP": {
3 | "summary": "Show helpful text about the different subcommands",
4 | "complexity": "O(1)",
5 | "group": "stream",
6 | "since": "5.0.0",
7 | "arity": 2,
8 | "container": "XINFO",
9 | "function": "xinfoCommand",
10 | "command_flags": [
11 | "LOADING",
12 | "STALE"
13 | ],
14 | "acl_categories": [
15 | "STREAM"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/commands/xinfo.json:
--------------------------------------------------------------------------------
1 | {
2 | "XINFO": {
3 | "summary": "A container for stream introspection commands",
4 | "complexity": "Depends on subcommand.",
5 | "group": "stream",
6 | "since": "5.0.0",
7 | "arity": -2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/crc64.h:
--------------------------------------------------------------------------------
1 | #ifndef CRC64_H
2 | #define CRC64_H
3 |
4 | #include
5 |
6 | /* CRC64 表初始化函数 */
7 | /* 应在程序初始化时调用(一次即可) */
8 | void crc64_init(void);
9 | /* CRC64 计算函数 */
10 | uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l);
11 |
12 | #ifdef REDIS_TEST
13 | int crc64Test(int argc, char *argv[], int flags);
14 | #endif
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/src/geo.h:
--------------------------------------------------------------------------------
1 | #ifndef __GEO_H__
2 | #define __GEO_H__
3 |
4 | #include "server.h"
5 |
6 | /* Structures used inside geo.c in order to represent points and array of
7 | * points on the earth. */
8 | typedef struct geoPoint {
9 | double longitude;
10 | double latitude;
11 | double dist;
12 | double score;
13 | char *member;
14 | } geoPoint;
15 |
16 | typedef struct geoArray {
17 | struct geoPoint *array;
18 | /* 总桶的数量,即 array 的大小 */
19 | size_t buckets;
20 | /* 已使用的桶的数量 */
21 | size_t used;
22 | } geoArray;
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/src/mkreleasehdr.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1`
3 | GIT_DIRTY=`git diff --no-ext-diff 2> /dev/null | wc -l`
4 | BUILD_ID=`uname -n`"-"`date +%s`
5 | if [ -n "$SOURCE_DATE_EPOCH" ]; then
6 | BUILD_ID=$(date -u -d "@$SOURCE_DATE_EPOCH" +%s 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" +%s 2>/dev/null || date -u +%s)
7 | fi
8 | test -f release.h || touch release.h
9 | (cat release.h | grep SHA1 | grep $GIT_SHA1) && \
10 | (cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already up-to-date
11 | echo "#define REDIS_GIT_SHA1 \"$GIT_SHA1\"" > release.h
12 | echo "#define REDIS_GIT_DIRTY \"$GIT_DIRTY\"" >> release.h
13 | echo "#define REDIS_BUILD_ID \"$BUILD_ID\"" >> release.h
14 | touch release.c # Force recompile of release.c
15 |
--------------------------------------------------------------------------------
/src/modules/.gitignore:
--------------------------------------------------------------------------------
1 | *.so
2 | *.xo
3 |
--------------------------------------------------------------------------------
/src/sha1.h:
--------------------------------------------------------------------------------
1 | #ifndef SHA1_H
2 | #define SHA1_H
3 | /* ================ sha1.h ================ */
4 | /*
5 | SHA-1 in C
6 | By Steve Reid
7 | 100% Public Domain
8 | */
9 |
10 | typedef struct {
11 | uint32_t state[5];
12 | uint32_t count[2];
13 | unsigned char buffer[64];
14 | } SHA1_CTX;
15 |
16 | void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
17 | void SHA1Init(SHA1_CTX* context);
18 | void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len);
19 | void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
20 |
21 | #ifdef REDIS_TEST
22 | int sha1Test(int argc, char **argv, int flags);
23 | #endif
24 | #endif
25 |
--------------------------------------------------------------------------------
/src/valgrind.sup:
--------------------------------------------------------------------------------
1 | {
2 |
3 | Memcheck:Cond
4 | fun:lzf_compress
5 | }
6 |
7 | {
8 |
9 | Memcheck:Value4
10 | fun:lzf_compress
11 | }
12 |
13 | {
14 |
15 | Memcheck:Value8
16 | fun:lzf_compress
17 | }
18 |
19 | {
20 |
21 | Memcheck:FishyValue
22 | malloc(size)
23 | fun:malloc
24 | fun:ztrymalloc_usable
25 | fun:ztrymalloc
26 | }
27 |
--------------------------------------------------------------------------------
/src/version.h:
--------------------------------------------------------------------------------
1 | #define REDIS_VERSION "7.0.5"
2 | #define REDIS_VERSION_NUM 0x00070005
3 |
--------------------------------------------------------------------------------
/tests/assets/corrupt_empty_keys.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/corrupt_empty_keys.rdb
--------------------------------------------------------------------------------
/tests/assets/corrupt_ziplist.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/corrupt_ziplist.rdb
--------------------------------------------------------------------------------
/tests/assets/default.conf:
--------------------------------------------------------------------------------
1 | # Redis configuration for testing.
2 |
3 | always-show-logo yes
4 | notify-keyspace-events KEA
5 | daemonize no
6 | pidfile /var/run/redis.pid
7 | port 6379
8 | timeout 0
9 | bind 127.0.0.1
10 | loglevel verbose
11 | logfile ''
12 | databases 16
13 | latency-monitor-threshold 1
14 | repl-diskless-sync-delay 0
15 |
16 | # Note the infrastructure in server.tcl uses a dict, we can't provide several save directives
17 | save 900 1
18 |
19 | rdbcompression yes
20 | dbfilename dump.rdb
21 | dir ./
22 |
23 | slave-serve-stale-data yes
24 | appendonly no
25 | appendfsync everysec
26 | no-appendfsync-on-rewrite no
27 | activerehashing yes
28 |
29 | enable-protected-configs yes
30 | enable-debug-command yes
31 | enable-module-command yes
32 |
33 | propagation-error-behavior panic
--------------------------------------------------------------------------------
/tests/assets/encodings.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/encodings.rdb
--------------------------------------------------------------------------------
/tests/assets/hash-ziplist.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/hash-ziplist.rdb
--------------------------------------------------------------------------------
/tests/assets/hash-zipmap.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/hash-zipmap.rdb
--------------------------------------------------------------------------------
/tests/assets/list-quicklist.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/list-quicklist.rdb
--------------------------------------------------------------------------------
/tests/assets/minimal.conf:
--------------------------------------------------------------------------------
1 | # Minimal configuration for testing.
2 | always-show-logo yes
3 | daemonize no
4 | pidfile /var/run/redis.pid
5 | loglevel verbose
6 |
--------------------------------------------------------------------------------
/tests/assets/nodefaultuser.acl:
--------------------------------------------------------------------------------
1 | user alice on nopass ~* +@all
2 | user bob on nopass ~* &* +@all
--------------------------------------------------------------------------------
/tests/assets/rdb-preamble.aof:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/rdb-preamble.aof
--------------------------------------------------------------------------------
/tests/assets/scriptbackup.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/scriptbackup.rdb
--------------------------------------------------------------------------------
/tests/assets/user.acl:
--------------------------------------------------------------------------------
1 | user alice on allcommands allkeys &* >alice
2 | user bob on -@all +@set +acl ~set* &* >bob
3 | user default on nopass ~* &* +@all
4 |
--------------------------------------------------------------------------------
/tests/assets/userwithselectors.acl:
--------------------------------------------------------------------------------
1 | user alice on (+get ~rw*)
2 | user bob on (+set %W~w*) (+get %R~r*)
--------------------------------------------------------------------------------
/tests/assets/zset-ziplist.rdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-annotation-team/redis7.0-chinese-annotated/e352dafc89b0fcdac3071145e7a99c37f3802452/tests/assets/zset-ziplist.rdb
--------------------------------------------------------------------------------
/tests/cluster/run.tcl:
--------------------------------------------------------------------------------
1 | # Cluster test suite. Copyright (C) 2014 Salvatore Sanfilippo antirez@gmail.com
2 | # This software is released under the BSD License. See the COPYING file for
3 | # more information.
4 |
5 | cd tests/cluster
6 | source cluster.tcl
7 | source ../instances.tcl
8 | source ../../support/cluster.tcl ; # Redis Cluster client.
9 |
10 | set ::instances_count 20 ; # How many instances we use at max.
11 | set ::tlsdir "../../tls"
12 |
13 | proc main {} {
14 | parse_options
15 | spawn_instance redis $::redis_base_port $::instances_count {
16 | "cluster-enabled yes"
17 | "appendonly yes"
18 | "enable-protected-configs yes"
19 | "enable-debug-command yes"
20 | }
21 | run_tests
22 | cleanup
23 | end_tests
24 | }
25 |
26 | if {[catch main e]} {
27 | puts $::errorInfo
28 | if {$::pause_on_error} pause_on_error
29 | cleanup
30 | exit 1
31 | }
32 |
--------------------------------------------------------------------------------
/tests/cluster/tests/01-faildet.tcl:
--------------------------------------------------------------------------------
1 | # Check the basic monitoring and failover capabilities.
2 |
3 | source "../tests/includes/init-tests.tcl"
4 |
5 | test "Create a 5 nodes cluster" {
6 | create_cluster 5 5
7 | }
8 |
9 | test "Cluster should start ok" {
10 | assert_cluster_state ok
11 | }
12 |
13 | test "Killing two slave nodes" {
14 | kill_instance redis 5
15 | kill_instance redis 6
16 | }
17 |
18 | test "Cluster should be still up" {
19 | assert_cluster_state ok
20 | }
21 |
22 | test "Killing one master node" {
23 | kill_instance redis 0
24 | }
25 |
26 | # Note: the only slave of instance 0 is already down so no
27 | # failover is possible, that would change the state back to ok.
28 | test "Cluster should be down now" {
29 | assert_cluster_state fail
30 | }
31 |
32 | test "Restarting master node" {
33 | restart_instance redis 0
34 | }
35 |
36 | test "Cluster should be up again" {
37 | assert_cluster_state ok
38 | }
39 |
--------------------------------------------------------------------------------
/tests/cluster/tests/helpers/onlydots.tcl:
--------------------------------------------------------------------------------
1 | # Read the standard input and only shows dots in the output, filtering out
2 | # all the other characters. Designed to avoid bufferization so that when
3 | # we get the output of redis-trib and want to show just the dots, we'll see
4 | # the dots as soon as redis-trib will output them.
5 |
6 | fconfigure stdin -buffering none
7 |
8 | while 1 {
9 | set c [read stdin 1]
10 | if {$c eq {}} {
11 | exit 0; # EOF
12 | } elseif {$c eq {.}} {
13 | puts -nonewline .
14 | flush stdout
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/cluster/tmp/.gitignore:
--------------------------------------------------------------------------------
1 | redis_*
2 | sentinel_*
3 |
--------------------------------------------------------------------------------
/tests/helpers/bg_complex_data.tcl:
--------------------------------------------------------------------------------
1 | source tests/support/redis.tcl
2 | source tests/support/util.tcl
3 |
4 | set ::tlsdir "tests/tls"
5 |
6 | proc bg_complex_data {host port db ops tls} {
7 | set r [redis $host $port 0 $tls]
8 | $r client setname LOAD_HANDLER
9 | $r select $db
10 | createComplexDataset $r $ops
11 | }
12 |
13 | bg_complex_data [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3] [lindex $argv 4]
14 |
--------------------------------------------------------------------------------
/tests/helpers/gen_write_load.tcl:
--------------------------------------------------------------------------------
1 | source tests/support/redis.tcl
2 |
3 | set ::tlsdir "tests/tls"
4 |
5 | proc gen_write_load {host port seconds tls} {
6 | set start_time [clock seconds]
7 | set r [redis $host $port 1 $tls]
8 | $r client setname LOAD_HANDLER
9 | $r select 9
10 | while 1 {
11 | $r set [expr rand()] [expr rand()]
12 | if {[clock seconds]-$start_time > $seconds} {
13 | exit 0
14 | }
15 | }
16 | }
17 |
18 | gen_write_load [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3]
19 |
--------------------------------------------------------------------------------
/tests/sentinel/tests/04-slave-selection.tcl:
--------------------------------------------------------------------------------
1 | # Test slave selection algorithm.
2 | #
3 | # This unit should test:
4 | # 1) That when there are no suitable slaves no failover is performed.
5 | # 2) That among the available slaves, the one with better offset is picked.
6 |
--------------------------------------------------------------------------------
/tests/sentinel/tests/includes/sentinel.conf:
--------------------------------------------------------------------------------
1 | # assume master is down after being unresponsive for 20s
2 | sentinel down-after-milliseconds setmaster 20000
3 | # reconfigure one slave at a time
4 | sentinel parallel-syncs setmaster 2
5 | # wait for 4m before assuming failover went wrong
6 | sentinel failover-timeout setmaster 240000
7 | # monitoring set
8 | sentinel monitor setmaster 10.0.0.1 30000 2
9 |
10 |
--------------------------------------------------------------------------------
/tests/sentinel/tests/includes/start-init-tests.tcl:
--------------------------------------------------------------------------------
1 | test "(start-init) Flush config and compare rewrite config file lines" {
2 | foreach_sentinel_id id {
3 | assert_match "OK" [S $id SENTINEL FLUSHCONFIG]
4 | set file1 ../tests/includes/sentinel.conf
5 | set file2 [file join "sentinel_${id}" "sentinel.conf"]
6 | set fh1 [open $file1 r]
7 | set fh2 [open $file2 r]
8 | while {[gets $fh1 line1]} {
9 | if {[gets $fh2 line2]} {
10 | assert [string equal $line1 $line2]
11 | } else {
12 | fail "sentinel config file rewrite sequence changed"
13 | }
14 | }
15 | close $fh1
16 | close $fh2
17 | }
18 | }
--------------------------------------------------------------------------------
/tests/sentinel/tests/includes/utils.tcl:
--------------------------------------------------------------------------------
1 | proc restart_killed_instances {} {
2 | foreach type {redis sentinel} {
3 | foreach_${type}_id id {
4 | if {[get_instance_attrib $type $id pid] == -1} {
5 | puts -nonewline "$type/$id "
6 | flush stdout
7 | restart_instance $type $id
8 | }
9 | }
10 | }
11 | }
12 |
13 | proc verify_sentinel_auto_discovery {} {
14 | set sentinels [llength $::sentinel_instances]
15 | foreach_sentinel_id id {
16 | wait_for_condition 1000 50 {
17 | [dict get [S $id SENTINEL MASTER mymaster] num-other-sentinels] == ($sentinels-1)
18 | } else {
19 | fail "At least some sentinel can't detect some other sentinel"
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/tests/sentinel/tmp/.gitignore:
--------------------------------------------------------------------------------
1 | redis_*
2 | sentinel_*
3 |
--------------------------------------------------------------------------------
/tests/support/tmpfile.tcl:
--------------------------------------------------------------------------------
1 | set ::tmpcounter 0
2 | set ::tmproot "./tests/tmp"
3 | file mkdir $::tmproot
4 |
5 | # returns a dirname unique to this process to write to
6 | proc tmpdir {basename} {
7 | set dir [file join $::tmproot $basename.[pid].[incr ::tmpcounter]]
8 | file mkdir $dir
9 | set _ $dir
10 | }
11 |
12 | # return a filename unique to this process to write to
13 | proc tmpfile {basename} {
14 | file join $::tmproot $basename.[pid].[incr ::tmpcounter]
15 | }
16 |
--------------------------------------------------------------------------------
/tests/tmp/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/tests/unit/cluster/misc.tcl:
--------------------------------------------------------------------------------
1 | start_cluster 2 2 {tags {external:skip cluster}} {
2 | test {Key lazy expires during key migration} {
3 | R 0 DEBUG SET-ACTIVE-EXPIRE 0
4 |
5 | set key_slot [R 0 CLUSTER KEYSLOT FOO]
6 | R 0 set FOO BAR PX 10
7 | set src_id [R 0 CLUSTER MYID]
8 | set trg_id [R 1 CLUSTER MYID]
9 | R 0 CLUSTER SETSLOT $key_slot MIGRATING $trg_id
10 | R 1 CLUSTER SETSLOT $key_slot IMPORTING $src_id
11 | after 11
12 | assert_error {ASK*} {R 0 GET FOO}
13 | R 0 ping
14 | } {PONG}
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/tests/unit/limits.tcl:
--------------------------------------------------------------------------------
1 | start_server {tags {"limits network external:skip"} overrides {maxclients 10}} {
2 | if {$::tls} {
3 | set expected_code "*I/O error*"
4 | } else {
5 | set expected_code "*ERR max*reached*"
6 | }
7 | test {Check if maxclients works refusing connections} {
8 | set c 0
9 | catch {
10 | while {$c < 50} {
11 | incr c
12 | set rd [redis_deferring_client]
13 | $rd ping
14 | $rd read
15 | after 100
16 | }
17 | } e
18 | assert {$c > 8 && $c <= 10}
19 | set e
20 | } $expected_code
21 | }
22 |
--------------------------------------------------------------------------------
/tests/unit/moduleapi/eventloop.tcl:
--------------------------------------------------------------------------------
1 | set testmodule [file normalize tests/modules/eventloop.so]
2 |
3 | start_server {tags {"modules"}} {
4 | r module load $testmodule
5 |
6 | test "Module eventloop sendbytes" {
7 | assert_match "OK" [r test.sendbytes 5000000]
8 | assert_match "OK" [r test.sendbytes 2000000]
9 | }
10 |
11 | test "Module eventloop iteration" {
12 | set iteration [r test.iteration]
13 | set next_iteration [r test.iteration]
14 | assert {$next_iteration > $iteration}
15 | }
16 |
17 | test "Module eventloop sanity" {
18 | r test.sanity
19 | }
20 |
21 | test "Module eventloop oneshot" {
22 | r test.oneshot
23 | }
24 |
25 | test "Unload the module - eventloop" {
26 | assert_equal {OK} [r module unload eventloop]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tests/unit/moduleapi/infra.tcl:
--------------------------------------------------------------------------------
1 | set testmodule [file normalize tests/modules/infotest.so]
2 |
3 | test {modules config rewrite} {
4 |
5 | start_server {tags {"modules"}} {
6 | r module load $testmodule
7 |
8 | assert_equal [lindex [lindex [r module list] 0] 1] infotest
9 |
10 | r config rewrite
11 | restart_server 0 true false
12 |
13 | assert_equal [lindex [lindex [r module list] 0] 1] infotest
14 |
15 | assert_equal {OK} [r module unload infotest]
16 |
17 | r config rewrite
18 | restart_server 0 true false
19 |
20 | assert_equal [llength [r module list]] 0
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/tests/unit/moduleapi/mallocsize.tcl:
--------------------------------------------------------------------------------
1 | set testmodule [file normalize tests/modules/mallocsize.so]
2 |
3 |
4 | start_server {tags {"modules"}} {
5 | r module load $testmodule
6 |
7 | test {MallocSize of raw bytes} {
8 | assert_equal [r mallocsize.setraw key 40] {OK}
9 | assert_morethan [r memory usage key] 40
10 | }
11 |
12 | test {MallocSize of string} {
13 | assert_equal [r mallocsize.setstr key abcdefg] {OK}
14 | assert_morethan [r memory usage key] 7 ;# Length of "abcdefg"
15 | }
16 |
17 | test {MallocSize of dict} {
18 | assert_equal [r mallocsize.setdict key f1 v1 f2 v2] {OK}
19 | assert_morethan [r memory usage key] 8 ;# Length of "f1v1f2v2"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tests/unit/moduleapi/publish.tcl:
--------------------------------------------------------------------------------
1 | set testmodule [file normalize tests/modules/publish.so]
2 |
3 | start_server {tags {"modules"}} {
4 | r module load $testmodule
5 |
6 | test {PUBLISH and SPUBLISH via a module} {
7 | set rd1 [redis_deferring_client]
8 | set rd2 [redis_deferring_client]
9 |
10 | assert_equal {1} [ssubscribe $rd1 {chan1}]
11 | assert_equal {1} [subscribe $rd2 {chan1}]
12 | assert_equal 1 [r publish.shard chan1 hello]
13 | assert_equal 1 [r publish.classic chan1 world]
14 | assert_equal {smessage chan1 hello} [$rd1 read]
15 | assert_equal {message chan1 world} [$rd2 read]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/unit/moduleapi/zset.tcl:
--------------------------------------------------------------------------------
1 | set testmodule [file normalize tests/modules/zset.so]
2 |
3 | start_server {tags {"modules"}} {
4 | r module load $testmodule
5 |
6 | test {Module zset rem} {
7 | r del k
8 | r zadd k 100 hello 200 world
9 | assert_equal 1 [r zset.rem k hello]
10 | assert_equal 0 [r zset.rem k hello]
11 | assert_equal 1 [r exists k]
12 | # Check that removing the last element deletes the key
13 | assert_equal 1 [r zset.rem k world]
14 | assert_equal 0 [r exists k]
15 | }
16 |
17 | test "Unload the module - zset" {
18 | assert_equal {OK} [r module unload zset]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tests/unit/pendingquerybuf.tcl:
--------------------------------------------------------------------------------
1 | proc info_memory {r property} {
2 | if {[regexp "\r\n$property:(.*?)\r\n" [{*}$r info memory] _ value]} {
3 | set _ $value
4 | }
5 | }
6 |
7 | start_server {tags {"wait external:skip"}} {
8 | start_server {} {
9 | set slave [srv 0 client]
10 | set slave_host [srv 0 host]
11 | set slave_port [srv 0 port]
12 | set master [srv -1 client]
13 | set master_host [srv -1 host]
14 | set master_port [srv -1 port]
15 |
16 | test "pending querybuf: check size of pending_querybuf after set a big value" {
17 | $slave slaveof $master_host $master_port
18 | set _v [prepare_value [expr 32*1024*1024]]
19 | $master set key $_v
20 | wait_for_ofs_sync $master $slave
21 |
22 | wait_for_condition 50 100 {
23 | [info_memory $slave used_memory] <= [info_memory $master used_memory] + 10*1024*1024
24 | } else {
25 | fail "the used_memory of replica is much larger than master."
26 | }
27 | }
28 | }}
29 |
--------------------------------------------------------------------------------
/tests/unit/printver.tcl:
--------------------------------------------------------------------------------
1 | start_server {} {
2 | set i [r info]
3 | regexp {redis_version:(.*?)\r\n} $i - version
4 | regexp {redis_git_sha1:(.*?)\r\n} $i - sha1
5 | puts "Testing Redis version $version ($sha1)"
6 | }
7 |
--------------------------------------------------------------------------------
/tests/unit/type/list-common.tcl:
--------------------------------------------------------------------------------
1 | # We need a value larger than list-max-ziplist-value to make sure
2 | # the list has the right encoding when it is swapped in again.
3 | array set largevalue {}
4 | set largevalue(ziplist) "hello"
5 | set largevalue(linkedlist) [string repeat "hello" 4]
6 |
--------------------------------------------------------------------------------
/utils/build-static-symbols.tcl:
--------------------------------------------------------------------------------
1 | # Build a symbol table for static symbols of redis.c
2 | # Useful to get stack traces on segfault without a debugger. See redis.c
3 | # for more information.
4 | #
5 | # Copyright(C) 2009 Salvatore Sanfilippo, under the BSD license.
6 |
7 | set fd [open redis.c]
8 | set symlist {}
9 | while {[gets $fd line] != -1} {
10 | if {[regexp {^static +[A-z0-9]+[ *]+([A-z0-9]*)\(} $line - sym]} {
11 | lappend symlist $sym
12 | }
13 | }
14 | set symlist [lsort -unique $symlist]
15 | puts "static struct redisFunctionSym symsTable\[\] = {"
16 | foreach sym $symlist {
17 | puts "{\"$sym\",(unsigned long)$sym},"
18 | }
19 | puts "{NULL,0}"
20 | puts "};"
21 |
22 | close $fd
23 |
--------------------------------------------------------------------------------
/utils/create-cluster/.gitignore:
--------------------------------------------------------------------------------
1 | config.sh
2 | *.rdb
3 | *.aof
4 | *.conf
5 | *.log
6 | appendonlydir-*
7 |
--------------------------------------------------------------------------------
/utils/graphs/commits-over-time/README.md:
--------------------------------------------------------------------------------
1 | This Tcl script is what I used in order to generate the graph you
2 | can find at http://antirez.com/news/98. It's really quick & dirty, more
3 | a trow away program than anything else, but probably could be reused or
4 | modified in the future in order to visualize other similar data or an
5 | updated version of the same data.
6 |
7 | The usage is trivial:
8 |
9 | ./genhtml.tcl > output.html
10 |
11 | The generated HTML is quite broken but good enough to grab a screenshot
12 | from the browser. Feel free to improve it if you got time / interest.
13 |
14 | Note that the code filtering the tags, and the hardcoded branch name, does
15 | not make the script, as it is, able to analyze a different repository.
16 | However the changes needed are trivial.
17 |
--------------------------------------------------------------------------------
/utils/hyperloglog/.gitignore:
--------------------------------------------------------------------------------
1 | *.txt
2 |
--------------------------------------------------------------------------------
/utils/hyperloglog/hll-err.rb:
--------------------------------------------------------------------------------
1 | # hll-err.rb - Copyright (C) 2014 Salvatore Sanfilippo
2 | # BSD license, See the COPYING file for more information.
3 | #
4 | # Check error of HyperLogLog Redis implementation for different set sizes.
5 |
6 | require 'rubygems'
7 | require 'redis'
8 | require 'digest/sha1'
9 |
10 | r = Redis.new
11 | r.del('hll')
12 | i = 0
13 | while true do
14 | 100.times {
15 | elements = []
16 | 1000.times {
17 | ele = Digest::SHA1.hexdigest(i.to_s)
18 | elements << ele
19 | i += 1
20 | }
21 | r.pfadd('hll',elements)
22 | }
23 | approx = r.pfcount('hll')
24 | abs_err = (approx-i).abs
25 | rel_err = 100.to_f*abs_err/i
26 | puts "#{i} vs #{approx}: #{rel_err}%"
27 | end
28 |
--------------------------------------------------------------------------------
/utils/lru/README:
--------------------------------------------------------------------------------
1 | The test-lru.rb program can be used in order to check the behavior of the
2 | Redis approximated LRU algorithm against the theoretical output of true
3 | LRU algorithm.
4 |
5 | In order to use the program you need to recompile Redis setting the define
6 | REDIS_LRU_CLOCK_RESOLUTION to 1, by editing the file server.h.
7 | This allows to execute the program in a fast way since the 1 ms resolution
8 | is enough for all the objects to have a different enough time stamp during
9 | the test.
10 |
11 | The program is executed like this:
12 |
13 | ruby test-lru.rb /tmp/lru.html
14 |
15 | You can optionally specify a number of times to run, so that the program
16 | will output averages of different runs, by adding an additional argument.
17 | For instance in order to run the test 10 times use:
18 |
19 | ruby test-lru.rb /tmp/lru.html 10
20 |
--------------------------------------------------------------------------------
/utils/releasetools/01_create_tarball.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | if [ $# != "1" ]
3 | then
4 | echo "Usage: ./utils/releasetools/01_create_tarball.sh "
5 | exit 1
6 | fi
7 |
8 | TAG=$1
9 | TARNAME="redis-${TAG}.tar"
10 | echo "Generating /tmp/${TARNAME}"
11 | git archive $TAG --prefix redis-${TAG}/ > /tmp/$TARNAME || exit 1
12 | echo "Gizipping the archive"
13 | rm -f /tmp/$TARNAME.gz
14 | gzip -9 /tmp/$TARNAME
15 |
--------------------------------------------------------------------------------
/utils/releasetools/03_test_release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | if [ $# != "1" ]
4 | then
5 | echo "Usage: ./utils/releasetools/03_test_release.sh "
6 | exit 1
7 | fi
8 |
9 | TAG=$1
10 | TARNAME="redis-${TAG}.tar.gz"
11 | DOWNLOADURL="http://download.redis.io/releases/${TARNAME}"
12 |
13 | echo "Doing sanity test on the actual tarball"
14 |
15 | cd /tmp
16 | rm -rf test_release_tmp_dir
17 | mkdir test_release_tmp_dir
18 | cd test_release_tmp_dir
19 | rm -f $TARNAME
20 | rm -rf redis-${TAG}
21 | wget $DOWNLOADURL
22 | tar xvzf $TARNAME
23 | cd redis-${TAG}
24 | make
25 | ./runtest
26 | ./runtest-sentinel
27 | ./runtest-cluster
28 | ./runtest-moduleapi
29 |
--------------------------------------------------------------------------------
/utils/releasetools/04_release_hash.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [ $# != "1" ]
3 | then
4 | echo "Usage: ./utils/releasetools/04_release_hash.sh "
5 | exit 1
6 | fi
7 |
8 | SHA=$(curl -s http://download.redis.io/releases/redis-${1}.tar.gz | shasum -a 256 | cut -f 1 -d' ')
9 | ENTRY="hash redis-${1}.tar.gz sha256 $SHA http://download.redis.io/releases/redis-${1}.tar.gz"
10 | echo $ENTRY >> ../redis-hashes/README
11 | echo "Press any key to commit, Ctrl-C to abort)."
12 | read yes
13 | (cd ../redis-hashes; git commit -a -m "${1} hash."; git push)
14 |
--------------------------------------------------------------------------------
/utils/srandmember/README.md:
--------------------------------------------------------------------------------
1 | The utilities in this directory plot the distribution of SRANDMEMBER to
2 | evaluate how fair it is.
3 |
4 | See http://theshfl.com/redis_sets for more information on the topic that lead
5 | to such investigation fix.
6 |
7 | showdist.rb -- shows the distribution of the frequency elements are returned.
8 | The x axis is the number of times elements were returned, and
9 | the y axis is how many elements were returned with such
10 | frequency.
11 |
12 | showfreq.rb -- shows the frequency each element was returned.
13 | The x axis is the element number.
14 | The y axis is the times it was returned.
15 |
--------------------------------------------------------------------------------
/utils/srandmember/showdist.rb:
--------------------------------------------------------------------------------
1 | require 'redis'
2 |
3 | r = Redis.new
4 | r.select(9)
5 | r.del("myset");
6 | r.sadd("myset",(0..999).to_a)
7 | freq = {}
8 | 100.times {
9 | res = r.pipelined {
10 | 1000.times {
11 | r.srandmember("myset")
12 | }
13 | }
14 | res.each{|ele|
15 | freq[ele] = 0 if freq[ele] == nil
16 | freq[ele] += 1
17 | }
18 | }
19 |
20 | # Convert into frequency distribution
21 | dist = {}
22 | freq.each{|item,count|
23 | dist[count] = 0 if dist[count] == nil
24 | dist[count] += 1
25 | }
26 |
27 | min = dist.keys.min
28 | max = dist.keys.max
29 | (min..max).each{|x|
30 | count = dist[x]
31 | count = 0 if count == nil
32 | puts "#{x} -> #{"*"*count}"
33 | }
34 |
--------------------------------------------------------------------------------
/utils/srandmember/showfreq.rb:
--------------------------------------------------------------------------------
1 | require 'redis'
2 |
3 | r = Redis.new
4 | r.select(9)
5 | r.del("myset");
6 | r.sadd("myset",(0..999).to_a)
7 | freq = {}
8 | 500.times {
9 | res = r.pipelined {
10 | 1000.times {
11 | r.srandmember("myset")
12 | }
13 | }
14 | res.each{|ele|
15 | freq[ele] = 0 if freq[ele] == nil
16 | freq[ele] += 1
17 | }
18 | }
19 |
20 | # Print the frequency each element was yield to process it with gnuplot
21 | freq.each{|item,count|
22 | puts "#{item} #{count}"
23 | }
24 |
--------------------------------------------------------------------------------
/utils/whatisdoing.sh:
--------------------------------------------------------------------------------
1 | # This script is from http://poormansprofiler.org/
2 | #
3 | # NOTE: Instead of using this script, you should use the Redis
4 | # Software Watchdog, which provides a similar functionality but in
5 | # a more reliable / easy to use way.
6 | #
7 | # Check https://redis.io/topics/latency for more information.
8 |
9 | #!/bin/bash
10 | nsamples=1
11 | sleeptime=0
12 | pid=$(ps auxww | grep '[r]edis-server' | awk '{print $2}')
13 |
14 | for x in $(seq 1 $nsamples)
15 | do
16 | gdb -ex "set pagination 0" -ex "thread apply all bt" -batch -p $pid
17 | sleep $sleeptime
18 | done | \
19 | awk '
20 | BEGIN { s = ""; }
21 | /Thread/ { print s; s = ""; }
22 | /^\#/ { if (s != "" ) { s = s "," $4} else { s = $4 } }
23 | END { print s }' | \
24 | sort | uniq -c | sort -r -n -k 1,1
25 |
--------------------------------------------------------------------------------