PragmaTwice commented on code in PR #1489:
URL: 
https://github.com/apache/incubator-kvrocks/pull/1489#discussion_r1234790169


##########
src/server/server.h:
##########
@@ -84,6 +88,24 @@ struct ChannelSubscribeNum {
   size_t subscribe_num;
 };
 
+// CURSOR_DICT_SIZE must be 2^n where n <= 16
+constexpr const size_t CURSOR_DICT_SIZE = 1024 * 16;
+static_assert((CURSOR_DICT_SIZE & (CURSOR_DICT_SIZE - 1)) == 0, 
"CURSOR_DICT_SIZE must be 2^n");
+static_assert(CURSOR_DICT_SIZE <= (1 << 15), "CURSOR_DICT_SIZE must be less 
than or equal to 2^16");
+
+enum CursorType {
+  kTypeBase,  // cursor for SCAN
+  kTypeHash,  // cursor for HSCAN
+  kTypeSet,   // cursor for SSCAN
+  kTypeZSet,  // cursor for ZSCAN
+};
+
+struct CursorDictElement {
+  uint64_t cursor;
+  CursorType cursor_type;

Review Comment:
   Could this also be encoded to the cursor? Seems we can take about 4 bit out 
of 32bit hash for it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to