Skip to content

Conversation

@kbendick
Copy link
Contributor

@kbendick kbendick commented Feb 22, 2022

Defines the response class used to populate the server-provided configuration.

Per the spec, the catalog client will call the /v1/config endpoint to retrieve a set of overrides and defaults. The default configurations are there to allow clients to not have to provide all details so that end user's don't have to specify values that are commonly used, and the overrides are there so that the server can require a certain value be used.

I've also started updating the REST catalog spec to be more detailed for this part (though I'll probably move that to another PR).

Comment on lines 88 to 95
public Map<String, String> merge(Map<String, String> clientProperties) {
Preconditions.checkNotNull(clientProperties,
"Cannot merge client properties with server-provided properties. Invalid client configuration: null");
Map<String, String> merged = Maps.newHashMap(defaults);
merged.putAll(clientProperties);
merged.putAll(overrides);
return merged;
}
Copy link
Contributor Author

@kbendick kbendick Feb 22, 2022

Choose a reason for hiding this comment

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

This function might be better placed outside of the response object. I haven't included tests for it yet, in case we want to move it to some other utility class or elsewhere (as the request / response object should arguably be more like data classes).

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 fine with it here for now. We can move it later if we think it doesn't fit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. That makes sense for me. This will at least unblock others from working in parallel on this.

@kbendick kbendick marked this pull request as ready for review February 22, 2022 02:03
@kbendick kbendick force-pushed the add-rest-catalog-config-resposne branch 2 times, most recently from ad185b1 to 2f38ccc Compare February 23, 2022 20:28
kbendick added a commit to kbendick/iceberg that referenced this pull request Feb 24, 2022
@kbendick kbendick force-pushed the add-rest-catalog-config-resposne branch from 8c56b5f to 27e688b Compare February 24, 2022 20:50
@kbendick kbendick force-pushed the add-rest-catalog-config-resposne branch from 60ee8ec to 4df1d8e Compare February 24, 2022 22:10
kbendick added a commit to kbendick/iceberg that referenced this pull request Feb 24, 2022
kbendick added a commit to kbendick/iceberg that referenced this pull request Feb 24, 2022
@rdblue rdblue merged commit cffeec5 into apache:master Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants