Oran Agra
deebed23e1
Adding RM_ServerInfoGetFieldC
2019-11-04 07:57:52 +02:00
Oran Agra
87332ce524
Module API for PUBLISH, FLUSHALL, RANDOMKEY, DBSIZE
2019-11-04 07:40:52 +02:00
Oran Agra
779aebc91c
Module API for loading and saving long double
...
looks like each platform implements long double differently (different bit count)
so we can't save them as binary, and we also want to avoid creating a new RDB
format version, so we save these are hex strings using "%La".
This commit includes a change in the arguments of ld2string to support this.
as well as tests for coverage and short reads.
coded by @guybe7
2019-11-03 16:42:31 +02:00
Oran Agra
4d580438b0
Add module api for looking into INFO fields
...
- Add RM_GetServerInfo and friends
- Add auto memory for new opaque struct
- Add tests for new APIs
other minor fixes:
- add const in various char pointers
- requested_section in modulesCollectInfo was actually not sds but char*
- extract new string2d out of getDoubleFromObject for code reuse
Add module API for
2019-11-03 15:02:25 +02:00
antirez
1ee195d255
Merge branch 'unstable' of github.com:/antirez/redis into unstable
2019-10-31 17:55:18 +01:00
antirez
91f4bdc9f9
Modules: block on keys: use a better interface.
...
Using the is_key_ready() callback plus the reply callback later, creates
different issues AFAIK:
1. More complex API.
2. We need to call the reply callback() ASAP if the is_key_ready()
interface returned success, however the internals do not work in that
way, so when the reply callback is called the setup could be different.
To fix that, there is to break the current design that handles the
unblocked clients asyncrhonously, and run the list ASAP.
2019-10-31 11:35:07 +01:00
antirez
fb6110ac20
Modules: block on keys: export APIs.
2019-10-30 10:20:28 +01:00
Oran Agra
51c3ff8d75
Modules hooks: complete missing hooks for the initial set of hooks
...
* replication hooks: role change, master link status, replica online/offline
* persistence hooks: saving, loading, loading progress
* misc hooks: cron loop, shutdown, module loaded/unloaded
* change the way hooks test work, and add tests for all of the above
startLoading() now gets flag indicating what is loaded.
stopLoading() now gets an indication of success or failure.
adding startSaving() and stopSaving() with similar args and role.
2019-10-29 17:59:09 +02:00
Oran Agra
e978bdf9ef
Module API for controlling LRU and LFU, and OpenKey without TOUCH
...
Some commands would want to open a key without touching it's LRU/LFU
similarly to the OBJECT or DEBUG command do.
Other commands may want to implement logic similar to what RESTORE
does (and in the future MIGRATE) and get/set the LRU or LFU.
2019-10-29 15:03:05 +02:00
Salvatore Sanfilippo
764b420f5f
Merge pull request #6487 from oranagra/module_modified_key
...
Module API for explicit SignalModifiedKey instead of implicit one.
2019-10-29 10:40:22 +01:00
Salvatore Sanfilippo
94973fd0eb
Merge pull request #6508 from guybe7/fix_module_notify_comp_error
...
Fix compilation error introduced by cee6dead3
2019-10-29 10:07:45 +01:00
Salvatore Sanfilippo
90169cdf16
Merge pull request #6495 from oranagra/rm_call_argv
...
Module api RM_CallArgv and test
2019-10-29 10:07:05 +01:00
Guy Benoish
43e2a398f9
Fix compilation error introduced by cee6dead3
...
Need to add calls to REDISMODULE_API_FUNC...
2019-10-28 17:58:07 +05:30
Oran Agra
0399b5a27e
Module api tests for RM_Call
...
Adding a test for coverage for RM_Call in a new "misc" unit
to be used for various short simple tests
also solves compilation warnings in redismodule.h and fork.c
2019-10-28 12:39:57 +02:00
Guy Benoish
cee6dead3c
Modules: Allow notifying custom keyspace events
...
Also, add an API for getting server.notify_keyspace_events
Other (unrelated) changes:
Add RM_GetKeynameFromModuleKey
2019-10-28 15:53:35 +05:30
Oran Agra
a12f07792f
Module API for explicit SignalModifiedKey instead of implicit one.
...
This commit also fixes an uninitialized module struct member (that luckily never got released)
2019-10-28 12:09:25 +02:00
Salvatore Sanfilippo
5aab012676
Merge pull request #6498 from oranagra/rm_latency_add_sample
...
Module API for LatencyAddSample
2019-10-28 09:59:26 +01:00
swilly22
56a7c45521
Introduce ReplyWithVerbatimString, ReplyWithEmptyArray, ReplyWithNullArray and ReplyWithEmptyString to redis module API
2019-10-28 08:50:25 +02:00
Oran Agra
e3b1d6d3ad
Module API for LatencyAddSample
2019-10-24 14:24:55 +03:00
antirez
ed833c9f99
Modules hooks: implement the FLUSHDB event.
2019-10-23 18:39:53 +02:00
antirez
8ec2fc3969
Modules hooks: unify structures definitions.
2019-10-23 18:39:53 +02:00
antirez
18d1607f5e
Modules hooks: document what yet to implement WIP 1.
2019-10-23 18:39:53 +02:00
antirez
cf52e0ad44
Module hooks: fixes and an example module.
2019-10-23 18:39:53 +02:00
antirez
019ac37e9c
Modules hooks: fix define / linker issues. Implement one test event.
2019-10-23 18:39:53 +02:00
antirez
d54652682d
Modules hooks: handle module unloading + API export.
2019-10-23 18:39:53 +02:00
antirez
b9af7e24e4
Modules hooks: event firing logic.
2019-10-23 18:39:53 +02:00
antirez
e9b5484ddd
Modules: export GetClientInfoById().
2019-10-23 18:39:53 +02:00
antirez
d2d74ca0f3
Modules: RM_GetClientInfoById() draft.
2019-10-23 18:39:53 +02:00
antirez
bebb2e1994
Modules hooks: a first version of events and some API.
2019-10-23 18:39:53 +02:00
antirez
97f6e314c1
Modules: allow to check for AOF loading client.
2019-10-17 18:10:50 +02:00
antirez
8651e6a10d
Modules: add new flags to context, replica state + more.
2019-10-17 17:49:33 +02:00
Oran Agra
d5c14c70b7
Merge remote-tracking branch 'antirez/unstable' into modules_info
2019-09-30 20:47:35 +03:00
Salvatore Sanfilippo
6129758558
Merge branch 'unstable' into modules_fork
2019-09-27 11:24:06 +02:00
Salvatore Sanfilippo
959fb5cf68
Merge pull request #6235 from oranagra/module_rdb_load_errors
...
Allow modules to handle RDB loading errors.
2019-09-26 11:52:42 +02:00
Salvatore Sanfilippo
b0a90d8fa8
Merge pull request #4980 from yossigo/rm-assert
...
Add RedisModule_Assert() API call.
2019-09-26 11:39:29 +02:00
Oran Agra
1d6e5dc4dc
Module INFO, add support for dict fields, rename API to have common prefix
2019-08-18 09:41:45 +03:00
Oran Agra
e5187ad2ae
Merge remote-tracking branch 'oss/unstable' into module_rdb_load_errors
2019-07-30 15:14:08 +03:00
Oran Agra
4339706e07
Avoid diskelss-load if modules did not declare they handle read errors
2019-07-30 15:11:57 +03:00
Oran Agra
e91d9a6fff
Extend modules API to allow modules report to redis INFO
...
this implements #6012
2019-07-24 12:58:15 +03:00
Oran Agra
3b6aeea44c
Implement module api for aux data in rdb
...
Other changes:
* fix memory leak in error handling of rdb loading of type OBJ_MODULE
2019-07-22 21:15:33 +03:00
Oran Agra
d7d028a7a7
Allow modules to handle RDB loading errors.
...
This is especially needed in diskless loading, were a short read could have
caused redis to exit. now the module can handle the error and return to the
caller gracefully.
this fixes #5326
2019-07-21 18:19:32 +03:00
Oran Agra
56258c6b7d
Module API for Forking
...
* create module API for forking child processes.
* refactor duplicate code around creating and tracking forks by AOF and RDB.
* child processes listen to SIGUSR1 and dies exitFromChild in order to
eliminate a valgrind warning of unhandled signal.
* note that BGSAVE error reply has changed.
valgrind error is:
Process terminating with default action of signal 10 (SIGUSR1)
2019-07-17 16:40:24 +03:00
Salvatore Sanfilippo
677e95e2f5
Merge pull request #6161 from swilly22/redismodule-loading-ctx-flag
...
Extend REDISMODULE_CTX_FLAGS to indicate if redis is loading
2019-07-07 17:01:29 +02:00
swilly22
f54d95e803
Extend REDISMODULE_CTX_FLAGS to indicate if redis is currently loading from either RDB or AOF
2019-06-12 15:37:19 +03:00
Itamar Haber
26d9d4ec2c
Adds RedisModule_ReplyWithCString
...
Signed-off-by: Itamar Haber <itamar@redislabs.com>
2019-04-16 17:15:23 +03:00
Salvatore Sanfilippo
5e8caca036
Merge pull request #5944 from yossigo/command-filtering
...
Command Filtering API
2019-03-22 17:43:49 +01:00
Salvatore Sanfilippo
122f42844a
Merge pull request #5945 from dvirsky/miss_notification
...
Added keyspace miss notifications support
2019-03-22 17:41:00 +01:00
Yossi Gottlieb
6c0a5fde3d
CommandFilter API: REDISMODULE_CMDFILTER_NOSELF.
...
Add a flag to automatically protect filters from being called
recursively by their own module.
2019-03-21 19:53:12 +02:00
Yossi Gottlieb
e2626f69ec
CommandFilter API: Add unregister option.
...
A filter handle is returned and can be used to unregister a filter. In
the future it can also be used to further configure or manipulate the
filter.
Filters are now automatically unregistered when a module unloads.
2019-03-21 14:44:49 +02:00
Dvir Volk
4a0ee5c6ac
Added missing REDISMODULE_NOTIFY_KEY_MISS flag to REDISMODULE_NOTIFY_ALL
2019-03-21 12:47:51 +02:00
Dvir Volk
99c2fe0bcf
added special flag for keyspace miss notifications
2019-03-21 11:47:14 +02:00
Yossi Gottlieb
2a5aeef79f
CommandFilter API: More cleanup.
2019-03-18 23:05:52 +02:00
Yossi Gottlieb
6711132083
Add command filtering argument handling API.
2019-03-18 18:36:46 +02:00
Yossi Gottlieb
c3e187190b
Initial command filter experiment.
2019-03-18 13:50:34 +02:00
Yossi Gottlieb
a88264d934
Add RedisModule_GetKeyNameFromIO().
2019-03-15 10:23:27 +02:00
Yossi Gottlieb
68fd59056b
Add RedisModule_Assert() API call.
2019-03-14 15:00:31 +02:00
antirez
6fd4af1f12
Merge branch 'sharedapi' into unstable
2019-03-14 11:24:48 +01:00
swilly22
468860ae18
Extend REDISMODULE_CTX_FLAGS to indicate if command was sent by master
2019-03-11 10:02:19 +02:00
antirez
8a87de130f
Modules shared API: export new core APIs.
2018-12-20 17:57:49 +01:00
antirez
850b64c116
Revert shared APIs to modify the design.
2018-12-20 17:56:38 +01:00
MeirShpilraien
ab37289fa6
added module ability to register api to be used by other modules
2018-12-20 17:55:18 +01:00
antirez
0aecb135c9
Modules: Modules: dictionary API WIP #13 : Compare API exported.
2018-09-27 11:46:22 +02:00
antirez
1e585d01de
Modules: dictionary API WIP #10 : export API to modules.
2018-09-26 13:39:01 +02:00
antirez
c5e0bc1070
Modules: dictionary API work in progress #1 .
2018-09-21 17:54:09 +02:00
antirez
3213e8de92
Module cluster flags: add RM_SetClusterFlags() API.
2018-09-19 12:02:37 +02:00
antirez
744fe7f348
Module cluster flags: initial vars / defines added.
2018-09-19 11:20:52 +02:00
antirez
e07af6a2b7
Modules API: Add call to get the blocked client handle from the context.
...
This is useful in the reply and timeout callback, if the module wants to
do some cleanup of the blocked client handle that may be stored around
in the module-private data structures.
2018-04-13 13:48:11 +02:00
antirez
404160a271
Modules API: blocked client disconnection callback.
2018-04-12 13:21:48 +02:00
antirez
0afac6939a
Modules API: OOM_WARNING flags.
...
In some modules it may be useful to have an idea about being near to
OOM. Anyway additionally an explicit call to get the fill ratio will be
added in the future.
2018-04-11 16:22:52 +02:00
antirez
f97efe0cac
Modules: context flags now include OOM flag.
...
Plus freeMemoryIfNeeded() refactoring to improve legibility.
Please review this commit for sanity.
2018-04-09 17:44:30 +02:00
antirez
9a0dbbb594
Modules: remove trailing empty spaces.
2018-04-09 17:16:55 +02:00
antirez
eaafea4828
Modules API: experimental APIs version.
...
This way it is possible to use conditional compilation to be compatible
with a larger amount of Redis versions, however note that this breaks
binary compatibiltiy, so the module must be compiled with the
corresponding redismodule.h file depending on the version of Redis
targeted.
2018-04-09 12:17:19 +02:00
antirez
49e098234a
Modules API: blocked client free callback modified to get a context.
...
Note that this was an experimental API that can only be enabled with
REIDSMODULE_EXPERIMENTAL_API, so it is subject to change until its
promoted to stable API. Sorry for the breakage, it is trivial to
resolve btw. This change will not be back ported to Redis 4.0.
2018-04-09 11:54:44 +02:00
antirez
b2868c7b9c
Modules API: RM_GetRandomBytes() / GetRandomHexChars().
2018-04-05 13:24:22 +02:00
antirez
c75582889a
Modules Cluster API: GetClusterSize() added.
2018-04-01 16:36:32 +02:00
antirez
27f9c8108c
Modules Cluster API: GetMyClusterID() added.
2018-04-01 16:20:57 +02:00
antirez
2f7da0fd1a
Modules Timer API: fix infinite loop and export API.
2018-03-31 00:44:46 +02:00
antirez
561039c125
Modules Timer API: initial implementation.
2018-03-30 20:40:35 +02:00
antirez
192361b562
Modules Cluster API: node API exported, example improved.
2018-03-30 17:00:45 +02:00
antirez
16178b692e
Modules Cluster API: nodes list and info API.
2018-03-30 16:16:47 +02:00
antirez
83ec35770e
Modules Cluster API: node information struct and flags.
2018-03-30 13:16:55 +02:00
antirez
a97df1a6e1
Modules Cluster API: make node IDs pointers constant.
2018-03-30 13:16:07 +02:00
antirez
82004f9dbe
Modules Cluster API: fix new API calls exporting.
2018-03-30 12:49:16 +02:00
antirez
b4dc782e4e
Modules Cluster API: sending / receiving API first implementation.
2018-03-30 11:06:08 +02:00
Dvir Volk
10efdf307b
Add REDISMODULE_NOTIFY_STREAM flag to support stream notifications
2018-02-14 21:50:42 +02:00
Dvir Volk
2136035e47
finished implementation of notifications. Tests unfinished
2018-02-14 21:38:58 +02:00
Mark Nunberg
062bd733da
redismodule.h: Check ModuleNameBusy before calling it
...
Older versions might not have this function.
2018-01-23 10:49:18 -05:00
Dvir Volk
e76dfc90a7
Added RM_UnlinkKey - a low level analog to UNLINK command
2018-01-07 16:41:43 +02:00
Salvatore Sanfilippo
f739c27229
Merge pull request #4344 from soloestoy/fix-module-name-conflict
...
Fix module name conflict
2017-11-24 09:37:06 +01:00
zhaozhao.zz
6dffc1b7a3
Modules: handle the busy module name
2017-09-28 17:38:40 +08:00
Dvir Volk
b246635d6d
Renamed GetCtxFlags to GetContextFlags
2017-09-27 11:58:16 +03:00
Dvir Volk
616c546b01
Added support for module context flags with RM_GetCtxFlags
2017-09-27 11:58:07 +03:00
antirez
8eefc9323d
Allow certain modules APIs only defining REDISMODULE_EXPERIMENTAL_API.
...
Those calls may be subject to changes in the future, so the user should
acknowledge it is using non stable API.
2017-07-14 12:07:52 +02:00
antirez
51ffd062d3
Modules: DEBUG DIGEST interface.
2017-07-06 11:04:46 +02:00
antirez
ba4a5a3255
Modules TSC: Export symbols of the new API.
2017-05-02 15:19:28 +02:00
antirez
636c693f44
Use const in modules types mem_usage method.
...
As suggested by @itamarhaber.
2017-01-12 12:47:46 +01:00
Yossi Gottlieb
5f5b4f1508
Fix typo in RedisModuleTypeMethods declaration.
2016-11-30 22:05:59 +02:00
antirez
71e8d15e49
Modules: change type registration API to use a struct of methods.
2016-11-30 11:14:01 +01:00
antirez
95c17c0cb2
Modules: AbortBlock() API implemented.
2016-10-13 16:57:40 +02:00
antirez
f156038db8
Modules: RM_Milliseconds() API added.
2016-10-07 16:34:19 +02:00