YARN-5073. Refactor startContainerInternal() in ContainerManager to remove unused parameter. (Konstantinos Karanasos via asuresh)
This commit is contained in:
parent
6e56578031
commit
d971bf252f
|
@ -811,8 +811,7 @@ public class ContainerManagerImpl extends CompositeService implements
|
||||||
}
|
}
|
||||||
performContainerPreStartChecks(nmTokenIdentifier, request,
|
performContainerPreStartChecks(nmTokenIdentifier, request,
|
||||||
containerTokenIdentifier);
|
containerTokenIdentifier);
|
||||||
startContainerInternal(nmTokenIdentifier, containerTokenIdentifier,
|
startContainerInternal(containerTokenIdentifier, request);
|
||||||
request);
|
|
||||||
succeededContainers.add(containerId);
|
succeededContainers.add(containerId);
|
||||||
} catch (YarnException e) {
|
} catch (YarnException e) {
|
||||||
failedContainers.put(containerId, SerializedException.newInstance(e));
|
failedContainers.put(containerId, SerializedException.newInstance(e));
|
||||||
|
@ -908,7 +907,7 @@ public class ContainerManagerImpl extends CompositeService implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected void startContainerInternal(NMTokenIdentifier nmTokenIdentifier,
|
protected void startContainerInternal(
|
||||||
ContainerTokenIdentifier containerTokenIdentifier,
|
ContainerTokenIdentifier containerTokenIdentifier,
|
||||||
StartContainerRequest request) throws YarnException, IOException {
|
StartContainerRequest request) throws YarnException, IOException {
|
||||||
|
|
||||||
|
|
|
@ -101,14 +101,14 @@ public class QueuingContainerManagerImpl extends ContainerManagerImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startContainerInternal(NMTokenIdentifier nmTokenIdentifier,
|
protected void startContainerInternal(
|
||||||
ContainerTokenIdentifier containerTokenIdentifier,
|
ContainerTokenIdentifier containerTokenIdentifier,
|
||||||
StartContainerRequest request) throws YarnException, IOException {
|
StartContainerRequest request) throws YarnException, IOException {
|
||||||
this.context.getQueuingContext().getQueuedContainers().put(
|
this.context.getQueuingContext().getQueuedContainers().put(
|
||||||
containerTokenIdentifier.getContainerID(), containerTokenIdentifier);
|
containerTokenIdentifier.getContainerID(), containerTokenIdentifier);
|
||||||
|
|
||||||
AllocatedContainerInfo allocatedContInfo = new AllocatedContainerInfo(
|
AllocatedContainerInfo allocatedContInfo = new AllocatedContainerInfo(
|
||||||
containerTokenIdentifier, nmTokenIdentifier, request,
|
containerTokenIdentifier, request,
|
||||||
containerTokenIdentifier.getExecutionType(), containerTokenIdentifier
|
containerTokenIdentifier.getExecutionType(), containerTokenIdentifier
|
||||||
.getResource(), getConfig());
|
.getResource(), getConfig());
|
||||||
|
|
||||||
|
@ -189,7 +189,6 @@ public class QueuingContainerManagerImpl extends ContainerManagerImpl {
|
||||||
this.context.getQueuingContext().getQueuedContainers().remove(containerId);
|
this.context.getQueuingContext().getQueuedContainers().remove(containerId);
|
||||||
try {
|
try {
|
||||||
super.startContainerInternal(
|
super.startContainerInternal(
|
||||||
allocatedContainerInfo.getNMTokenIdentifier(),
|
|
||||||
allocatedContainerInfo.getContainerTokenIdentifier(),
|
allocatedContainerInfo.getContainerTokenIdentifier(),
|
||||||
allocatedContainerInfo.getStartRequest());
|
allocatedContainerInfo.getStartRequest());
|
||||||
} catch (YarnException | IOException e) {
|
} catch (YarnException | IOException e) {
|
||||||
|
@ -467,7 +466,6 @@ public class QueuingContainerManagerImpl extends ContainerManagerImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void handle(ApplicationEvent event) {
|
public void handle(ApplicationEvent event) {
|
||||||
if (event.getType() ==
|
if (event.getType() ==
|
||||||
ApplicationEventType.APPLICATION_CONTAINER_FINISHED) {
|
ApplicationEventType.APPLICATION_CONTAINER_FINISHED) {
|
||||||
|
@ -489,16 +487,14 @@ public class QueuingContainerManagerImpl extends ContainerManagerImpl {
|
||||||
|
|
||||||
static class AllocatedContainerInfo {
|
static class AllocatedContainerInfo {
|
||||||
private final ContainerTokenIdentifier containerTokenIdentifier;
|
private final ContainerTokenIdentifier containerTokenIdentifier;
|
||||||
private final NMTokenIdentifier nmTokenIdentifier;
|
|
||||||
private final StartContainerRequest startRequest;
|
private final StartContainerRequest startRequest;
|
||||||
private final ExecutionType executionType;
|
private final ExecutionType executionType;
|
||||||
private final ProcessTreeInfo pti;
|
private final ProcessTreeInfo pti;
|
||||||
|
|
||||||
AllocatedContainerInfo(ContainerTokenIdentifier containerTokenIdentifier,
|
AllocatedContainerInfo(ContainerTokenIdentifier containerTokenIdentifier,
|
||||||
NMTokenIdentifier nmTokenIdentifier, StartContainerRequest startRequest,
|
StartContainerRequest startRequest, ExecutionType executionType,
|
||||||
ExecutionType executionType, Resource resource, Configuration conf) {
|
Resource resource, Configuration conf) {
|
||||||
this.containerTokenIdentifier = containerTokenIdentifier;
|
this.containerTokenIdentifier = containerTokenIdentifier;
|
||||||
this.nmTokenIdentifier = nmTokenIdentifier;
|
|
||||||
this.startRequest = startRequest;
|
this.startRequest = startRequest;
|
||||||
this.executionType = executionType;
|
this.executionType = executionType;
|
||||||
this.pti = createProcessTreeInfo(containerTokenIdentifier
|
this.pti = createProcessTreeInfo(containerTokenIdentifier
|
||||||
|
@ -509,10 +505,6 @@ public class QueuingContainerManagerImpl extends ContainerManagerImpl {
|
||||||
return this.containerTokenIdentifier;
|
return this.containerTokenIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
private NMTokenIdentifier getNMTokenIdentifier() {
|
|
||||||
return this.nmTokenIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
private StartContainerRequest getStartRequest() {
|
private StartContainerRequest getStartRequest() {
|
||||||
return this.startRequest;
|
return this.startRequest;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue