Merge -r 1362750:1362751 from trunk to branch. FIXES: MAPREDUCE-4406
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1362752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1aa9249c61
commit
bd359a1a8e
|
@ -3,6 +3,9 @@ Hadoop MapReduce Change Log
|
||||||
MAPREDUCE-4422. YARN_APPLICATION_CLASSPATH needs a documented default value in
|
MAPREDUCE-4422. YARN_APPLICATION_CLASSPATH needs a documented default value in
|
||||||
YarnConfiguration. (ahmed via tucu)
|
YarnConfiguration. (ahmed via tucu)
|
||||||
|
|
||||||
|
MAPREDUCE-4406. Users should be able to specify the MiniCluster ResourceManager
|
||||||
|
and JobHistoryServer ports. (ahmed via tucu)
|
||||||
|
|
||||||
Release 2.1.0-alpha - Unreleased
|
Release 2.1.0-alpha - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -134,4 +134,15 @@ public class JHAdminConfig {
|
||||||
*/
|
*/
|
||||||
public static final String MR_HISTORY_STORAGE =
|
public static final String MR_HISTORY_STORAGE =
|
||||||
MR_HISTORY_PREFIX + "store.class";
|
MR_HISTORY_PREFIX + "store.class";
|
||||||
|
|
||||||
|
/** Whether to use fixed ports with the minicluster. */
|
||||||
|
public static final String MR_HISTORY_MINICLUSTER_FIXED_PORTS = MR_HISTORY_PREFIX
|
||||||
|
+ "minicluster.fixed.ports";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default is false to be able to run tests concurrently without port
|
||||||
|
* conflicts.
|
||||||
|
*/
|
||||||
|
public static boolean DEFAULT_MR_HISTORY_MINICLUSTER_FIXED_PORTS = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,10 +113,6 @@ public class MiniMRYarnCluster extends MiniYARNCluster {
|
||||||
// for corresponding uberized tests.
|
// for corresponding uberized tests.
|
||||||
conf.setBoolean(MRJobConfig.JOB_UBERTASK_ENABLE, false);
|
conf.setBoolean(MRJobConfig.JOB_UBERTASK_ENABLE, false);
|
||||||
|
|
||||||
// Set config for JH Server
|
|
||||||
conf.set(JHAdminConfig.MR_HISTORY_ADDRESS,
|
|
||||||
JHAdminConfig.DEFAULT_MR_HISTORY_ADDRESS);
|
|
||||||
|
|
||||||
super.init(conf);
|
super.init(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,10 +124,15 @@ public class MiniMRYarnCluster extends MiniYARNCluster {
|
||||||
@Override
|
@Override
|
||||||
public synchronized void start() {
|
public synchronized void start() {
|
||||||
try {
|
try {
|
||||||
|
if (!getConfig().getBoolean(
|
||||||
|
JHAdminConfig.MR_HISTORY_MINICLUSTER_FIXED_PORTS,
|
||||||
|
JHAdminConfig.DEFAULT_MR_HISTORY_MINICLUSTER_FIXED_PORTS)) {
|
||||||
|
// pick free random ports.
|
||||||
getConfig().set(JHAdminConfig.MR_HISTORY_ADDRESS,
|
getConfig().set(JHAdminConfig.MR_HISTORY_ADDRESS,
|
||||||
MiniYARNCluster.getHostname() + ":0");
|
MiniYARNCluster.getHostname() + ":0");
|
||||||
getConfig().set(JHAdminConfig.MR_HISTORY_WEBAPP_ADDRESS,
|
getConfig().set(JHAdminConfig.MR_HISTORY_WEBAPP_ADDRESS,
|
||||||
MiniYARNCluster.getHostname() + ":0");
|
MiniYARNCluster.getHostname() + ":0");
|
||||||
|
}
|
||||||
historyServer = new JobHistoryServer();
|
historyServer = new JobHistoryServer();
|
||||||
historyServer.init(getConfig());
|
historyServer.init(getConfig());
|
||||||
new Thread() {
|
new Thread() {
|
||||||
|
|
|
@ -565,6 +565,16 @@ public class YarnConfiguration extends Configuration {
|
||||||
|
|
||||||
public static final String IS_MINI_YARN_CLUSTER = YARN_PREFIX + ".is.minicluster";
|
public static final String IS_MINI_YARN_CLUSTER = YARN_PREFIX + ".is.minicluster";
|
||||||
|
|
||||||
|
/** Whether to use fixed ports with the minicluster. */
|
||||||
|
public static final String YARN_MINICLUSTER_FIXED_PORTS = YARN_PREFIX
|
||||||
|
+ "minicluster.fixed.ports";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default is false to be able to run tests concurrently without port
|
||||||
|
* conflicts.
|
||||||
|
*/
|
||||||
|
public static boolean DEFAULT_YARN_MINICLUSTER_FIXED_PORTS = false;
|
||||||
|
|
||||||
public YarnConfiguration() {
|
public YarnConfiguration() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,8 +135,10 @@ public class MiniYARNCluster extends CompositeService {
|
||||||
public synchronized void start() {
|
public synchronized void start() {
|
||||||
try {
|
try {
|
||||||
getConfig().setBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, true);
|
getConfig().setBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, true);
|
||||||
getConfig().set(YarnConfiguration.RM_ADDRESS,
|
if (!getConfig().getBoolean(
|
||||||
MiniYARNCluster.getHostname() + ":0");
|
YarnConfiguration.YARN_MINICLUSTER_FIXED_PORTS,
|
||||||
|
YarnConfiguration.DEFAULT_YARN_MINICLUSTER_FIXED_PORTS)) {
|
||||||
|
// pick free random ports.
|
||||||
getConfig().set(YarnConfiguration.RM_ADDRESS,
|
getConfig().set(YarnConfiguration.RM_ADDRESS,
|
||||||
MiniYARNCluster.getHostname() + ":0");
|
MiniYARNCluster.getHostname() + ":0");
|
||||||
getConfig().set(YarnConfiguration.RM_ADMIN_ADDRESS,
|
getConfig().set(YarnConfiguration.RM_ADMIN_ADDRESS,
|
||||||
|
@ -147,6 +149,7 @@ public class MiniYARNCluster extends CompositeService {
|
||||||
MiniYARNCluster.getHostname() + ":0");
|
MiniYARNCluster.getHostname() + ":0");
|
||||||
getConfig().set(YarnConfiguration.RM_WEBAPP_ADDRESS,
|
getConfig().set(YarnConfiguration.RM_WEBAPP_ADDRESS,
|
||||||
MiniYARNCluster.getHostname() + ":0");
|
MiniYARNCluster.getHostname() + ":0");
|
||||||
|
}
|
||||||
Store store = StoreFactory.getStore(getConfig());
|
Store store = StoreFactory.getStore(getConfig());
|
||||||
resourceManager = new ResourceManager(store) {
|
resourceManager = new ResourceManager(store) {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue