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

Core: Allow servers to express supported endpoints via endpoint field in ConfigResponse #10929

Merged
merged 8 commits into from
Sep 13, 2024

Conversation

nastra
Copy link
Contributor

@nastra nastra commented Aug 13, 2024

No description provided.

@github-actions github-actions bot added the core label Aug 13, 2024
@nastra nastra force-pushed the endpoint-discovery branch from 18cedde to 596b7eb Compare August 13, 2024 09:14
@nastra nastra changed the title Core: Add endpoints field to ConfigResponse Core: Allow servers to express supported endpoints via endpoint field in ConfigResponse Aug 13, 2024
@nastra nastra marked this pull request as draft August 13, 2024 09:15
@nastra nastra force-pushed the endpoint-discovery branch from 596b7eb to d343cbf Compare August 13, 2024 09:28
@nastra nastra force-pushed the endpoint-discovery branch 2 times, most recently from 83adaf1 to cca93fd Compare August 14, 2024 10:06
@nastra nastra requested a review from rdblue August 14, 2024 11:18
@nastra nastra mentioned this pull request Aug 14, 2024
6 tasks
* resource path as defined in the Iceberg OpenAPI REST specification without parameter
* substitution, such as <b>/v1/{prefix}/namespaces/{namespace}</b>.
*/
public class Endpoint {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: this could probably be an enum + a (derived) Map<String, enum> for loasing server config responses. The spec defines a fixed representation for every value, so parsing is not really necessary, I think, the spec'd values can be keys in that map.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah good point and I'll probably change that once we agree on the final JSON representation for a single endpoint

Copy link
Contributor

@dimas-b dimas-b Aug 26, 2024

Choose a reason for hiding this comment

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

@nastra : Are you still ok with the enum suggestion? I think it will match the corresponding REST API spec change (#10928) closer than attempting to parse and compare for equality by entpoint components (HTTP verb and path).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good either way here, the parsing is relatively trivial and doesn't seem brittle for equality comparisons.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think currently I'm preferring the non-enum approach (basically what's in the PR right now)

Copy link
Contributor

Choose a reason for hiding this comment

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

Then how about not parsing the endpoint IDs? I think the spec makes them unambiguous "in whole". Avoiding parsing and component-wise comparisons, would make the processing of those IDs more robust, IMHO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dimas-b we do perform equality checks to make sure that an endpoint is compared as a "whole". A valid endpoint must be of the form GET /resource/path, which is separated by a single space and the http method must be uppercase + a valid HTTP method, so I'm not sure what the concern here is. Also worth mentioning that all of this is verified in TestEndpoint

@nastra nastra force-pushed the endpoint-discovery branch 2 times, most recently from e261fa8 to b2ccbad Compare August 21, 2024 12:58
@nastra nastra force-pushed the endpoint-discovery branch from b2ccbad to fa22399 Compare August 23, 2024 08:47
@nastra nastra marked this pull request as ready for review August 23, 2024 10:55
@nastra nastra force-pushed the endpoint-discovery branch from 0ce70fe to e7817eb Compare September 9, 2024 13:56
* resource path as defined in the Iceberg OpenAPI REST specification without parameter
* substitution, such as <b>/v1/{prefix}/namespaces/{namespace}</b>.
*/
public class Endpoint {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good either way here, the parsing is relatively trivial and doesn't seem brittle for equality comparisons.

@nastra
Copy link
Contributor Author

nastra commented Sep 13, 2024

I'll go ahead and merge this, thanks everyone for the feedback/reviews

@nastra nastra merged commit a2b8008 into apache:main Sep 13, 2024
46 checks passed
@nastra nastra deleted the endpoint-discovery branch September 13, 2024 16:04
@danielhumanmod
Copy link

Hi, may I know which version of Iceberg will contains this commit? I’m working on a feature in Apache Polaris to support endpoints in /v1/config. Understanding the release timeline for this feature would help us better planning our Iceberg dependency upgrade :)

@nastra
Copy link
Contributor Author

nastra commented Oct 17, 2024

@danielhumanmod this will be shipped with Iceberg 1.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants