-
Notifications
You must be signed in to change notification settings - Fork 970
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] Add basic implementation to support REST Catalog #4553
Conversation
63a8f41
to
289fbb9
Compare
|
||
/** Request to get config. */ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class ConfigRequest implements RESTRequest { |
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.
Should it contains warehouse? Or maybe we cannot let user to config warehouse option.
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.
The parameter should disable the warehouse because catalogs and warehouses are one-to-one for defined catalogs, so the client should not be able to define a warehouse.
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.
As get config use HTTP get is enough, i deleted this class.
paimon-core/src/main/java/org/apache/paimon/rest/RESTCatalog.java
Outdated
Show resolved
Hide resolved
|
||
private static OkHttpClient createHttpClient(HttpClientOptions httpClientOptions) { | ||
BlockingQueue<Runnable> workQueue = | ||
new LinkedBlockingQueue<>(httpClientOptions.queueSize()); |
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.
Just use SynchronousQueue
, remove queueSize
option.
public void close() throws Exception {} | ||
|
||
@VisibleForTesting | ||
Map<String, String> optionsInner( |
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.
optionsInner
-> fetchOptionsFromServer
Map<String, String> initHeaders = | ||
RESTUtil.merge(configHeaders(options.toMap()), authHeaders(token)); | ||
this.options = optionsInner(initHeaders, options.toMap()); | ||
this.baseHeader = configHeaders(this.options()); |
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 merge authHeader too?
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.
When set up, we need to merge the auth header. Later, we will support using header() to refresh the token.
return response.merge(clientProperties); | ||
} | ||
|
||
private Map<String, String> authHeaders(String token) { |
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.
Maybe it doesn't to be a method, just inline it.
|
||
@Override | ||
public Catalog create(CatalogContext context) { | ||
if (context.options().getOptional(CatalogOptions.WAREHOUSE).isPresent()) { |
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.
Maybe check this in RestCatalog class?
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> |
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.
Why need to exclude NOTICE and LICENSE?
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.
+1
Purpose
Add basic implementation to support REST Catalog
Linked issue: #4540
Add basic implementation to support REST Catalog
Tests
UT:
API and Format
No
Documentation