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

feat: download snapshots #12

Closed
wants to merge 2 commits into from
Closed

feat: download snapshots #12

wants to merge 2 commits into from

Conversation

Anush008
Copy link
Member

This PR intends to add the downloadSnapshots() method to the Qdrant client. No additional deps.

Path outPath,
String collectionName,
@Nullable String snapshotName,
@Nullable String restApiUri) throws InterruptedException, IOException, ExecutionException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a little awkward for the caller to provide the REST API endpoint in the method call.

WDYT about creating a QdrantHttpClient, passing as a ctor argument to QdrantClient, and delegating this method to a method on QdrantHttpClient ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was inspired from the Rust client implementation.
https://docs.rs/qdrant-client/latest/qdrant_client/client/struct.QdrantClient.html#method.download_snapshot
Since, I don't see any further usage of the REST API except for this, an explicit HTTPClient doesn't seem necessary considering the sparse usage.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you know what the rationale is for allowing a consumer to provide the scheme, host and port on the method, rather than as a constructor parameter?

I can imagine a consumer also needing to configure the API key, timeouts, maybe proxy information. Even if it were a super simple HTTP client that wrapped e.g. CloseableHttpAsyncClient from org.apache.httpcomponents:httpasyncclient, it would provide an extension point to evolve in future.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. The extension would be much desirable.

Comment on lines 2423 to 2428
uri = String.format(
"%s/collections/%s/snapshots/%s", restApiUri, collectionName, resolvedSnapshotName);
} else {
uri = String.format(
"http://localhost:6333/collections/%s/snapshots/%s",
collectionName, resolvedSnapshotName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

URI building should be done with correct encoding of path parts. If a QdrantHttpClient is implemented, the underlying HTTP client library used likely also has URI building methods.

@Anush008
Copy link
Member Author

To be updated with a HTTPClient implementation.

@Anush008 Anush008 closed this Dec 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