Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
afe0b16c
Commit
afe0b16c
authored
Feb 16, 2020
by
Oran Agra
Committed by
antirez
Mar 05, 2020
Browse files
module api docs for aux_save and aux_load
parent
df152b0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
afe0b16c
...
...
@@ -3529,6 +3529,8 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
* // Optional fields
* .digest = myType_DigestCallBack,
* .mem_usage = myType_MemUsageCallBack,
* .aux_load = myType_AuxRDBLoadCallBack,
* .aux_save = myType_AuxRDBSaveCallBack,
* }
*
* * **rdb_load**: A callback function pointer that loads data from RDB files.
...
...
@@ -3536,6 +3538,10 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
* * **aof_rewrite**: A callback function pointer that rewrites data as commands.
* * **digest**: A callback function pointer that is used for `DEBUG DIGEST`.
* * **free**: A callback function pointer that can free a type value.
* * **aux_save**: A callback function pointer that saves out of keyspace data to RDB files.
* 'when' argument is either REDISMODULE_AUX_BEFORE_RDB or REDISMODULE_AUX_AFTER_RDB.
* * **aux_load**: A callback function pointer that loads out of keyspace data from RDB files.
* Similar to aux_save, returns REDISMODULE_OK on success, and ERR otherwise.
*
* The **digest* and **mem_usage** methods should currently be omitted since
* they are not yet implemented inside the Redis modules core.
...
...
src/rdb.c
View file @
afe0b16c
...
...
@@ -2195,7 +2195,7 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
io
.
ver
=
2
;
/* Call the rdb_load method of the module providing the 10 bit
* encoding version in the lower 10 bits of the module ID. */
if
(
mt
->
aux_load
(
&
io
,
moduleid
&
1023
,
when
)
||
io
.
error
)
{
if
(
mt
->
aux_load
(
&
io
,
moduleid
&
1023
,
when
)
!=
REDISMODULE_OK
||
io
.
error
)
{
moduleTypeNameByID
(
name
,
moduleid
);
serverLog
(
LL_WARNING
,
"The RDB file contains module AUX data for the module type '%s', that the responsible module is not able to load. Check for modules log above for additional clues."
,
name
);
exit
(
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment