rdblue commented on code in PR #4575:
URL: https://github.com/apache/iceberg/pull/4575#discussion_r852354177
##########
core/src/main/java/org/apache/iceberg/rest/RESTCatalog.java:
##########
@@ -26,425 +26,217 @@
import java.util.Set;
import java.util.function.Function;
import org.apache.hadoop.conf.Configuration;
-import org.apache.iceberg.BaseTable;
-import org.apache.iceberg.CatalogProperties;
-import org.apache.iceberg.CatalogUtil;
-import org.apache.iceberg.MetadataUpdate;
import org.apache.iceberg.PartitionSpec;
import org.apache.iceberg.Schema;
-import org.apache.iceberg.SortOrder;
import org.apache.iceberg.Table;
-import org.apache.iceberg.TableMetadata;
import org.apache.iceberg.Transaction;
-import org.apache.iceberg.Transactions;
import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.catalog.Namespace;
+import org.apache.iceberg.catalog.SessionCatalog;
import org.apache.iceberg.catalog.SupportsNamespaces;
import org.apache.iceberg.catalog.TableIdentifier;
import org.apache.iceberg.exceptions.NamespaceNotEmptyException;
import org.apache.iceberg.exceptions.NoSuchNamespaceException;
-import org.apache.iceberg.exceptions.NoSuchTableException;
import org.apache.iceberg.hadoop.Configurable;
-import org.apache.iceberg.io.FileIO;
-import org.apache.iceberg.io.ResolvingFileIO;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
-import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
-import org.apache.iceberg.relocated.com.google.common.collect.Maps;
-import org.apache.iceberg.rest.requests.CreateNamespaceRequest;
-import org.apache.iceberg.rest.requests.CreateTableRequest;
-import org.apache.iceberg.rest.requests.UpdateNamespacePropertiesRequest;
-import org.apache.iceberg.rest.responses.ConfigResponse;
-import org.apache.iceberg.rest.responses.CreateNamespaceResponse;
-import org.apache.iceberg.rest.responses.GetNamespaceResponse;
-import org.apache.iceberg.rest.responses.ListNamespacesResponse;
-import org.apache.iceberg.rest.responses.ListTablesResponse;
-import org.apache.iceberg.rest.responses.LoadTableResponse;
-import org.apache.iceberg.rest.responses.UpdateNamespacePropertiesResponse;
-import org.apache.iceberg.util.Pair;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class RESTCatalog implements Catalog, SupportsNamespaces,
Configurable<Configuration>, Closeable {
- private static final Logger LOG = LoggerFactory.getLogger(RESTCatalog.class);
- private final Function<Map<String, String>, RESTClient> clientBuilder;
- private RESTClient client = null;
- private String catalogName = null;
- private Map<String, String> properties = null;
- private ResourcePaths paths = null;
- private Object conf = null;
- private FileIO io = null;
+ private final RESTSessionCatalog sessionCatalog;
+ private final SessionCatalog.SessionContext context;
+ private final Catalog delegate;
+ private final SupportsNamespaces nsDelegate;
+ private String name;
+ private Map<String, String> properties;
public RESTCatalog() {
- this(new HTTPClientFactory());
+ this(SessionCatalog.SessionContext.createEmpty(), new HTTPClientFactory());
Review Comment:
This class was moved to be `RESTSessionCatalog`. The implementation here is
completely new. The purpose of this class is to wrap a `RESTSessionCatalog` and
always pass a global session context.
--
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]