提交 7f6743a5 编写于 作者: A antirez

Fixed grammar: before H the article is a, not an.

上级 edae7899
...@@ -45,7 +45,7 @@ static int aeApiCreate(aeEventLoop *eventLoop) { ...@@ -45,7 +45,7 @@ static int aeApiCreate(aeEventLoop *eventLoop) {
zfree(state); zfree(state);
return -1; return -1;
} }
state->epfd = epoll_create(1024); /* 1024 is just an hint for the kernel */ state->epfd = epoll_create(1024); /* 1024 is just a hint for the kernel */
if (state->epfd == -1) { if (state->epfd == -1) {
zfree(state->events); zfree(state->events);
zfree(state); zfree(state);
......
...@@ -771,7 +771,7 @@ int rewriteSortedSetObject(rio *r, robj *key, robj *o) { ...@@ -771,7 +771,7 @@ int rewriteSortedSetObject(rio *r, robj *key, robj *o) {
return 1; return 1;
} }
/* Write either the key or the value of the currently selected item of an hash. /* Write either the key or the value of the currently selected item of a hash.
* The 'hi' argument passes a valid Redis hash iterator. * The 'hi' argument passes a valid Redis hash iterator.
* The 'what' filed specifies if to write a key or a value and can be * The 'what' filed specifies if to write a key or a value and can be
* either REDIS_HASH_KEY or REDIS_HASH_VALUE. * either REDIS_HASH_KEY or REDIS_HASH_VALUE.
......
...@@ -360,7 +360,7 @@ int parseScanCursorOrReply(redisClient *c, robj *o, unsigned long *cursor) { ...@@ -360,7 +360,7 @@ int parseScanCursorOrReply(redisClient *c, robj *o, unsigned long *cursor) {
} }
/* This command implements SCAN, HSCAN and SSCAN commands. /* This command implements SCAN, HSCAN and SSCAN commands.
* If object 'o' is passed, then it must be an Hash or Set object, otherwise * If object 'o' is passed, then it must be a Hash or Set object, otherwise
* if 'o' is NULL the command will operate on the dictionary associated with * if 'o' is NULL the command will operate on the dictionary associated with
* the current database. * the current database.
* *
...@@ -368,7 +368,7 @@ int parseScanCursorOrReply(redisClient *c, robj *o, unsigned long *cursor) { ...@@ -368,7 +368,7 @@ int parseScanCursorOrReply(redisClient *c, robj *o, unsigned long *cursor) {
* the client arguments vector is a key so it skips it before iterating * the client arguments vector is a key so it skips it before iterating
* in order to parse options. * in order to parse options.
* *
* In the case of an Hash object the function returns both the field and value * In the case of a Hash object the function returns both the field and value
* of every element on the Hash. */ * of every element on the Hash. */
void scanGenericCommand(redisClient *c, robj *o, unsigned long cursor) { void scanGenericCommand(redisClient *c, robj *o, unsigned long cursor) {
int rv; int rv;
...@@ -423,12 +423,12 @@ void scanGenericCommand(redisClient *c, robj *o, unsigned long cursor) { ...@@ -423,12 +423,12 @@ void scanGenericCommand(redisClient *c, robj *o, unsigned long cursor) {
/* Step 2: Iterate the collection. /* Step 2: Iterate the collection.
* *
* Note that if the object is encoded with a ziplist, intset, or any other * Note that if the object is encoded with a ziplist, intset, or any other
* representation that is not an hash table, we are sure that it is also * representation that is not a hash table, we are sure that it is also
* composed of a small number of elements. So to avoid taking state we * composed of a small number of elements. So to avoid taking state we
* just return everything inside the object in a single call, setting the * just return everything inside the object in a single call, setting the
* cursor to zero to signal the end of the iteration. */ * cursor to zero to signal the end of the iteration. */
/* Handle the case of an hash table. */ /* Handle the case of a hash table. */
ht = NULL; ht = NULL;
if (o == NULL) { if (o == NULL) {
ht = c->db->dict; ht = c->db->dict;
...@@ -510,7 +510,7 @@ void scanGenericCommand(redisClient *c, robj *o, unsigned long cursor) { ...@@ -510,7 +510,7 @@ void scanGenericCommand(redisClient *c, robj *o, unsigned long cursor) {
listDelNode(keys, node); listDelNode(keys, node);
} }
/* If this is an hash or a sorted set, we have a flat list of /* If this is a hash or a sorted set, we have a flat list of
* key-value elements, so if this element was filtered, remove the * key-value elements, so if this element was filtered, remove the
* value, or skip it if it was not filtered: we only match keys. */ * value, or skip it if it was not filtered: we only match keys. */
if (o && (o->type == REDIS_ZSET || o->type == REDIS_HASH)) { if (o && (o->type == REDIS_ZSET || o->type == REDIS_HASH)) {
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
* around when there is a child performing saving operations. * around when there is a child performing saving operations.
* *
* Note that even when dict_can_resize is set to 0, not all resizes are * Note that even when dict_can_resize is set to 0, not all resizes are
* prevented: an hash table is still allowed to grow if the ratio between * prevented: a hash table is still allowed to grow if the ratio between
* the number of elements and the buckets > dict_force_resize_ratio. */ * the number of elements and the buckets > dict_force_resize_ratio. */
static int dict_can_resize = 1; static int dict_can_resize = 1;
static unsigned int dict_force_resize_ratio = 5; static unsigned int dict_force_resize_ratio = 5;
...@@ -853,7 +853,7 @@ static unsigned long _dictNextPower(unsigned long size) ...@@ -853,7 +853,7 @@ static unsigned long _dictNextPower(unsigned long size)
} }
/* Returns the index of a free slot that can be populated with /* Returns the index of a free slot that can be populated with
* an hash entry for the given 'key'. * a hash entry for the given 'key'.
* If the key already exists, -1 is returned. * If the key already exists, -1 is returned.
* *
* Note that if we are in the process of rehashing the hash table, the * Note that if we are in the process of rehashing the hash table, the
......
...@@ -1150,7 +1150,7 @@ void getClientsMaxBuffers(unsigned long *longest_output_list, ...@@ -1150,7 +1150,7 @@ void getClientsMaxBuffers(unsigned long *longest_output_list,
*biggest_input_buffer = bib; *biggest_input_buffer = bib;
} }
/* This is an helper function for getClientPeerId(). /* This is a helper function for getClientPeerId().
* It writes the specified ip/port to "peerid" as a null termiated string * It writes the specified ip/port to "peerid" as a null termiated string
* in the form ip:port if ip does not contain ":" itself, otherwise * in the form ip:port if ip does not contain ":" itself, otherwise
* [ip]:port format is used (for IPv6 addresses basically). */ * [ip]:port format is used (for IPv6 addresses basically). */
......
...@@ -587,7 +587,7 @@ unsigned long estimateObjectIdleTime(robj *o) { ...@@ -587,7 +587,7 @@ unsigned long estimateObjectIdleTime(robj *o) {
} }
} }
/* This is an helper function for the DEBUG command. We need to lookup keys /* This is a helper function for the DEBUG command. We need to lookup keys
* without any modification of LRU or other parameters. */ * without any modification of LRU or other parameters. */
robj *objectCommandLookup(redisClient *c, robj *key) { robj *objectCommandLookup(redisClient *c, robj *key) {
dictEntry *de; dictEntry *de;
......
...@@ -892,7 +892,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) { ...@@ -892,7 +892,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
o = createHashObject(); o = createHashObject();
/* Too many entries? Use an hash table. */ /* Too many entries? Use a hash table. */
if (len > server.hash_max_ziplist_entries) if (len > server.hash_max_ziplist_entries)
hashTypeConvert(o, REDIS_ENCODING_HT); hashTypeConvert(o, REDIS_ENCODING_HT);
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#define REDIS_ENCODING_RAW 0 /* Raw representation */ #define REDIS_ENCODING_RAW 0 /* Raw representation */
#define REDIS_ENCODING_INT 1 /* Encoded as integer */ #define REDIS_ENCODING_INT 1 /* Encoded as integer */
#define REDIS_ENCODING_ZIPMAP 2 /* Encoded as zipmap */ #define REDIS_ENCODING_ZIPMAP 2 /* Encoded as zipmap */
#define REDIS_ENCODING_HT 3 /* Encoded as an hash table */ #define REDIS_ENCODING_HT 3 /* Encoded as a hash table */
/* Object types only used for dumping to disk */ /* Object types only used for dumping to disk */
#define REDIS_EXPIRETIME_MS 252 #define REDIS_EXPIRETIME_MS 252
......
...@@ -370,7 +370,7 @@ void exitFromChild(int retcode) { ...@@ -370,7 +370,7 @@ void exitFromChild(int retcode) {
/*====================== Hash table type implementation ==================== */ /*====================== Hash table type implementation ==================== */
/* This is an hash table type that uses the SDS dynamic strings library as /* This is a hash table type that uses the SDS dynamic strings library as
* keys and radis objects as values (objects can hold SDS strings, * keys and radis objects as values (objects can hold SDS strings,
* lists, sets). */ * lists, sets). */
......
...@@ -1399,7 +1399,7 @@ void refreshGoodSlavesCount(void) { ...@@ -1399,7 +1399,7 @@ void refreshGoodSlavesCount(void) {
* connected slave, in order to be able to replicate EVALSHA as it is without * connected slave, in order to be able to replicate EVALSHA as it is without
* translating it to EVAL every time it is possible. * translating it to EVAL every time it is possible.
* *
* We use a capped collection implemented by an hash table for fast lookup * We use a capped collection implemented by a hash table for fast lookup
* of scripts we can send as EVALSHA, plus a linked list that is used for * of scripts we can send as EVALSHA, plus a linked list that is used for
* eviction of the oldest entry when the max number of items is reached. * eviction of the oldest entry when the max number of items is reached.
* *
......
...@@ -895,7 +895,7 @@ void evalGenericCommand(redisClient *c, int evalsha) { ...@@ -895,7 +895,7 @@ void evalGenericCommand(redisClient *c, int evalsha) {
/* Select the right DB in the context of the Lua client */ /* Select the right DB in the context of the Lua client */
selectDb(server.lua_client,c->db->id); selectDb(server.lua_client,c->db->id);
/* Set an hook in order to be able to stop the script execution if it /* Set a hook in order to be able to stop the script execution if it
* is running for too much time. * is running for too much time.
* We set the hook only if the time limit is enabled as the hook will * We set the hook only if the time limit is enabled as the hook will
* make the Lua script execution slower. */ * make the Lua script execution slower. */
...@@ -1059,7 +1059,7 @@ void scriptCommand(redisClient *c) { ...@@ -1059,7 +1059,7 @@ void scriptCommand(redisClient *c) {
if (server.lua_caller == NULL) { if (server.lua_caller == NULL) {
addReplySds(c,sdsnew("-NOTBUSY No scripts in execution right now.\r\n")); addReplySds(c,sdsnew("-NOTBUSY No scripts in execution right now.\r\n"));
} else if (server.lua_write_dirty) { } else if (server.lua_write_dirty) {
addReplySds(c,sdsnew("-UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in an hard way using the SHUTDOWN NOSAVE command.\r\n")); addReplySds(c,sdsnew("-UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.\r\n"));
} else { } else {
server.lua_kill = 1; server.lua_kill = 1;
addReply(c,shared.ok); addReply(c,shared.ok);
......
...@@ -582,7 +582,7 @@ int is_hex_digit(char c) { ...@@ -582,7 +582,7 @@ int is_hex_digit(char c) {
(c >= 'A' && c <= 'F'); (c >= 'A' && c <= 'F');
} }
/* Helper function for sdssplitargs() that converts an hex digit into an /* Helper function for sdssplitargs() that converts a hex digit into an
* integer from 0 to 15 */ * integer from 0 to 15 */
int hex_digit_to_int(char c) { int hex_digit_to_int(char c) {
switch(c) { switch(c) {
......
...@@ -135,7 +135,7 @@ typedef struct sentinelRedisInstance { ...@@ -135,7 +135,7 @@ typedef struct sentinelRedisInstance {
if the link is idle and must be reconnected. */ if the link is idle and must be reconnected. */
mstime_t last_pub_time; /* Last time we sent hello via Pub/Sub. */ mstime_t last_pub_time; /* Last time we sent hello via Pub/Sub. */
mstime_t last_hello_time; /* Only used if SRI_SENTINEL is set. Last time mstime_t last_hello_time; /* Only used if SRI_SENTINEL is set. Last time
we received an hello from this Sentinel we received a hello from this Sentinel
via Pub/Sub. */ via Pub/Sub. */
mstime_t last_master_down_reply_time; /* Time of last reply to mstime_t last_master_down_reply_time; /* Time of last reply to
SENTINEL is-master-down command. */ SENTINEL is-master-down command. */
...@@ -1492,7 +1492,7 @@ void sentinelFlushConfig(void) { ...@@ -1492,7 +1492,7 @@ void sentinelFlushConfig(void) {
/* ====================== hiredis connection handling ======================= */ /* ====================== hiredis connection handling ======================= */
/* Completely disconnect an hiredis link from an instance. */ /* Completely disconnect a hiredis link from an instance. */
void sentinelKillLink(sentinelRedisInstance *ri, redisAsyncContext *c) { void sentinelKillLink(sentinelRedisInstance *ri, redisAsyncContext *c) {
if (ri->cc == c) { if (ri->cc == c) {
ri->cc = NULL; ri->cc = NULL;
...@@ -1504,7 +1504,7 @@ void sentinelKillLink(sentinelRedisInstance *ri, redisAsyncContext *c) { ...@@ -1504,7 +1504,7 @@ void sentinelKillLink(sentinelRedisInstance *ri, redisAsyncContext *c) {
redisAsyncFree(c); redisAsyncFree(c);
} }
/* This function takes an hiredis context that is in an error condition /* This function takes a hiredis context that is in an error condition
* and make sure to mark the instance as disconnected performing the * and make sure to mark the instance as disconnected performing the
* cleanup needed. * cleanup needed.
* *
......
...@@ -48,8 +48,8 @@ redisSortOperation *createSortOperation(int type, robj *pattern) { ...@@ -48,8 +48,8 @@ redisSortOperation *createSortOperation(int type, robj *pattern) {
* 1) The first occurrence of '*' in 'pattern' is substituted with 'subst'. * 1) The first occurrence of '*' in 'pattern' is substituted with 'subst'.
* *
* 2) If 'pattern' matches the "->" string, everything on the left of * 2) If 'pattern' matches the "->" string, everything on the left of
* the arrow is treated as the name of an hash field, and the part on the * the arrow is treated as the name of a hash field, and the part on the
* left as the key name containing an hash. The value of the specified * left as the key name containing a hash. The value of the specified
* field is returned. * field is returned.
* *
* 3) If 'pattern' equals "#", the function simply returns 'subst' itself so * 3) If 'pattern' equals "#", the function simply returns 'subst' itself so
......
...@@ -850,7 +850,7 @@ void unblockClientWaitingData(redisClient *c) { ...@@ -850,7 +850,7 @@ void unblockClientWaitingData(redisClient *c) {
/* If the specified key has clients blocked waiting for list pushes, this /* If the specified key has clients blocked waiting for list pushes, this
* function will put the key reference into the server.ready_keys list. * function will put the key reference into the server.ready_keys list.
* Note that db->ready_keys is an hash table that allows us to avoid putting * Note that db->ready_keys is a hash table that allows us to avoid putting
* the same key again and again in the list in case of multiple pushes * the same key again and again in the list in case of multiple pushes
* made by a script or in the context of MULTI/EXEC. * made by a script or in the context of MULTI/EXEC.
* *
...@@ -878,7 +878,7 @@ void signalListAsReady(redisClient *c, robj *key) { ...@@ -878,7 +878,7 @@ void signalListAsReady(redisClient *c, robj *key) {
redisAssert(dictAdd(c->db->ready_keys,key,NULL) == DICT_OK); redisAssert(dictAdd(c->db->ready_keys,key,NULL) == DICT_OK);
} }
/* This is an helper function for handleClientsBlockedOnLists(). It's work /* This is a helper function for handleClientsBlockedOnLists(). It's work
* is to serve a specific client (receiver) that is blocked on 'key' * is to serve a specific client (receiver) that is blocked on 'key'
* in the context of the specified 'db', doing the following: * in the context of the specified 'db', doing the following:
* *
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* in order to get O(log(N)) INSERT and REMOVE operations into a sorted * in order to get O(log(N)) INSERT and REMOVE operations into a sorted
* data structure. * data structure.
* *
* The elements are added to an hash table mapping Redis objects to scores. * The elements are added to a hash table mapping Redis objects to scores.
* At the same time the elements are added to a skip list mapping scores * At the same time the elements are added to a skip list mapping scores
* to Redis objects (so objects are sorted by scores in this "view"). */ * to Redis objects (so objects are sorted by scores in this "view"). */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* efficient. * efficient.
* *
* The Redis Hash type uses this data structure for hashes composed of a small * The Redis Hash type uses this data structure for hashes composed of a small
* number of elements, to switch to an hash table once a given number of * number of elements, to switch to a hash table once a given number of
* elements is reached. * elements is reached.
* *
* Given that many times Redis Hashes are used to represent objects composed * Given that many times Redis Hashes are used to represent objects composed
......
...@@ -176,7 +176,7 @@ void *zrealloc(void *ptr, size_t size) { ...@@ -176,7 +176,7 @@ void *zrealloc(void *ptr, size_t size) {
} }
/* Provide zmalloc_size() for systems where this function is not provided by /* Provide zmalloc_size() for systems where this function is not provided by
* malloc itself, given that in that case we store an header with this * malloc itself, given that in that case we store a header with this
* information as the first bytes of every allocation. */ * information as the first bytes of every allocation. */
#ifndef HAVE_MALLOC_SIZE #ifndef HAVE_MALLOC_SIZE
size_t zmalloc_size(void *ptr) { size_t zmalloc_size(void *ptr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册