-
Notifications
You must be signed in to change notification settings - Fork 0
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
Introduce RemoteIndexClient #1
Introduce RemoteIndexClient #1
Conversation
Signed-off-by: Jay Deng <[email protected]>
47db2b4
to
d7e9ce3
Compare
Add RemoteIndexClient initial implementation, its accompanying dependencies, and Build Request, Retry Strategy, and test files Signed-off-by: owenhalpert <[email protected]>
d7e9ce3
to
84ba0ca
Compare
src/main/java/org/opensearch/knn/index/codec/nativeindex/remote/RemoteIndexBuildStrategy.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/nativeindex/remote/RemoteIndexBuildStrategy.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/codec/nativeindex/remote/RemoteIndexBuildStrategy.java
Show resolved
Hide resolved
* @return The HTTP Client | ||
*/ | ||
private CloseableHttpClient createHttpClient() { | ||
// TODO The client will need to be rebuilt iff we decide to allow for retry configuration in the future |
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.
Let's clearly delineate what is going in the first cut vs what is going in future work. You can use opensearch-project#2464 for future work.
* @return job_id from the server response used to track the job | ||
*/ | ||
public String submitVectorBuild(RemoteBuildRequest request) throws IOException { | ||
URI endpoint = URI.create(KNNSettings.state().getSettingValue(KNNSettings.KNN_REMOTE_BUILD_SERVICE_ENDPOINT)); |
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 need to have validation on the settings, and we should also add this to shouldBuildIndexRemotely
src/main/java/org/opensearch/knn/index/remote/RemoteIndexClient.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/knn/index/remote/RemoteIndexClient.java
Outdated
Show resolved
Hide resolved
* InterruptedExceptions will cause a fallback to local CPU build. | ||
*/ | ||
@Log4j2 | ||
public class RemoteIndexClient { |
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.
I wonder if we need an interface here to support extending to other client types, for example if we want to support not polling in the future or gRPC or anything else. It may make testing easier too.
src/main/java/org/opensearch/knn/index/remote/RemoteIndexClientRetryStrategy.java
Outdated
Show resolved
Hide resolved
4b9e282
to
97ff4b7
Compare
Access modifiers, small refactoring variable names and constants
Description
First PR for opensearch-project#2518 (Client Skeleton, Build Request, Error Handling, Unit Tests)
This PR introduces the initial implementation of the Remote Index client, which is awaiting implementation on the following:
Related Issues
opensearch-project#2391 Meta Issue
opensearch-project#2393 HLD by @jed326
opensearch-project#2518 My LLD
Check List
- [ ] New functionality has been documented.- [ ] API changes companion pull request created.--signoff
.- [ ] Public documentation issue/PR created.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.