-
Notifications
You must be signed in to change notification settings - Fork 586
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
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
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-seq
wherets
is generally the timestamp andseq
is the sequence number.STREAM
The Stream Object that consists of an instance to its
B-tree
index and aTsavorite
log instance for persistence. Every entry added to a Stream is first inserted into theTsavorite
log that returns the added address. This address is added as thevalue
to the index using theSTREAMID
askey
.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
capacity
and uses a simpleFIFO
policy for the initial version. Can be extended to support other eviction strategies (preferablyLRU
).