Skip to content
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

Add object store link #1091

Merged
merged 6 commits into from
Aug 18, 2023
Merged

Add object store link #1091

merged 6 commits into from
Aug 18, 2023

Conversation

Jarema
Copy link
Member

@Jarema Jarema commented Aug 16, 2023

Signed-off-by: Tomasz Pietrek tomasz@nats.io

Jarema added 2 commits August 16, 2023 22:20
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@Jarema Jarema requested a review from neilalexander August 16, 2023 20:31
@Jarema Jarema force-pushed the add-object-store-link branch from dac44be to 4cc97a3 Compare August 16, 2023 20:53
@Jarema Jarema requested a review from piotrpio August 16, 2023 20:54
@@ -850,9 +1066,9 @@ fn is_default<T: Default + Eq>(t: &T) -> bool {
#[derive(Debug, Default, Clone, Serialize, Deserialize, Eq, PartialEq)]
pub struct ObjectLink {
/// Name of the object
pub name: String,
pub name: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this doesn't need to be Option<String> if it's already gated behind AddLinkErrorKind::EmptyName?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still a valid case when adding a link to a bucket instead of object.

Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Jarema added 4 commits August 18, 2023 13:27
Until now, the subscription for reading Object data
was spawn when calling `bucket.get()`.
While that makes sense in many cases when implementing
readers, it can lead to unwanted behaviours in NATS.

The main issue being - there is no guarantee that user
will start reading messages as soon as `bucket.get()` is called.
That can lead to unnecesary idling subscription.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Before this change, users were forced to pass `info` field
from `Object`. This is not very ergonomic, as what library
needs to add link - a whole [Object], or just [ObjectInfo]
should be internal. This change adds a trait that handles that.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@Jarema Jarema force-pushed the add-object-store-link branch from 4cc97a3 to c56bbe7 Compare August 18, 2023 11:27
@Jarema Jarema merged commit 8365b91 into main Aug 18, 2023
@Jarema Jarema deleted the add-object-store-link branch August 18, 2023 12:10
@Jarema Jarema mentioned this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants