MAPREDUCE-6090. mapred hsadmin getGroups fails to connect in some cases. Contributed by Robert Kanter

(cherry picked from commit 1cf3198047)
This commit is contained in:
Jason Lowe 2014-09-18 21:00:53 +00:00
parent 44c22c3d8d
commit 4b4e44a8aa
3 changed files with 10 additions and 4 deletions

View File

@ -130,6 +130,9 @@ Release 2.6.0 - UNRELEASED
MAPREDUCE-6070. yarn.app.am.resource.mb/cpu-vcores affects uber mode but MAPREDUCE-6070. yarn.app.am.resource.mb/cpu-vcores affects uber mode but
is not documented (Tsuyoshi OZAWA via jlowe) is not documented (Tsuyoshi OZAWA via jlowe)
MAPREDUCE-6090. mapred hsadmin getGroups fails to connect in some cases
(Robert Kanter via jlowe)
Release 2.5.1 - 2014-09-05 Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -25,6 +25,7 @@ import java.util.Arrays;
import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured; import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.v2.hs.HSProxies; import org.apache.hadoop.mapreduce.v2.hs.HSProxies;
import org.apache.hadoop.mapreduce.v2.hs.protocol.HSAdminRefreshProtocol; import org.apache.hadoop.mapreduce.v2.hs.protocol.HSAdminRefreshProtocol;
import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig; import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
@ -41,7 +42,7 @@ public class HSAdmin extends Configured implements Tool {
super(); super();
} }
public HSAdmin(Configuration conf) { public HSAdmin(JobConf conf) {
super(conf); super(conf);
} }
@ -331,7 +332,8 @@ public class HSAdmin extends Configured implements Tool {
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
int result = ToolRunner.run(new HSAdmin(), args); JobConf conf = new JobConf();
int result = ToolRunner.run(new HSAdmin(conf), args);
System.exit(result); System.exit(result);
} }
} }

View File

@ -28,6 +28,7 @@ import java.util.List;
import org.apache.hadoop.HadoopIllegalArgumentException; import org.apache.hadoop.HadoopIllegalArgumentException;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.v2.hs.JobHistory; import org.apache.hadoop.mapreduce.v2.hs.JobHistory;
import org.apache.hadoop.mapreduce.v2.hs.client.HSAdmin; import org.apache.hadoop.mapreduce.v2.hs.client.HSAdmin;
import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig; import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
@ -48,7 +49,7 @@ import org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService;
public class TestHSAdminServer { public class TestHSAdminServer {
private HSAdminServer hsAdminServer = null; private HSAdminServer hsAdminServer = null;
private HSAdmin hsAdminClient = null; private HSAdmin hsAdminClient = null;
Configuration conf = null; JobConf conf = null;
private static long groupRefreshTimeoutSec = 1; private static long groupRefreshTimeoutSec = 1;
JobHistory jobHistoryService = null; JobHistory jobHistoryService = null;
AggregatedLogDeletionService alds = null; AggregatedLogDeletionService alds = null;
@ -81,7 +82,7 @@ public class TestHSAdminServer {
@Before @Before
public void init() throws HadoopIllegalArgumentException, IOException { public void init() throws HadoopIllegalArgumentException, IOException {
conf = new Configuration(); conf = new JobConf();
conf.set(JHAdminConfig.JHS_ADMIN_ADDRESS, "0.0.0.0:0"); conf.set(JHAdminConfig.JHS_ADMIN_ADDRESS, "0.0.0.0:0");
conf.setClass("hadoop.security.group.mapping", MockUnixGroupsMapping.class, conf.setClass("hadoop.security.group.mapping", MockUnixGroupsMapping.class,
GroupMappingServiceProvider.class); GroupMappingServiceProvider.class);