Skip to content

Commit

Permalink
rename listpackttl to listpackex
Browse files Browse the repository at this point in the history
  • Loading branch information
tezc committed May 2, 2024
1 parent d0b523c commit 6c6c6a4
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 111 deletions.
2 changes: 1 addition & 1 deletion src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ void scanGenericCommand(client *c, robj *o, unsigned long long cursor) {
p = lpNext(o->ptr, p);
}
cursor = 0;
} else if (o->type == OBJ_HASH && o->encoding == OBJ_ENCODING_LISTPACK_TTL) {
} else if (o->type == OBJ_HASH && o->encoding == OBJ_ENCODING_LISTPACK_EX) {
int64_t len;
long long expireAt;
unsigned char *lp = hashTypeListpackGetLp(o);
Expand Down
4 changes: 2 additions & 2 deletions src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ char *strEncoding(int encoding) {
case OBJ_ENCODING_HT: return "hashtable";
case OBJ_ENCODING_QUICKLIST: return "quicklist";
case OBJ_ENCODING_LISTPACK: return "listpack";
case OBJ_ENCODING_LISTPACK_TTL: return "listpack_ttl";
case OBJ_ENCODING_LISTPACK_EX: return "listpackex";
case OBJ_ENCODING_INTSET: return "intset";
case OBJ_ENCODING_SKIPLIST: return "skiplist";
case OBJ_ENCODING_EMBSTR: return "embstr";
Expand Down Expand Up @@ -1041,7 +1041,7 @@ size_t objectComputeSize(robj *key, robj *o, size_t sample_size, int dbid) {
}
} else if (o->type == OBJ_HASH) {
if (o->encoding == OBJ_ENCODING_LISTPACK ||
o->encoding == OBJ_ENCODING_LISTPACK_TTL)
o->encoding == OBJ_ENCODING_LISTPACK_EX)
{
asize = hashTypeListpackMemUsage(o);
} else if (o->encoding == OBJ_ENCODING_HT) {
Expand Down
10 changes: 5 additions & 5 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ struct RedisModuleDigest {
#define OBJ_ENCODING_QUICKLIST 9 /* Encoded as linked list of listpacks */
#define OBJ_ENCODING_STREAM 10 /* Encoded as a radix tree of listpacks */
#define OBJ_ENCODING_LISTPACK 11 /* Encoded as a listpack */
#define OBJ_ENCODING_LISTPACK_TTL 12 /* Encoded as a listpack with TTL metadata */
#define OBJ_ENCODING_LISTPACK_EX 12 /* Encoded as listpack, extended with metadata */

#define LRU_BITS 24
#define LRU_CLOCK_MAX ((1<<LRU_BITS)-1) /* Max value of obj->lru */
Expand Down Expand Up @@ -3151,9 +3151,9 @@ void setTypeConvert(robj *subject, int enc);
int setTypeConvertAndExpand(robj *setobj, int enc, unsigned long cap, int panic);
robj *setTypeDup(robj *o);

/* Data structure for OBJ_ENCODING_LISTPACK_TTL. It contains listpack and
* metadata fields for hash field expiration.*/
typedef struct listpackTTL {
/* Data structure for OBJ_ENCODING_LISTPACK_EX for hash. It contains listpack
* and metadata fields for hash field expiration.*/
typedef struct listpackEx {
ExpireMeta meta; /* To be used in order to register the hash in the
global ebuckets (i.e. db->hexpires) with next,
minimum, hash-field to expire. */
Expand All @@ -3163,7 +3163,7 @@ typedef struct listpackTTL {
needed. */
void *lp; /* listpack that contains 'key-value-ttl' tuples which
are ordered by ttl. */
} listpackTTL;
} listpackEx;

/* Hash data type */
#define HASH_SET_TAKE_FIELD (1<<0)
Expand Down

0 comments on commit 6c6c6a4

Please sign in to comment.