Skip to content

Conversation

@mildbyte
Copy link
Contributor

The factory makes sure that object_store clients are only built once (using the URL and options as the key, no expiry) instead of on every call. This means that the cached data from the same object store will be shared across several queries and won't get reset.

- The factory makes sure that object_store clients are only built once
   (using the URL and options as the key, no expiry) instead of on every
   call. This means that the cached data from the same object store
   will be shared across several queries and won't get reset.
@mildbyte mildbyte requested a review from gruuya April 17, 2024 07:27

pub struct ObjectStoreFactory {
default_store: Arc<InternalObjectStore>,
custom_stores: RwLock<HashMap<StoreCacheKey, Arc<dyn ObjectStore>>>,
Copy link
Contributor

@gruuya gruuya Apr 17, 2024

Choose a reason for hiding this comment

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

Let's consider doing this, though we can do it in a follow-up PR.

Suggested change
custom_stores: RwLock<HashMap<StoreCacheKey, Arc<dyn ObjectStore>>>,
custom_stores: DashMap<StoreCacheKey, Arc<dyn ObjectStore>>,

@mildbyte mildbyte merged commit cd8b5c5 into main Apr 17, 2024
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.

3 participants