mirror of
https://github.com/fluencelabs/redis
synced 2025-06-17 11:11:20 +00:00
Modules: first preview 31 March 2016.
This commit is contained in:
17
src/server.c
17
src/server.c
@ -123,6 +123,7 @@ struct redisServer server; /* server global state */
|
||||
* are not fast commands.
|
||||
*/
|
||||
struct redisCommand redisCommandTable[] = {
|
||||
{"module",moduleCommand,-2,"as",0,NULL,1,1,1,0,0},
|
||||
{"get",getCommand,2,"rF",0,NULL,1,1,1,0,0},
|
||||
{"set",setCommand,-3,"wm",0,NULL,1,1,1,0,0},
|
||||
{"setnx",setnxCommand,3,"wmF",0,NULL,1,1,1,0,0},
|
||||
@ -648,6 +649,18 @@ dictType clusterNodesBlackListDictType = {
|
||||
NULL /* val destructor */
|
||||
};
|
||||
|
||||
/* Cluster re-addition blacklist. This maps node IDs to the time
|
||||
* we can re-add this node. The goal is to avoid readding a removed
|
||||
* node for some time. */
|
||||
dictType modulesDictType = {
|
||||
dictSdsCaseHash, /* hash function */
|
||||
NULL, /* key dup */
|
||||
NULL, /* val dup */
|
||||
dictSdsKeyCaseCompare, /* key compare */
|
||||
dictSdsDestructor, /* key destructor */
|
||||
NULL /* val destructor */
|
||||
};
|
||||
|
||||
/* Migrate cache dict type. */
|
||||
dictType migrateCacheDictType = {
|
||||
dictSdsHash, /* hash function */
|
||||
@ -2238,6 +2251,7 @@ void call(client *c, int flags) {
|
||||
/* Initialization: clear the flags that must be set by the command on
|
||||
* demand, and initialize the array for additional commands propagation. */
|
||||
c->flags &= ~(CLIENT_FORCE_AOF|CLIENT_FORCE_REPL|CLIENT_PREVENT_PROP);
|
||||
redisOpArray prev_also_propagate = server.also_propagate;
|
||||
redisOpArrayInit(&server.also_propagate);
|
||||
|
||||
/* Call the command. */
|
||||
@ -2333,6 +2347,7 @@ void call(client *c, int flags) {
|
||||
}
|
||||
redisOpArrayFree(&server.also_propagate);
|
||||
}
|
||||
server.also_propagate = prev_also_propagate;
|
||||
server.stat_numcommands++;
|
||||
}
|
||||
|
||||
@ -3993,6 +4008,7 @@ int main(int argc, char **argv) {
|
||||
dictSetHashFunctionSeed(tv.tv_sec^tv.tv_usec^getpid());
|
||||
server.sentinel_mode = checkForSentinelMode(argc,argv);
|
||||
initServerConfig();
|
||||
moduleInitModulesSystem();
|
||||
|
||||
/* Store the executable path and arguments in a safe place in order
|
||||
* to be able to restart the server later. */
|
||||
@ -4099,6 +4115,7 @@ int main(int argc, char **argv) {
|
||||
#ifdef __linux__
|
||||
linuxMemoryWarnings();
|
||||
#endif
|
||||
moduleLoadFromQueue();
|
||||
loadDataFromDisk();
|
||||
if (server.cluster_enabled) {
|
||||
if (verifyClusterConfigWithData() == C_ERR) {
|
||||
|
Reference in New Issue
Block a user