Fix typos
This commit is contained in:
parent
cbaf3c5bba
commit
5fcaa818ca
4
src/ae.c
4
src/ae.c
|
@ -457,7 +457,7 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags)
|
|||
int fired = 0; /* Number of events fired for current fd. */
|
||||
|
||||
/* Normally we execute the readable event first, and the writable
|
||||
* event laster. This is useful as sometimes we may be able
|
||||
* event later. This is useful as sometimes we may be able
|
||||
* to serve the reply of a query immediately after processing the
|
||||
* query.
|
||||
*
|
||||
|
@ -465,7 +465,7 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags)
|
|||
* asking us to do the reverse: never fire the writable event
|
||||
* after the readable. In such a case, we invert the calls.
|
||||
* This is useful when, for instance, we want to do things
|
||||
* in the beforeSleep() hook, like fsynching a file to disk,
|
||||
* in the beforeSleep() hook, like fsyncing a file to disk,
|
||||
* before replying to a client. */
|
||||
int invert = fe->mask & AE_BARRIER;
|
||||
|
||||
|
|
|
@ -1818,7 +1818,7 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
|
|||
"Background AOF rewrite terminated with error");
|
||||
} else {
|
||||
/* SIGUSR1 is whitelisted, so we have a way to kill a child without
|
||||
* tirggering an error condition. */
|
||||
* triggering an error condition. */
|
||||
if (bysignal != SIGUSR1)
|
||||
server.aof_lastbgrewrite_status = C_ERR;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*
|
||||
* Never use return value from the macros, instead use the AtomicGetIncr()
|
||||
* if you need to get the current value and increment it atomically, like
|
||||
* in the followign example:
|
||||
* in the following example:
|
||||
*
|
||||
* long oldvalue;
|
||||
* atomicGetIncr(myvar,oldvalue,1);
|
||||
|
|
|
@ -496,7 +496,7 @@ robj *lookupStringForBitCommand(client *c, size_t maxbit) {
|
|||
* in 'len'. The user is required to pass (likely stack allocated) buffer
|
||||
* 'llbuf' of at least LONG_STR_SIZE bytes. Such a buffer is used in the case
|
||||
* the object is integer encoded in order to provide the representation
|
||||
* without usign heap allocation.
|
||||
* without using heap allocation.
|
||||
*
|
||||
* The function returns the pointer to the object array of bytes representing
|
||||
* the string it contains, that may be a pointer to 'llbuf' or to the
|
||||
|
|
|
@ -377,7 +377,7 @@ void clusterSaveConfigOrDie(int do_fsync) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Lock the cluster config using flock(), and leaks the file descritor used to
|
||||
/* Lock the cluster config using flock(), and leaks the file descriptor used to
|
||||
* acquire the lock so that the file will be locked forever.
|
||||
*
|
||||
* This works because we always update nodes.conf with a new version
|
||||
|
@ -1060,7 +1060,7 @@ uint64_t clusterGetMaxEpoch(void) {
|
|||
* 3) Persist the configuration on disk before sending packets with the
|
||||
* new configuration.
|
||||
*
|
||||
* If the new config epoch is generated and assigend, C_OK is returned,
|
||||
* If the new config epoch is generated and assigned, C_OK is returned,
|
||||
* otherwise C_ERR is returned (since the node has already the greatest
|
||||
* configuration around) and no operation is performed.
|
||||
*
|
||||
|
@ -2500,7 +2500,7 @@ void clusterSendPing(clusterLink *link, int type) {
|
|||
* node_timeout we exchange with each other node at least 4 packets
|
||||
* (we ping in the worst case in node_timeout/2 time, and we also
|
||||
* receive two pings from the host), we have a total of 8 packets
|
||||
* in the node_timeout*2 falure reports validity time. So we have
|
||||
* in the node_timeout*2 failure reports validity time. So we have
|
||||
* that, for a single PFAIL node, we can expect to receive the following
|
||||
* number of failure reports (in the specified window of time):
|
||||
*
|
||||
|
@ -4507,7 +4507,7 @@ NULL
|
|||
}
|
||||
/* If this slot is in migrating status but we have no keys
|
||||
* for it assigning the slot to another node will clear
|
||||
* the migratig status. */
|
||||
* the migrating status. */
|
||||
if (countKeysInSlot(slot) == 0 &&
|
||||
server.cluster->migrating_slots_to[slot])
|
||||
server.cluster->migrating_slots_to[slot] = NULL;
|
||||
|
|
|
@ -52,7 +52,7 @@ typedef struct clusterLink {
|
|||
#define CLUSTER_NODE_NOADDR 64 /* We don't know the address of this node */
|
||||
#define CLUSTER_NODE_MEET 128 /* Send a MEET message to this node */
|
||||
#define CLUSTER_NODE_MIGRATE_TO 256 /* Master elegible for replica migration. */
|
||||
#define CLUSTER_NODE_NOFAILOVER 512 /* Slave will not try to failver. */
|
||||
#define CLUSTER_NODE_NOFAILOVER 512 /* Slave will not try to failover. */
|
||||
#define CLUSTER_NODE_NULL_NAME "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||
|
||||
#define nodeIsMaster(n) ((n)->flags & CLUSTER_NODE_MASTER)
|
||||
|
@ -164,7 +164,7 @@ typedef struct clusterState {
|
|||
clusterNode *mf_slave; /* Slave performing the manual failover. */
|
||||
/* Manual failover state of slave. */
|
||||
long long mf_master_offset; /* Master offset the slave needs to start MF
|
||||
or zero if stil not received. */
|
||||
or zero if still not received. */
|
||||
int mf_can_start; /* If non-zero signal that the manual failover
|
||||
can start requesting masters vote. */
|
||||
/* The followign fields are used by masters to take state on elections. */
|
||||
|
|
|
@ -2108,7 +2108,7 @@ static int updateJemallocBgThread(int val, int prev, char **err) {
|
|||
|
||||
static int updateReplBacklogSize(long long val, long long prev, char **err) {
|
||||
/* resizeReplicationBacklog sets server.repl_backlog_size, and relies on
|
||||
* being able to tell when the size changes, so restore prev becore calling it. */
|
||||
* being able to tell when the size changes, so restore prev before calling it. */
|
||||
UNUSED(err);
|
||||
server.repl_backlog_size = prev;
|
||||
resizeReplicationBacklog(val);
|
||||
|
|
|
@ -106,7 +106,7 @@ static inline int connAccept(connection *conn, ConnectionCallbackFunc accept_han
|
|||
}
|
||||
|
||||
/* Establish a connection. The connect_handler will be called when the connection
|
||||
* is established, or if an error has occured.
|
||||
* is established, or if an error has occurred.
|
||||
*
|
||||
* The connection handler will be responsible to set up any read/write handlers
|
||||
* as needed.
|
||||
|
@ -168,7 +168,7 @@ static inline int connSetReadHandler(connection *conn, ConnectionCallbackFunc fu
|
|||
|
||||
/* Set a write handler, and possibly enable a write barrier, this flag is
|
||||
* cleared when write handler is changed or removed.
|
||||
* With barroer enabled, we never fire the event if the read handler already
|
||||
* With barrier enabled, we never fire the event if the read handler already
|
||||
* fired in the same event loop iteration. Useful when you want to persist
|
||||
* things to disk before sending replies, and want to do that in a group fashion. */
|
||||
static inline int connSetWriteHandlerWithBarrier(connection *conn, ConnectionCallbackFunc func, int barrier) {
|
||||
|
|
2
src/db.c
2
src/db.c
|
@ -116,7 +116,7 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
|
|||
* However, if the command caller is not the master, and as additional
|
||||
* safety measure, the command invoked is a read-only command, we can
|
||||
* safely return NULL here, and provide a more consistent behavior
|
||||
* to clients accessign expired values in a read-only fashion, that
|
||||
* to clients accessing expired values in a read-only fashion, that
|
||||
* will say the key as non existing.
|
||||
*
|
||||
* Notably this covers GETs when slaves are used to scale reads. */
|
||||
|
|
|
@ -465,7 +465,7 @@ NULL
|
|||
}
|
||||
}
|
||||
|
||||
/* The default beahvior is to save the RDB file before loading
|
||||
/* The default behavior is to save the RDB file before loading
|
||||
* it back. */
|
||||
if (save) {
|
||||
rdbSaveInfo rsi, *rsiptr;
|
||||
|
|
|
@ -751,7 +751,7 @@ unsigned int dictGetSomeKeys(dict *d, dictEntry **des, unsigned int count) {
|
|||
* this function instead what we do is to consider a "linear" range of the table
|
||||
* that may be constituted of N buckets with chains of different lengths
|
||||
* appearing one after the other. Then we report a random element in the range.
|
||||
* In this way we smooth away the problem of different chain lenghts. */
|
||||
* In this way we smooth away the problem of different chain lengths. */
|
||||
#define GETFAIR_NUM_ENTRIES 15
|
||||
dictEntry *dictGetFairRandomKey(dict *d) {
|
||||
dictEntry *entries[GETFAIR_NUM_ENTRIES];
|
||||
|
@ -1121,7 +1121,7 @@ size_t _dictGetStatsHt(char *buf, size_t bufsize, dictht *ht, int tableid) {
|
|||
i, clvector[i], ((float)clvector[i]/ht->size)*100);
|
||||
}
|
||||
|
||||
/* Unlike snprintf(), teturn the number of characters actually written. */
|
||||
/* Unlike snprintf(), return the number of characters actually written. */
|
||||
if (bufsize) buf[bufsize-1] = '\0';
|
||||
return strlen(buf);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* to be backward compatible are still in big endian) because most of the
|
||||
* production environments are little endian, and we have a lot of conversions
|
||||
* in a few places because ziplists, intsets, zipmaps, need to be endian-neutral
|
||||
* even in memory, since they are serialied on RDB files directly with a single
|
||||
* even in memory, since they are serialized on RDB files directly with a single
|
||||
* write(2) without other additional steps.
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
|
|
|
@ -242,7 +242,7 @@ void evictionPoolPopulate(int dbid, dict *sampledict, dict *keydict, struct evic
|
|||
/* Try to reuse the cached SDS string allocated in the pool entry,
|
||||
* because allocating and deallocating this object is costly
|
||||
* (according to the profiler, not my fantasy. Remember:
|
||||
* premature optimizbla bla bla bla. */
|
||||
* premature optimize bla bla bla. */
|
||||
int klen = sdslen(key);
|
||||
if (klen > EVPOOL_CACHED_SDS_SIZE) {
|
||||
pool[k].key = sdsdup(key);
|
||||
|
@ -342,7 +342,7 @@ unsigned long LFUDecrAndReturn(robj *o) {
|
|||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* The external API for eviction: freeMemroyIfNeeded() is called by the
|
||||
* The external API for eviction: freeMemoryIfNeeded() is called by the
|
||||
* server when there is data to add in order to make space if needed.
|
||||
* --------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -441,7 +441,7 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
|
|||
*
|
||||
* The function returns C_OK if we are under the memory limit or if we
|
||||
* were over the limit, but the attempt to free memory was successful.
|
||||
* Otehrwise if we are over the memory limit, but not enough memory
|
||||
* Otherwise if we are over the memory limit, but not enough memory
|
||||
* was freed to return back under the limit, the function returns C_ERR. */
|
||||
int freeMemoryIfNeeded(void) {
|
||||
int keys_freed = 0;
|
||||
|
|
|
@ -414,7 +414,7 @@ void expireSlaveKeys(void) {
|
|||
else
|
||||
dictDelete(slaveKeysWithExpire,keyname);
|
||||
|
||||
/* Stop conditions: found 3 keys we cna't expire in a row or
|
||||
/* Stop conditions: found 3 keys we can't expire in a row or
|
||||
* time limit was reached. */
|
||||
cycles++;
|
||||
if (noexpire > 3) break;
|
||||
|
@ -466,7 +466,7 @@ size_t getSlaveKeyWithExpireCount(void) {
|
|||
*
|
||||
* Note: technically we should handle the case of a single DB being flushed
|
||||
* but it is not worth it since anyway race conditions using the same set
|
||||
* of key names in a wriatable slave and in its master will lead to
|
||||
* of key names in a writeable slave and in its master will lead to
|
||||
* inconsistencies. This is just a best-effort thing we do. */
|
||||
void flushSlaveKeysWithExpireList(void) {
|
||||
if (slaveKeysWithExpire) {
|
||||
|
@ -490,7 +490,7 @@ int checkAlreadyExpired(long long when) {
|
|||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/* This is the generic command implementation for EXPIRE, PEXPIRE, EXPIREAT
|
||||
* and PEXPIREAT. Because the commad second argument may be relative or absolute
|
||||
* and PEXPIREAT. Because the command second argument may be relative or absolute
|
||||
* the "basetime" argument is used to signal what the base time is (either 0
|
||||
* for *AT variants of the command, or the current time for relative expires).
|
||||
*
|
||||
|
|
|
@ -144,7 +144,7 @@ double extractUnitOrReply(client *c, robj *unit) {
|
|||
|
||||
/* Input Argument Helper.
|
||||
* Extract the dinstance from the specified two arguments starting at 'argv'
|
||||
* that shouldbe in the form: <number> <unit> and return the dinstance in the
|
||||
* that shouldbe in the form: <number> <unit> and return the distance in the
|
||||
* specified unit on success. *conversions is populated with the coefficient
|
||||
* to use in order to convert meters to the unit.
|
||||
*
|
||||
|
@ -788,7 +788,7 @@ void geoposCommand(client *c) {
|
|||
|
||||
/* GEODIST key ele1 ele2 [unit]
|
||||
*
|
||||
* Return the distance, in meters by default, otherwise accordig to "unit",
|
||||
* Return the distance, in meters by default, otherwise according to "unit",
|
||||
* between points ele1 and ele2. If one or more elements are missing NULL
|
||||
* is returned. */
|
||||
void geodistCommand(client *c) {
|
||||
|
|
|
@ -766,7 +766,7 @@ int hllSparseSet(robj *o, long index, uint8_t count) {
|
|||
* by a ZERO opcode with len > 1, or by an XZERO opcode.
|
||||
*
|
||||
* In those cases the original opcode must be split into multiple
|
||||
* opcodes. The worst case is an XZERO split in the middle resuling into
|
||||
* opcodes. The worst case is an XZERO split in the middle resulting into
|
||||
* XZERO - VAL - XZERO, so the resulting sequence max length is
|
||||
* 5 bytes.
|
||||
*
|
||||
|
@ -899,7 +899,7 @@ promote: /* Promote to dense representation. */
|
|||
* the element belongs to is incremented if needed.
|
||||
*
|
||||
* This function is actually a wrapper for hllSparseSet(), it only performs
|
||||
* the hashshing of the elmenet to obtain the index and zeros run length. */
|
||||
* the hashshing of the element to obtain the index and zeros run length. */
|
||||
int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
|
||||
long index;
|
||||
uint8_t count = hllPatLen(ele,elesize,&index);
|
||||
|
@ -1014,7 +1014,7 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
|
|||
double m = HLL_REGISTERS;
|
||||
double E;
|
||||
int j;
|
||||
/* Note that reghisto size could be just HLL_Q+2, becuase HLL_Q+1 is
|
||||
/* Note that reghisto size could be just HLL_Q+2, because HLL_Q+1 is
|
||||
* the maximum frequency of the "000...1" sequence the hash function is
|
||||
* able to return. However it is slow to check for sanity of the
|
||||
* input: instead we history array at a safe size: overflows will
|
||||
|
|
|
@ -85,7 +85,7 @@ int THPGetAnonHugePagesSize(void) {
|
|||
/* ---------------------------- Latency API --------------------------------- */
|
||||
|
||||
/* Latency monitor initialization. We just need to create the dictionary
|
||||
* of time series, each time serie is created on demand in order to avoid
|
||||
* of time series, each time series is created on demand in order to avoid
|
||||
* having a fixed list to maintain. */
|
||||
void latencyMonitorInit(void) {
|
||||
server.latency_events = dictCreate(&latencyTimeSeriesDictType,NULL);
|
||||
|
|
|
@ -15,7 +15,7 @@ size_t lazyfreeGetPendingObjectsCount(void) {
|
|||
|
||||
/* Return the amount of work needed in order to free an object.
|
||||
* The return value is not always the actual number of allocations the
|
||||
* object is compoesd of, but a number proportional to it.
|
||||
* object is composed of, but a number proportional to it.
|
||||
*
|
||||
* For strings the function always returns 1.
|
||||
*
|
||||
|
@ -113,7 +113,7 @@ void emptyDbAsync(redisDb *db) {
|
|||
}
|
||||
|
||||
/* Empty the slots-keys map of Redis CLuster by creating a new empty one
|
||||
* and scheduiling the old for lazy freeing. */
|
||||
* and scheduling the old for lazy freeing. */
|
||||
void slotToKeyFlushAsync(void) {
|
||||
rax *old = server.cluster->slots_to_keys;
|
||||
|
||||
|
@ -132,7 +132,7 @@ void lazyfreeFreeObjectFromBioThread(robj *o) {
|
|||
}
|
||||
|
||||
/* Release a database from the lazyfree thread. The 'db' pointer is the
|
||||
* database which was substitutied with a fresh one in the main thread
|
||||
* database which was substituted with a fresh one in the main thread
|
||||
* when the database was logically deleted. 'sl' is a skiplist used by
|
||||
* Redis Cluster in order to take the hash slots -> keys mapping. This
|
||||
* may be NULL if Redis Cluster is disabled. */
|
||||
|
|
|
@ -106,7 +106,7 @@ void lwFreeCanvas(lwCanvas *canvas) {
|
|||
}
|
||||
|
||||
/* Set a pixel to the specified color. Color is 0 or 1, where zero means no
|
||||
* dot will be displyed, and 1 means dot will be displayed.
|
||||
* dot will be displayed, and 1 means dot will be displayed.
|
||||
* Coordinates are arranged so that left-top corner is 0,0. You can write
|
||||
* out of the size of the canvas without issues. */
|
||||
void lwDrawPixel(lwCanvas *canvas, int x, int y, int color) {
|
||||
|
|
40
src/module.c
40
src/module.c
|
@ -46,7 +46,7 @@ typedef struct RedisModuleInfoCtx {
|
|||
sds info; /* info string we collected so far */
|
||||
int sections; /* number of sections we collected so far */
|
||||
int in_section; /* indication if we're in an active section or not */
|
||||
int in_dict_field; /* indication that we're curreintly appending to a dict */
|
||||
int in_dict_field; /* indication that we're currently appending to a dict */
|
||||
} RedisModuleInfoCtx;
|
||||
|
||||
typedef void (*RedisModuleInfoFunc)(RedisModuleInfoCtx *ctx, int for_crash_report);
|
||||
|
@ -1920,7 +1920,7 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
|
|||
flags |= REDISMODULE_CTX_FLAGS_LUA;
|
||||
if (ctx->client->flags & CLIENT_MULTI)
|
||||
flags |= REDISMODULE_CTX_FLAGS_MULTI;
|
||||
/* Module command recieved from MASTER, is replicated. */
|
||||
/* Module command received from MASTER, is replicated. */
|
||||
if (ctx->client->flags & CLIENT_MASTER)
|
||||
flags |= REDISMODULE_CTX_FLAGS_REPLICATED;
|
||||
}
|
||||
|
@ -3629,7 +3629,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
|
|||
* and if the module name or encver is invalid, NULL is returned.
|
||||
* Otherwise the new type is registered into Redis, and a reference of
|
||||
* type RedisModuleType is returned: the caller of the function should store
|
||||
* this reference into a gobal variable to make future use of it in the
|
||||
* this reference into a global variable to make future use of it in the
|
||||
* modules type API, since a single module may register multiple types.
|
||||
* Example code fragment:
|
||||
*
|
||||
|
@ -3768,7 +3768,7 @@ int moduleAllDatatypesHandleErrors() {
|
|||
|
||||
/* Returns true if any previous IO API failed.
|
||||
* for Load* APIs the REDISMODULE_OPTIONS_HANDLE_IO_ERRORS flag must be set with
|
||||
* RediModule_SetModuleOptions first. */
|
||||
* RedisModule_SetModuleOptions first. */
|
||||
int RM_IsIOError(RedisModuleIO *io) {
|
||||
return io->error;
|
||||
}
|
||||
|
@ -3901,7 +3901,7 @@ RedisModuleString *RM_LoadString(RedisModuleIO *io) {
|
|||
*
|
||||
* The size of the string is stored at '*lenptr' if not NULL.
|
||||
* The returned string is not automatically NULL terminated, it is loaded
|
||||
* exactly as it was stored inisde the RDB file. */
|
||||
* exactly as it was stored inside the RDB file. */
|
||||
char *RM_LoadStringBuffer(RedisModuleIO *io, size_t *lenptr) {
|
||||
return moduleLoadString(io,1,lenptr);
|
||||
}
|
||||
|
@ -4900,7 +4900,7 @@ void moduleReleaseGIL(void) {
|
|||
|
||||
/* Subscribe to keyspace notifications. This is a low-level version of the
|
||||
* keyspace-notifications API. A module can register callbacks to be notified
|
||||
* when keyspce events occur.
|
||||
* when keyspace events occur.
|
||||
*
|
||||
* Notification events are filtered by their type (string events, set events,
|
||||
* etc), and the subscriber callback receives only events that match a specific
|
||||
|
@ -5611,7 +5611,7 @@ int RM_AuthenticateClientWithACLUser(RedisModuleCtx *ctx, const char *name, size
|
|||
/* Deauthenticate and close the client. The client resources will not be
|
||||
* be immediately freed, but will be cleaned up in a background job. This is
|
||||
* the recommended way to deauthenicate a client since most clients can't
|
||||
* handle users becomming deauthenticated. Returns REDISMODULE_ERR when the
|
||||
* handle users becoming deauthenticated. Returns REDISMODULE_ERR when the
|
||||
* client doesn't exist and REDISMODULE_OK when the operation was successful.
|
||||
*
|
||||
* The client ID is returned from the RM_AuthenticateClientWithUser and
|
||||
|
@ -5731,14 +5731,14 @@ int RM_DictDel(RedisModuleDict *d, RedisModuleString *key, void *oldval) {
|
|||
return RM_DictDelC(d,key->ptr,sdslen(key->ptr),oldval);
|
||||
}
|
||||
|
||||
/* Return an interator, setup in order to start iterating from the specified
|
||||
/* Return an iterator, setup in order to start iterating from the specified
|
||||
* key by applying the operator 'op', which is just a string specifying the
|
||||
* comparison operator to use in order to seek the first element. The
|
||||
* operators avalable are:
|
||||
* operators available are:
|
||||
*
|
||||
* "^" -- Seek the first (lexicographically smaller) key.
|
||||
* "$" -- Seek the last (lexicographically biffer) key.
|
||||
* ">" -- Seek the first element greter than the specified key.
|
||||
* ">" -- Seek the first element greater than the specified key.
|
||||
* ">=" -- Seek the first element greater or equal than the specified key.
|
||||
* "<" -- Seek the first element smaller than the specified key.
|
||||
* "<=" -- Seek the first element smaller or equal than the specified key.
|
||||
|
@ -5865,7 +5865,7 @@ RedisModuleString *RM_DictPrev(RedisModuleCtx *ctx, RedisModuleDictIter *di, voi
|
|||
* in the loop, as we iterate elements, we can also check if we are still
|
||||
* on range.
|
||||
*
|
||||
* The function returne REDISMODULE_ERR if the iterator reached the
|
||||
* The function return REDISMODULE_ERR if the iterator reached the
|
||||
* end of elements condition as well. */
|
||||
int RM_DictCompareC(RedisModuleDictIter *di, const char *op, void *key, size_t keylen) {
|
||||
if (raxEOF(&di->ri)) return REDISMODULE_ERR;
|
||||
|
@ -6246,7 +6246,7 @@ int RM_ExportSharedAPI(RedisModuleCtx *ctx, const char *apiname, void *func) {
|
|||
* command that requires external APIs: if some API cannot be resolved, the
|
||||
* command should return an error.
|
||||
*
|
||||
* Here is an exmaple:
|
||||
* Here is an example:
|
||||
*
|
||||
* int ... myCommandImplementation() {
|
||||
* if (getExternalAPIs() == 0) {
|
||||
|
@ -6632,7 +6632,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) {
|
|||
* RedisModule_ScanCursorDestroy(c);
|
||||
*
|
||||
* It is also possible to use this API from another thread while the lock
|
||||
* is acquired durring the actuall call to RM_Scan:
|
||||
* is acquired during the actuall call to RM_Scan:
|
||||
*
|
||||
* RedisModuleCursor *c = RedisModule_ScanCursorCreate();
|
||||
* RedisModule_ThreadSafeContextLock(ctx);
|
||||
|
@ -6660,7 +6660,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) {
|
|||
* Moreover playing with the Redis keyspace while iterating may have the
|
||||
* effect of returning more duplicates. A safe pattern is to store the keys
|
||||
* names you want to modify elsewhere, and perform the actions on the keys
|
||||
* later when the iteration is complete. Howerver this can cost a lot of
|
||||
* later when the iteration is complete. However this can cost a lot of
|
||||
* memory, so it may make sense to just operate on the current key when
|
||||
* possible during the iteration, given that this is safe. */
|
||||
int RM_Scan(RedisModuleCtx *ctx, RedisModuleScanCursor *cursor, RedisModuleScanCB fn, void *privdata) {
|
||||
|
@ -6895,7 +6895,7 @@ int TerminateModuleForkChild(int child_pid, int wait) {
|
|||
}
|
||||
|
||||
/* Can be used to kill the forked child process from the parent process.
|
||||
* child_pid whould be the return value of RedisModule_Fork. */
|
||||
* child_pid would be the return value of RedisModule_Fork. */
|
||||
int RM_KillForkChild(int child_pid) {
|
||||
/* Kill module child, wait for child exit. */
|
||||
if (TerminateModuleForkChild(child_pid,1) == C_OK)
|
||||
|
@ -7033,7 +7033,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
|
|||
* REDISMODULE_SUBEVENT_LOADING_FAILED
|
||||
*
|
||||
* Note that AOF loading may start with an RDB data in case of
|
||||
* rdb-preamble, in which case you'll only recieve an AOF_START event.
|
||||
* rdb-preamble, in which case you'll only receive an AOF_START event.
|
||||
*
|
||||
*
|
||||
* RedisModuleEvent_ClientChange
|
||||
|
@ -7055,7 +7055,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
|
|||
* This event is called when the instance (that can be both a
|
||||
* master or a replica) get a new online replica, or lose a
|
||||
* replica since it gets disconnected.
|
||||
* The following sub events are availble:
|
||||
* The following sub events are available:
|
||||
*
|
||||
* REDISMODULE_SUBEVENT_REPLICA_CHANGE_ONLINE
|
||||
* REDISMODULE_SUBEVENT_REPLICA_CHANGE_OFFLINE
|
||||
|
@ -7093,7 +7093,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
|
|||
* RedisModuleEvent_ModuleChange
|
||||
*
|
||||
* This event is called when a new module is loaded or one is unloaded.
|
||||
* The following sub events are availble:
|
||||
* The following sub events are available:
|
||||
*
|
||||
* REDISMODULE_SUBEVENT_MODULE_LOADED
|
||||
* REDISMODULE_SUBEVENT_MODULE_UNLOADED
|
||||
|
@ -7120,7 +7120,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
|
|||
* int32_t progress; // Approximate progress between 0 and 1024,
|
||||
* or -1 if unknown.
|
||||
*
|
||||
* The function returns REDISMODULE_OK if the module was successfully subscrived
|
||||
* The function returns REDISMODULE_OK if the module was successfully subscribed
|
||||
* for the specified event. If the API is called from a wrong context then
|
||||
* REDISMODULE_ERR is returned. */
|
||||
int RM_SubscribeToServerEvent(RedisModuleCtx *ctx, RedisModuleEvent event, RedisModuleEventCallback callback) {
|
||||
|
@ -7687,7 +7687,7 @@ size_t moduleCount(void) {
|
|||
return dictSize(modules);
|
||||
}
|
||||
|
||||
/* Set the key last access time for LRU based eviction. not relevent if the
|
||||
/* Set the key last access time for LRU based eviction. not relevant if the
|
||||
* servers's maxmemory policy is LFU based. Value is idle time in milliseconds.
|
||||
* returns REDISMODULE_OK if the LRU was updated, REDISMODULE_ERR otherwise. */
|
||||
int RM_SetLRU(RedisModuleKey *key, mstime_t lru_idle) {
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include <ctype.h>
|
||||
|
||||
/* Fast tolower() alike function that does not care about locale
|
||||
* but just returns a-z insetad of A-Z. */
|
||||
* but just returns a-z instead of A-Z. */
|
||||
int siptlw(int c) {
|
||||
if (c >= 'A' && c <= 'Z') {
|
||||
return c+('a'-'A');
|
||||
|
|
|
@ -75,7 +75,7 @@ slowlogEntry *slowlogCreateEntry(client *c, robj **argv, int argc, long long dur
|
|||
} else if (argv[j]->refcount == OBJ_SHARED_REFCOUNT) {
|
||||
se->argv[j] = argv[j];
|
||||
} else {
|
||||
/* Here we need to dupliacate the string objects composing the
|
||||
/* Here we need to duplicate the string objects composing the
|
||||
* argument vector of the command, because those may otherwise
|
||||
* end shared with string objects stored into keys. Having
|
||||
* shared objects between any part of Redis, and the data
|
||||
|
|
|
@ -115,7 +115,7 @@ robj *lookupKeyByPattern(redisDb *db, robj *pattern, robj *subst, int writeflag)
|
|||
if (fieldobj) {
|
||||
if (o->type != OBJ_HASH) goto noobj;
|
||||
|
||||
/* Retrieve value from hash by the field name. The returend object
|
||||
/* Retrieve value from hash by the field name. The returned object
|
||||
* is a new object with refcount already incremented. */
|
||||
o = hashTypeGetValueObject(o, fieldobj->ptr);
|
||||
} else {
|
||||
|
|
|
@ -1890,7 +1890,7 @@ NULL
|
|||
}
|
||||
}
|
||||
|
||||
/* XSETID <stream> <groupname> <id>
|
||||
/* XSETID <stream> <id>
|
||||
*
|
||||
* Set the internal "last ID" of a stream. */
|
||||
void xsetidCommand(client *c) {
|
||||
|
|
|
@ -315,7 +315,7 @@ void msetGenericCommand(client *c, int nx) {
|
|||
}
|
||||
|
||||
/* Handle the NX flag. The MSETNX semantic is to return zero and don't
|
||||
* set anything if at least one key alerady exists. */
|
||||
* set anything if at least one key already exists. */
|
||||
if (nx) {
|
||||
for (j = 1; j < c->argc; j += 2) {
|
||||
if (lookupKeyWrite(c->db,c->argv[j]) != NULL) {
|
||||
|
|
|
@ -325,7 +325,7 @@ unsigned int zipIntSize(unsigned char encoding) {
|
|||
* for single-byte small immediate integers.
|
||||
*
|
||||
* 'rawlen' is only used for ZIP_STR_* encodings and is the length of the
|
||||
* srting that this entry represents.
|
||||
* string that this entry represents.
|
||||
*
|
||||
* The function returns the number of bytes used by the encoding/length
|
||||
* header stored in 'p'. */
|
||||
|
|
|
@ -273,7 +273,7 @@ proc pause_on_error {} {
|
|||
puts "S <id> cmd ... arg Call command in Sentinel <id>."
|
||||
puts "R <id> cmd ... arg Call command in Redis <id>."
|
||||
puts "SI <id> <field> Show Sentinel <id> INFO <field>."
|
||||
puts "RI <id> <field> Show Sentinel <id> INFO <field>."
|
||||
puts "RI <id> <field> Show Redis <id> INFO <field>."
|
||||
puts "continue Resume test."
|
||||
} else {
|
||||
set errcode [catch {eval $line} retval]
|
||||
|
|
Loading…
Reference in New Issue