[core] Add basic implementation to support REST Catalog#4553
[core] Add basic implementation to support REST Catalog#4553JingsongLi merged 60 commits intoapache:masterfrom
Conversation
63a8f41 to
289fbb9
Compare
|
|
||
| /** Request to get config. */ | ||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public class ConfigRequest implements RESTRequest { |
There was a problem hiding this comment.
Should it contains warehouse? Or maybe we cannot let user to config warehouse option.
There was a problem hiding this comment.
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.
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.
Just use SynchronousQueue, remove queueSize option.
| public void close() throws Exception {} | ||
|
|
||
| @VisibleForTesting | ||
| Map<String, String> optionsInner( |
There was a problem hiding this comment.
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.
We need to merge authHeader too?
There was a problem hiding this comment.
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.
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.
Maybe check this in RestCatalog class?
| <filters> | ||
| <filter> | ||
| <artifact>*:*</artifact> | ||
| <excludes> |
There was a problem hiding this comment.
Why need to exclude NOTICE and LICENSE?
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