-
Notifications
You must be signed in to change notification settings - Fork 624
STREAMS API in Garnet #1131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STREAMS API in Garnet #1131
Conversation
PaulusParssinen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First thanks for contributing!
I see the PR is marked as draft, but there's misunderstanding about the nature of Unsafe.AsPointer I want to help with as early as possible: It's use is always a mistake and unnecessary. Embrace Span<T> and normal struct usage as much as possible. I left few preliminary comments.
|
Two nits:
|
…d output after XADD
|
Is closing this intentional? A tracking PR could be useful for this... |
|
I'm also interested in it's status, streams allows us to use KEDA scaling in K8 |
Adds support for STREAMS in Garnet.
Index Structure
Uses an in-memory B+tree (B-tree) index that has the following features:
Supported Operations in API
The following operations are currently supported:
STREAMID
Stream ID is a 128-bit ID for an entry in the Stream that is of a format
ts-seqwheretsis generally the timestamp andseqis the sequence number.STREAM
The Stream Object that consists of an instance to its
B-treeindex and aTsavoritelog instance for persistence. Every entry added to a Stream is first inserted into theTsavoritelog that returns the added address. This address is added as thevalueto the index using theSTREAMIDaskey.StreamManager
A container/wrapper that holds all Streams in the server in a dictionary.
SessionStreamCache
A local cache of Streams added by the client for faster access. Currently capped at
capacityand uses a simpleFIFOpolicy for the initial version. Can be extended to support other eviction strategies (preferablyLRU).