HADOOP-17505. public interface GroupMappingServiceProvider needs default impl for getGroupsSet() (#2661). Contributed by Vinayakumar B.
This commit is contained in:
parent
5221322b96
commit
c4c0683dff
@ -18,6 +18,7 @@
|
|||||||
package org.apache.hadoop.security;
|
package org.apache.hadoop.security;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -61,5 +62,8 @@ public interface GroupMappingServiceProvider {
|
|||||||
* @return set of group memberships of user
|
* @return set of group memberships of user
|
||||||
* @throws IOException
|
* @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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user