-
Notifications
You must be signed in to change notification settings - Fork 580
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
base: research
Are you sure you want to change the base?
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:
|
…icrosoft#1248) * Avoid memory allocation for hash operations wherever possible * Also reuse the existing value array for HSET * Changing ReadOnlySpan argument of WriteIntegerFromBytes scoped * Added an helper for key reading + avoid allocation for double increment --------- Co-authored-by: Tal Zaccai <talzacc@microsoft.com>
…meout. (microsoft#1262) Co-authored-by: Tal Zaccai <talzacc@microsoft.com>
* fix regression in script loading; previously, if repeatedly reloading the same script into a session would cause the cache to churn each time - substantially increasing allocations and runtime of SCRIPT|LOAD and EVAL * formatting * small style cleanups * min requirement of powershell 7, just for a nicer error message
* fix replication propagation in stored proc * add test for replication store proc * nit fix * enable ReadWriteSession for AofReplay * use txnVersion for enqueue in transactionManager * address comments
…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
).