Selaa lähdekoodia

MAPREDUCE-6090. mapred hsadmin getGroups fails to connect in some cases. Contributed by Robert Kanter
(cherry picked from commit 1cf31980474bf9ac28e51b6f014eae09eda9e15f)

Jason Lowe 10 vuotta sitten
vanhempi
commit
4b4e44a8aa

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -130,6 +130,9 @@ Release 2.6.0 - UNRELEASED
     MAPREDUCE-6070. yarn.app.am.resource.mb/cpu-vcores affects uber mode but
     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
 
   INCOMPATIBLE CHANGES

+ 4 - 2
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/client/HSAdmin.java

@@ -25,6 +25,7 @@ import java.util.Arrays;
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 import org.apache.hadoop.conf.Configuration;
 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.protocol.HSAdminRefreshProtocol;
 import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
@@ -41,7 +42,7 @@ public class HSAdmin extends Configured implements Tool {
     super();
   }
 
-  public HSAdmin(Configuration conf) {
+  public HSAdmin(JobConf conf) {
     super(conf);
   }
 
@@ -331,7 +332,8 @@ public class HSAdmin extends Configured implements Tool {
   }
 
   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);
   }
 }

+ 3 - 2
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/server/TestHSAdminServer.java

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