Skip to content

Commit

Permalink
Add sorted set support (#20)
Browse files Browse the repository at this point in the history
Add sorted set support
  • Loading branch information
tezc authored Sep 28, 2023
1 parent 05be44d commit 6396000
Show file tree
Hide file tree
Showing 32 changed files with 1,308 additions and 16 deletions.
16 changes: 11 additions & 5 deletions api/librdb-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ typedef enum RdbRes {
RDB_ERR_LIST_ZL_INTEG_CHECK,
RDB_ERR_SET_IS_INTEG_CHECK,
RDB_ERR_SET_LP_INTEG_CHECK,
RDB_ERR_ZSET_ZL_INTEG_CHECK,
RDB_ERR_ZSET_LP_INTEG_CHECK,
RDB_ERR_HASH_LP_INTEG_CHECK,
RDB_ERR_HASH_ZM_INTEG_CHECK,
RDB_ERR_SSTYPE_INTEG_CHECK,
RDB_ERR_STRING_INVALID_STATE,
RDB_ERR_PLAIN_HASH_INVALID_STATE,
RDB_ERR_PLAIN_LIST_INVALID_STATE,
RDB_ERR_PLAIN_SET_INVALID_STATE,
RDB_ERR_PLAIN_ZSET_INVALID_STATE,
RDB_ERR_QUICK_LIST_INVALID_STATE,
RDB_ERR_SSTYPE_INVALID_STATE,
RDB_ERR_MODULE_INVALID_STATE,
Expand Down Expand Up @@ -255,18 +258,21 @@ typedef struct RdbHandlersStructCallbacks {
RdbRes (*handleSetIS)(RdbParser *p, void *userData, RdbBulk intset);
/* Callback to handle a listpack-based set value */
RdbRes (*handleSetLP)(RdbParser *p, void *userData, RdbBulk listpack);

/* Callback to handle an item from a plain sorted set */
RdbRes (*handleZsetPlain)(RdbParser *p, void *userData, RdbBulk item, double score);
/* Callback to handle a ziplist-based sorted set value */
RdbRes (*handleZsetZL)(RdbParser *p, void *userData, RdbBulk ziplist);
/* Callback to handle a listpack-based sorted set value */
RdbRes (*handleZsetLP)(RdbParser *p, void *userData, RdbBulk listpack);

/* Callback to handle function code */
RdbRes (*handleFunction)(RdbParser *p, void *userData, RdbBulk func);
/* Callback to handle module. Currently only reports about the name & size. */
RdbRes (*handleModule)(RdbParser *p, void *userData, RdbBulk moduleName, size_t serializedSize);

/*** TODO: RdbHandlersStructCallbacks: ***/

/* Callback to handle a ziplist-based sorted set value */
RdbRes (*handleZsetZL)(RdbParser *p, void *userData, RdbBulk ziplist);
/* Callback to handle a listpack-based sorted set value */
RdbRes (*handleZsetLP)(RdbParser *p, void *userData, RdbBulk listpack);

/*** TODO: RdbHandlersStructCallbacks: stream stuff ... ***/

/* Callback to handle a stream key with listpack value */
Expand Down
Loading

0 comments on commit 6396000

Please sign in to comment.