You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2023/09/11 13:46:44 UTC

[GitHub] [kvrocks] PragmaTwice edited a comment on the discussion: Talks about the design of consumer group in stream

GitHub user PragmaTwice edited a comment on the discussion: Talks about the design of consumer group in stream

> what exactly is key metadata and sub-key ?

Metadata is just how the datatype (especially properties of the datatype) is encoded in the rocksdb key-value interface.
so it is about **reduction** or **encoding**.

Usually metadata refers to how the value (of key-value) is encoded.

For encoding a key, like a user key `x`, the kvrocks add more information to the key for some kvrocks features, like `x` -> `<namespace> <key length: 1> x`.

And if `x` is typed hash, the key `<namespace> <key length: 1> x` is mapped to the value (the metadata) `<hash flag> <expire time> <version> <size>`.

Then if we add some elements to the hash `x`, some more key-value will be added. For example if we add `a -> 1` to hash `x`, the underlying rocksdb key-value that need to be added is `<namespace> <key length: 1> x <version> <subkey: a>` -> `1`.

So the subkey is just to distinguish with the user key. And then when we delete a key `x`, all of keys prefixed `<namespace> <key length: 1> x` will be deleted, including all its subkeys. 


GitHub link: https://github.com/apache/kvrocks/discussions/1654#discussioncomment-6967973

----
This is an automatically sent email for issues@kvrocks.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@kvrocks.apache.org