pvary commented on code in PR #14398:
URL: https://github.com/apache/iceberg/pull/14398#discussion_r2498117029
##########
core/src/main/java/org/apache/iceberg/rest/RESTCatalog.java:
##########
@@ -69,19 +72,39 @@ public RESTCatalog(Function<Map<String, String>,
RESTClient> clientBuilder) {
public RESTCatalog(
SessionCatalog.SessionContext context,
Function<Map<String, String>, RESTClient> clientBuilder) {
- this.sessionCatalog = new RESTSessionCatalog(clientBuilder, null);
+ this(context, clientBuilder, null);
+ }
+
+ @VisibleForTesting
+ RESTCatalog(
+ SessionCatalog.SessionContext context,
+ Function<Map<String, String>, RESTClient> clientBuilder,
+ BiFunction<SessionCatalog.SessionContext, Map<String, String>, FileIO>
ioBuilder) {
+ this.sessionCatalog = createSessionCatalog(clientBuilder, ioBuilder);
this.delegate = sessionCatalog.asCatalog(context);
this.nsDelegate = (SupportsNamespaces) delegate;
this.context = context;
this.viewSessionCatalog = sessionCatalog.asViewCatalog(context);
}
+ @VisibleForTesting
+ RESTSessionCatalog createSessionCatalog(
Review Comment:
nit: How many places is this used? Do we want to decrease the number of
costructors?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]