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
5bfba06a
Unverified
Commit
5bfba06a
authored
Feb 06, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Feb 06, 2020
Browse files
Merge pull request #6821 from guybe7/key_miss_notify
Exclude "keymiss" notification from NOTIFY_ALL
parents
2e1dd00c
2fda5f5c
Changes
5
Hide whitespace changes
Inline
Side-by-side
redis.conf
View file @
5bfba06a
...
...
@@ -1361,7 +1361,11 @@ latency-monitor-threshold 0
# z Sorted set commands
# x Expired events (events generated every time a key expires)
# e Evicted events (events generated when a key is evicted for maxmemory)
# A Alias for g$lshzxe, so that the "AKE" string means all the events.
# t Stream commands
# m Key-miss events (Note: It is not included in the 'A' class)
# A Alias for g$lshzxet, so that the "AKE" string means all the events
# (Except key-miss events which are excluded from 'A' due to their
# unique nature).
#
# The "notify-keyspace-events" takes as argument a string that is composed
# of zero or multiple characters. The empty string means that notifications
...
...
src/module.c
View file @
5bfba06a
...
...
@@ -4807,7 +4807,8 @@ void moduleReleaseGIL(void) {
* - REDISMODULE_NOTIFY_EXPIRED: Expiration events
* - REDISMODULE_NOTIFY_EVICTED: Eviction events
* - REDISMODULE_NOTIFY_STREAM: Stream events
* - REDISMODULE_NOTIFY_ALL: All events
* - REDISMODULE_NOTIFY_KEYMISS: Key-miss events
* - REDISMODULE_NOTIFY_ALL: All events (Excluding REDISMODULE_NOTIFY_KEYMISS)
*
* We do not distinguish between key events and keyspace events, and it is up
* to the module to filter the actions taken based on the key.
...
...
src/notify.c
View file @
5bfba06a
...
...
@@ -82,10 +82,10 @@ sds keyspaceEventsFlagsToString(int flags) {
if
(
flags
&
NOTIFY_EXPIRED
)
res
=
sdscatlen
(
res
,
"x"
,
1
);
if
(
flags
&
NOTIFY_EVICTED
)
res
=
sdscatlen
(
res
,
"e"
,
1
);
if
(
flags
&
NOTIFY_STREAM
)
res
=
sdscatlen
(
res
,
"t"
,
1
);
if
(
flags
&
NOTIFY_KEY_MISS
)
res
=
sdscatlen
(
res
,
"m"
,
1
);
}
if
(
flags
&
NOTIFY_KEYSPACE
)
res
=
sdscatlen
(
res
,
"K"
,
1
);
if
(
flags
&
NOTIFY_KEYEVENT
)
res
=
sdscatlen
(
res
,
"E"
,
1
);
if
(
flags
&
NOTIFY_KEY_MISS
)
res
=
sdscatlen
(
res
,
"m"
,
1
);
return
res
;
}
...
...
src/redismodule.h
View file @
5bfba06a
...
...
@@ -127,8 +127,8 @@
#define REDISMODULE_NOTIFY_EXPIRED (1<<8)
/* x */
#define REDISMODULE_NOTIFY_EVICTED (1<<9)
/* e */
#define REDISMODULE_NOTIFY_STREAM (1<<10)
/* t */
#define REDISMODULE_NOTIFY_KEY_MISS (1<<11)
/* m */
#define REDISMODULE_NOTIFY_ALL (REDISMODULE_NOTIFY_GENERIC | REDISMODULE_NOTIFY_STRING | REDISMODULE_NOTIFY_LIST | REDISMODULE_NOTIFY_SET | REDISMODULE_NOTIFY_HASH | REDISMODULE_NOTIFY_ZSET | REDISMODULE_NOTIFY_EXPIRED | REDISMODULE_NOTIFY_EVICTED | REDISMODULE_NOTIFY_STREAM
| REDISMODULE_NOTIFY_KEY_MISS
)
/* A */
#define REDISMODULE_NOTIFY_KEY_MISS (1<<11)
/* m
(Note: This one is excluded from REDISMODULE_NOTIFY_ALL on purpose)
*/
#define REDISMODULE_NOTIFY_ALL (REDISMODULE_NOTIFY_GENERIC | REDISMODULE_NOTIFY_STRING | REDISMODULE_NOTIFY_LIST | REDISMODULE_NOTIFY_SET | REDISMODULE_NOTIFY_HASH | REDISMODULE_NOTIFY_ZSET | REDISMODULE_NOTIFY_EXPIRED | REDISMODULE_NOTIFY_EVICTED | REDISMODULE_NOTIFY_STREAM)
/* A */
/* A special pointer that we can use between the core and the module to signal
...
...
src/server.h
View file @
5bfba06a
...
...
@@ -413,8 +413,8 @@ typedef long long ustime_t; /* microsecond time type. */
#define NOTIFY_EXPIRED (1<<8)
/* x */
#define NOTIFY_EVICTED (1<<9)
/* e */
#define NOTIFY_STREAM (1<<10)
/* t */
#define NOTIFY_KEY_MISS (1<<11)
/* m */
#define NOTIFY_ALL (NOTIFY_GENERIC | NOTIFY_STRING | NOTIFY_LIST | NOTIFY_SET | NOTIFY_HASH | NOTIFY_ZSET | NOTIFY_EXPIRED | NOTIFY_EVICTED | NOTIFY_STREAM
| NOTIFY_KEY_MISS
)
/* A flag */
#define NOTIFY_KEY_MISS (1<<11)
/* m
(Note: This one is excluded from NOTIFY_ALL on purpose)
*/
#define NOTIFY_ALL (NOTIFY_GENERIC | NOTIFY_STRING | NOTIFY_LIST | NOTIFY_SET | NOTIFY_HASH | NOTIFY_ZSET | NOTIFY_EXPIRED | NOTIFY_EVICTED | NOTIFY_STREAM)
/* A flag */
/* Get the first bind addr or NULL */
#define NET_FIRST_BIND_ADDR (server.bindaddr_count ? server.bindaddr[0] : NULL)
...
...
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