abstractdog commented on code in PR #4882:
URL: https://github.com/apache/hive/pull/4882#discussion_r1759149926
##########
common/src/java/org/apache/hadoop/hive/common/UgiFactory.java:
##########
@@ -15,8 +15,20 @@
package org.apache.hadoop.hive.common;
import java.io.IOException;
+
+import org.apache.hadoop.security.Credentials;
import org.apache.hadoop.security.UserGroupInformation;
public interface UgiFactory {
- UserGroupInformation createUgi() throws IOException;
+ /*
+ * Creates a UserGroupInformation instance for a user with credentials in a
scope of a specific query.
+ * Subclasses might implement a cache for taking care of reusing an existing
ugi for the same query if possible.
+ */
+ UserGroupInformation createUgi(String queryIdentifier, String user,
Credentials credentials) throws IOException;
+
+ /*
+ * Closes all filesystems for a specific query.
+ * In LLAP daemons for the same dag user and credentials, this call
typically closes a single FileSystem instance.
+ */
+ void closeFileSystemsForQuery(String queryIdentifier);
Review Comment:
considering factory pattern strictly, yes, in this case I think we should
just rename this to something else
AbstractLlapUgiFactory which is the primary implementor of this interface
has an internal state (ugis map), which is needed when we want to close all the
Fs objects that belong to a query, so the method should be called on this object
so I guess all the factory hierarch should be renamed to something else,
like a "manager", so from:
```
UgiFactory -> AbstractLlapUgiFactory -> KerberosUgiFactory / NoopUgiFactory
```
... it might become:
```
UgiManager -> AbstractLlapUgiManager -> KerberosUgiManager / NoopUgiManager
```
are you fine with this @deniskuzZ ?
--
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]