Correcting the check-in mistake for HADOOP-10581.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1593361 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
559fcdc2a6
commit
cf7d09e0a2
|
@ -35,6 +35,7 @@ import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -1415,7 +1416,8 @@ public class UserGroupInformation {
|
||||||
public synchronized String[] getGroupNames() {
|
public synchronized String[] getGroupNames() {
|
||||||
ensureInitialized();
|
ensureInitialized();
|
||||||
try {
|
try {
|
||||||
List<String> result = groups.getGroups(getShortUserName());
|
Set<String> result = new LinkedHashSet<String>
|
||||||
|
(groups.getGroups(getShortUserName()));
|
||||||
return result.toArray(new String[result.size()]);
|
return result.toArray(new String[result.size()]);
|
||||||
} catch (IOException ie) {
|
} catch (IOException ie) {
|
||||||
LOG.warn("No groups available for user " + getShortUserName());
|
LOG.warn("No groups available for user " + getShortUserName());
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
package org.apache.hadoop.security;
|
package org.apache.hadoop.security;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
|
||||||
import org.apache.hadoop.io.Text;
|
import org.apache.hadoop.io.Text;
|
||||||
import org.apache.hadoop.metrics2.MetricsRecordBuilder;
|
import org.apache.hadoop.metrics2.MetricsRecordBuilder;
|
||||||
import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
|
import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
|
||||||
|
@ -33,8 +34,9 @@ import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.security.PrivilegedExceptionAction;
|
import java.security.PrivilegedExceptionAction;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import static org.apache.hadoop.fs.CommonConfigurationKeys.HADOOP_USER_GROUP_METRICS_PERCENTILES_INTERVALS;
|
import static org.apache.hadoop.fs.CommonConfigurationKeys.HADOOP_USER_GROUP_METRICS_PERCENTILES_INTERVALS;
|
||||||
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTH_TO_LOCAL;
|
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTH_TO_LOCAL;
|
||||||
|
@ -204,7 +206,7 @@ public class TestUserGroupInformation {
|
||||||
|
|
||||||
System.out.println(userName + ":" + line);
|
System.out.println(userName + ":" + line);
|
||||||
|
|
||||||
ArrayList<String> groups = new ArrayList<String> ();
|
Set<String> groups = new LinkedHashSet<String> ();
|
||||||
String[] tokens = line.split(Shell.TOKEN_SEPARATOR_REGEX);
|
String[] tokens = line.split(Shell.TOKEN_SEPARATOR_REGEX);
|
||||||
for(String s: tokens) {
|
for(String s: tokens) {
|
||||||
groups.add(s);
|
groups.add(s);
|
||||||
|
|
Loading…
Reference in New Issue