YARN-6200. Reverting since the same functionality achieved by YARN-1623.
Revert "YARN-5068. Expose scheduler queue to application master. (Harish Jaiprakash via rohithsharmaks)"
This reverts commit a37b3694ea
.
This commit is contained in:
parent
9fecd5063f
commit
f07b52dc5a
|
@ -170,13 +170,6 @@ public interface ApplicationConstants {
|
|||
*/
|
||||
LD_LIBRARY_PATH("LD_LIBRARY_PATH"),
|
||||
|
||||
/**
|
||||
* $YARN_RESOURCEMANAGER_APPLICATION_QUEUE
|
||||
* The queue into which the app was submitted/launched.
|
||||
*/
|
||||
YARN_RESOURCEMANAGER_APPLICATION_QUEUE(
|
||||
"YARN_RESOURCEMANAGER_APPLICATION_QUEUE"),
|
||||
|
||||
/**
|
||||
* $HADOOP_CONF_DIR
|
||||
* Final, non-modifiable.
|
||||
|
|
|
@ -51,7 +51,6 @@ import org.apache.hadoop.yarn.api.records.ContainerId;
|
|||
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
|
||||
import org.apache.hadoop.yarn.api.records.NodeId;
|
||||
import org.apache.hadoop.yarn.client.NMProxy;
|
||||
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
||||
import org.apache.hadoop.yarn.event.EventHandler;
|
||||
import org.apache.hadoop.yarn.exceptions.YarnException;
|
||||
import org.apache.hadoop.yarn.ipc.YarnRPC;
|
||||
|
@ -187,25 +186,12 @@ public class AMLauncher implements Runnable {
|
|||
ContainerLaunchContext container =
|
||||
applicationMasterContext.getAMContainerSpec();
|
||||
|
||||
// Populate the current queue name in the environment variable.
|
||||
setupQueueNameEnv(container, applicationMasterContext);
|
||||
|
||||
// Finalize the container
|
||||
setupTokens(container, containerID);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
private void setupQueueNameEnv(ContainerLaunchContext container,
|
||||
ApplicationSubmissionContext applicationMasterContext) {
|
||||
String queueName = applicationMasterContext.getQueue();
|
||||
if (queueName == null) {
|
||||
queueName = YarnConfiguration.DEFAULT_QUEUE_NAME;
|
||||
}
|
||||
container.getEnvironment().put(ApplicationConstants.Environment
|
||||
.YARN_RESOURCEMANAGER_APPLICATION_QUEUE.key(), queueName);
|
||||
}
|
||||
|
||||
@Private
|
||||
@VisibleForTesting
|
||||
protected void setupTokens(
|
||||
|
|
|
@ -101,7 +101,6 @@ public class TestApplicationMasterLauncher {
|
|||
String nmHostAtContainerManager = null;
|
||||
long submitTimeAtContainerManager;
|
||||
int maxAppAttempts;
|
||||
private String queueName;
|
||||
|
||||
@Override
|
||||
public StartContainersResponse
|
||||
|
@ -131,8 +130,6 @@ public class TestApplicationMasterLauncher {
|
|||
Long.parseLong(env.get(ApplicationConstants.APP_SUBMIT_TIME_ENV));
|
||||
maxAppAttempts =
|
||||
Integer.parseInt(env.get(ApplicationConstants.MAX_APP_ATTEMPTS_ENV));
|
||||
queueName = env.get(ApplicationConstants.Environment
|
||||
.YARN_RESOURCEMANAGER_APPLICATION_QUEUE.key());
|
||||
return StartContainersResponse.newInstance(
|
||||
new HashMap<String, ByteBuffer>(), new ArrayList<ContainerId>(),
|
||||
new HashMap<ContainerId, SerializedException>());
|
||||
|
@ -232,8 +229,6 @@ public class TestApplicationMasterLauncher {
|
|||
containerManager.nmHostAtContainerManager);
|
||||
Assert.assertEquals(YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS,
|
||||
containerManager.maxAppAttempts);
|
||||
Assert.assertEquals(YarnConfiguration.DEFAULT_QUEUE_NAME,
|
||||
containerManager.queueName);
|
||||
|
||||
MockAM am = new MockAM(rm.getRMContext(), rm
|
||||
.getApplicationMasterService(), appAttemptId);
|
||||
|
|
Loading…
Reference in New Issue