yuqi1129 commented on code in PR #3852:
URL: https://github.com/apache/gravitino/pull/3852#discussion_r1669997190


##########
catalogs/catalog-hadoop/src/main/java/com/datastrato/gravitino/catalog/hadoop/HadoopCatalogOperations.java:
##########
@@ -370,66 +420,121 @@ public NameIdentifier[] listSchemas(Namespace namespace) 
throws NoSuchCatalogExc
     }
   }
 
-  @Override
-  public Schema createSchema(NameIdentifier ident, String comment, Map<String, 
String> properties)
-      throws NoSuchCatalogException, SchemaAlreadyExistsException {
-    try {
-      if (store.exists(ident, Entity.EntityType.SCHEMA)) {
-        throw new SchemaAlreadyExistsException("Schema %s already exists", 
ident);
-      }
-    } catch (IOException ioe) {
-      throw new RuntimeException("Failed to check if schema " + ident + " 
exists", ioe);
-    }
+  /**
+   * Get the UserGroupInformation based on the NameIdentifier and properties.
+   *
+   * <p>Note: As UserGroupInformation is a static class, to avoid the thread 
safety issue, we need
+   * to use synchronized to ensure the thread safety: Make login and 
getLoginUser atomic.
+   */
+  private synchronized String initKerberos(
+      String keytabPath,
+      Map<String, String> properties,
+      Configuration configuration,
+      NameIdentifier ident) {
+    // Init schema level kerberos authentication.
+    KerberosConfig kerberosConfig = new KerberosConfig(properties);
+    if (kerberosConfig.isKerberosAuth()) {
+      configuration.set(
+          HADOOP_SECURITY_AUTHENTICATION,
+          AuthenticationMethod.KERBEROS.name().toLowerCase(Locale.ROOT));
+      UserGroupInformation.setConfiguration(configuration);

Review Comment:
   done



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

Reply via email to