Revert "YARN-6570. No logs were found for running application, running"

This reverts commit e103acc8f4.
This commit is contained in:
Jason Lowe 2017-09-25 11:13:50 -05:00
parent 3ecc1431fc
commit 44b51b0047
7 changed files with 8 additions and 28 deletions

View File

@ -20,7 +20,6 @@ package org.apache.hadoop.yarn.api.records;
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
/** /**
* <p>State of a <code>Container</code>.</p> * <p>State of a <code>Container</code>.</p>
@ -29,15 +28,11 @@ import org.apache.hadoop.classification.InterfaceStability.Unstable;
@Stable @Stable
public enum ContainerState { public enum ContainerState {
/** New container */ /** New container */
NEW, NEW,
/** Running container */ /** Running container */
RUNNING, RUNNING,
/** Completed container */ /** Completed container */
COMPLETE, COMPLETE
}
/** Scheduled (awaiting resources) at the NM. */
@Unstable
SCHEDULED
}

View File

@ -82,7 +82,6 @@ enum ContainerStateProto {
C_NEW = 1; C_NEW = 1;
C_RUNNING = 2; C_RUNNING = 2;
C_COMPLETE = 3; C_COMPLETE = 3;
C_SCHEDULED = 4;
} }
message ContainerProto { message ContainerProto {

View File

@ -363,11 +363,9 @@ public class ContainerImpl implements Container {
public org.apache.hadoop.yarn.api.records.ContainerState getCurrentState() { public org.apache.hadoop.yarn.api.records.ContainerState getCurrentState() {
switch (stateMachine.getCurrentState()) { switch (stateMachine.getCurrentState()) {
case NEW: case NEW:
return org.apache.hadoop.yarn.api.records.ContainerState.NEW;
case LOCALIZING: case LOCALIZING:
case LOCALIZATION_FAILED: case LOCALIZATION_FAILED:
case LOCALIZED: case LOCALIZED:
return org.apache.hadoop.yarn.api.records.ContainerState.SCHEDULED;
case RUNNING: case RUNNING:
case EXITED_WITH_SUCCESS: case EXITED_WITH_SUCCESS:
case EXITED_WITH_FAILURE: case EXITED_WITH_FAILURE:

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.yarn.server.nodemanager;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.apache.hadoop.fs.FileContext; import org.apache.hadoop.fs.FileContext;
@ -156,7 +155,7 @@ public class TestEventFlow {
containerManager.startContainers(allRequests); containerManager.startContainers(allRequests);
BaseContainerManagerTest.waitForContainerState(containerManager, cID, BaseContainerManagerTest.waitForContainerState(containerManager, cID,
ContainerState.NEW); ContainerState.RUNNING);
List<ContainerId> containerIds = new ArrayList<ContainerId>(); List<ContainerId> containerIds = new ArrayList<ContainerId>();
containerIds.add(cID); containerIds.add(cID);

View File

@ -454,14 +454,6 @@ public class TestNodeManagerResync {
if (containersShouldBePreserved) { if (containersShouldBePreserved) {
Assert.assertFalse(containers.isEmpty()); Assert.assertFalse(containers.isEmpty());
Assert.assertTrue(containers.containsKey(existingCid)); Assert.assertTrue(containers.containsKey(existingCid));
ContainerState state = containers.get(existingCid)
.cloneAndGetContainerStatus().getState();
// Wait till RUNNING state...
int counter = 50;
while (state != ContainerState.RUNNING && counter > 0) {
Thread.sleep(100);
counter--;
}
Assert.assertEquals(ContainerState.RUNNING, Assert.assertEquals(ContainerState.RUNNING,
containers.get(existingCid) containers.get(existingCid)
.cloneAndGetContainerStatus().getState()); .cloneAndGetContainerStatus().getState());

View File

@ -255,7 +255,7 @@ public class TestNodeManagerShutdown {
GetContainerStatusesRequest.newInstance(containerIds); GetContainerStatusesRequest.newInstance(containerIds);
ContainerStatus containerStatus = ContainerStatus containerStatus =
containerManager.getContainerStatuses(request).getContainerStatuses().get(0); containerManager.getContainerStatuses(request).getContainerStatuses().get(0);
Assert.assertEquals(ContainerState.SCHEDULED, containerStatus.getState()); Assert.assertEquals(ContainerState.RUNNING, containerStatus.getState());
} }
public static ContainerId createContainerId() { public static ContainerId createContainerId() {

View File

@ -110,8 +110,6 @@ public class TestContainer {
try { try {
wc = new WrappedContainer(7, 314159265358979L, 4344, "yak"); wc = new WrappedContainer(7, 314159265358979L, 4344, "yak");
assertEquals(ContainerState.NEW, wc.c.getContainerState()); assertEquals(ContainerState.NEW, wc.c.getContainerState());
ContainerImpl container = (ContainerImpl)wc.c;
assertEquals(org.apache.hadoop.yarn.api.records.ContainerState.NEW, container.getCurrentState());
wc.initContainer(); wc.initContainer();
// Verify request for public/private resources to localizer // Verify request for public/private resources to localizer
@ -121,7 +119,6 @@ public class TestContainer {
LocalResourceVisibility.APPLICATION)); LocalResourceVisibility.APPLICATION));
verify(wc.localizerBus).handle(argThat(matchesReq)); verify(wc.localizerBus).handle(argThat(matchesReq));
assertEquals(ContainerState.LOCALIZING, wc.c.getContainerState()); assertEquals(ContainerState.LOCALIZING, wc.c.getContainerState());
assertEquals(org.apache.hadoop.yarn.api.records.ContainerState.SCHEDULED, container.getCurrentState());
} }
finally { finally {
if (wc != null) { if (wc != null) {