-
Notifications
You must be signed in to change notification settings - Fork 33
Add DataPlaneTokenSource and EndpointTokenSource #449
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
Conversation
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (o == null || getClass() != o.getClass()) { | ||
| return false; | ||
| } | ||
| TokenSourceKey that = (TokenSourceKey) o; | ||
| return Objects.equals(endpoint, that.endpoint) | ||
| && Objects.equals(authDetails, that.authDetails); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { |
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.
Since we’re using objects of this class as HashMap keys, we need to override the equals() method to define when two keys are considered equal, and the hashCode() method so the HashMap can efficiently store and retrieve the values by keys.
parthban-db
left a comment
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.
One thing that we can test more in dataplaneTokenSource is whether we are using the cached endpointTokenSource or not for the same key (the number of times we are calling the endpointTokenSource constructor). It may not need to be fit on the same parameterized tests as this is a different kind of test.
Rest is LGTM!
|
Also, can you change the PR title to something more relevant to the change, like "Add DataPlaneTokenSource?" |
databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/DataPlaneTokenSource.java
Outdated
Show resolved
Hide resolved
databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/TokenEndpointClient.java
Show resolved
Hide resolved
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
What changes are proposed in this pull request?
Direct Dataplane Access for Databricks Java SDK
This PR adds the required classes for direct dataplane access in the Databricks Java SDK.
DataPlaneTokenSourceEndpointTokenSourceinstances.EndpointTokenSourceper unique endpoint and set of authorization details.EndpointTokenSourceTokenEndpointClientHow is this tested?
NO_CHANGELOG=true