-
Notifications
You must be signed in to change notification settings - Fork 696
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
[ADDED] ObjectStore API in jetstream package #1450
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.
Generally looks good and playes nicely with the new jetstream
package.
There are few things to adresss.
objAllMetaPreTmpl = "$O.%s.M.>" // $O.<bucket>.M.> // meta stream subject | ||
objChunksPreTmpl = "$O.%s.C.%s" // $O.<bucket>.C.<object-nuid> // chunk message subject | ||
objMetaPreTmpl = "$O.%s.M.%s" // $O.<bucket>.M.<name-encoded> // meta message subject | ||
objNoPending = "0" |
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.
num, instead of no?
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.
It's a "0", so this means "no pending"
streamsReq := streamsRequest{ | ||
Subject: fmt.Sprintf(objAllChunksPreTmpl, "*"), | ||
} | ||
go func() { |
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.
We probably should cancel the goroutine in case of ctx.Done
.
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.
In case of context timeout we will get canceled / deadline exceeded error on page, err := l.streamInfos(ctx, streamsReq)
in line 1244 (when fetching new page) so I don't think it's necessary to add another guard here.
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.
LGTM!
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
b306903
to
ff8804c
Compare
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.
LGTM!
This PR adds ObjectStore API to
jetstream
package.It is for the most part a port of
object.go
andobject_test.go
to the new package, without many changes. All object store tests moved fromnats
package pass in the new package (after adding context and changing structs packages)Notable changes:
jetstream
packagePut()
andWatch()
methods use the legacy push consumers to prevent permission issues when moving to new APIcontext.Context
extensively in line with the rest of the packageSigned-off-by: Piotr Piotrowski piotr@synadia.com