RussellSpitzer commented on code in PR #4575:
URL: https://github.com/apache/iceberg/pull/4575#discussion_r853238699


##########
api/src/main/java/org/apache/iceberg/catalog/SessionCatalog.java:
##########
@@ -0,0 +1,323 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.catalog;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.exceptions.NamespaceNotEmptyException;
+import org.apache.iceberg.exceptions.NoSuchNamespaceException;
+import org.apache.iceberg.exceptions.NoSuchTableException;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+
+/**
+ * A Catalog API for table and namespace operations that includes session 
context.
+ */
+public interface SessionCatalog {
+  /**
+   * Context for a session.
+   */
+  final class SessionContext {
+    private final String sessionId;
+    private final String identity;
+    private final String credential;
+    private final Map<String, String> properties;
+
+    public static SessionContext createEmpty() {
+      return new SessionContext(UUID.randomUUID().toString(), null, null, 
ImmutableMap.of());
+    }
+
+    public SessionContext(String sessionId, String identity, String 
credential, Map<String, String> properties) {
+      this.sessionId = sessionId;
+      this.identity = identity;
+      this.credential = credential;
+      this.properties = properties;
+    }
+
+    /**
+     * Returns a string that identifies this session.
+     * <p>
+     * This can be used for caching state within a session.
+     *
+     * @return a string that identifies this session
+     */
+    public String sessionId() {
+      return sessionId;
+    }
+
+    /**
+     * Returns a string that identifies the current user or principal.
+     * <p>
+     * This identity cannot change for a given session ID.
+     *
+     * @return a user or principal identity string
+     */
+    public String identity() {
+      return identity;
+    }
+
+    /**
+     * Returns a credential string.
+     * <p>
+     * This cannot change for a given session ID.
+     *
+     * @return a credential string
+     */
+    public String credential() {
+      return credential;
+    }
+
+    /**
+     * Returns a map of properties currently set for the session.
+     *
+     * @return a map of properties
+     */
+    public Map<String, String> properties() {
+      return properties;
+    }
+  }
+
+  /**
+   * Initialize given a custom name and a map of catalog properties.
+   *
+   * @param name a custom name for the catalog
+   * @param properties catalog properties
+   */
+  void initialize(String name, Map<String, String> properties);
+
+  /**
+   * Return the name for this catalog.
+   *
+   * @return this catalog's name
+   */
+  String name();
+
+  /**
+   * Return the properties for this catalog.
+   *
+   * @return this catalog's config properties
+   */
+  Map<String, String> properties();
+
+  /**
+   * Return all the identifiers under this namespace.

Review Comment:
   nit: under a given namespace
   
   Since this object doesn't have a specific namespace



-- 
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]

Reply via email to