This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new c4c0683 HADOOP-17505. public interface GroupMappingServiceProvider
needs default impl for getGroupsSet() (#2661). Contributed by Vinayakumar B.
c4c0683 is described below
commit c4c0683dff577a91ca978939e182ec0fee65b7c3
Author: Vinayakumar B <[email protected]>
AuthorDate: Thu Apr 22 01:02:03 2021 +0530
HADOOP-17505. public interface GroupMappingServiceProvider needs default
impl for getGroupsSet() (#2661). Contributed by Vinayakumar B.
---
.../org/apache/hadoop/security/GroupMappingServiceProvider.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/GroupMappingServiceProvider.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/GroupMappingServiceProvider.java
index ff6c86d..3a9073b 100644
---
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/GroupMappingServiceProvider.java
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/GroupMappingServiceProvider.java
@@ -18,6 +18,7 @@
package org.apache.hadoop.security;
import java.io.IOException;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
@@ -61,5 +62,8 @@ public interface GroupMappingServiceProvider {
* @return set of group memberships of user
* @throws IOException
*/
- Set<String> getGroupsSet(String user) throws IOException;
+ default Set<String> getGroupsSet(String user) throws IOException {
+ //Override to form the set directly to avoid another conversion
+ return new LinkedHashSet<>(getGroups(user));
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]