Skip to content

YARN-9692. ContainerAllocationExpirer is missspelled #1142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.classification.InterfaceAudience.Private;
Expand All @@ -42,7 +43,6 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.monitor.RMAppLifetimeMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNode;
Expand Down Expand Up @@ -90,7 +90,7 @@ public class RMActiveServiceContext {
private AMLivelinessMonitor amLivelinessMonitor;
private AMLivelinessMonitor amFinishingMonitor;
private RMStateStore stateStore = null;
private ContainerAllocationExpirer containerAllocationExpirer;
private ContainerAllocationExpired containerAllocationExpired;
private DelegationTokenRenewer delegationTokenRenewer;
private AMRMTokenSecretManager amRMTokenSecretManager;
private RMContainerTokenSecretManager containerTokenSecretManager;
Expand Down Expand Up @@ -134,7 +134,7 @@ public RMActiveServiceContext() {
@Private
@Unstable
public RMActiveServiceContext(Dispatcher rmDispatcher,
ContainerAllocationExpirer containerAllocationExpirer,
ContainerAllocationExpired containerAllocationExpired,
AMLivelinessMonitor amLivelinessMonitor,
AMLivelinessMonitor amFinishingMonitor,
DelegationTokenRenewer delegationTokenRenewer,
Expand All @@ -144,7 +144,7 @@ public RMActiveServiceContext(Dispatcher rmDispatcher,
ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager,
ResourceScheduler scheduler) {
this();
this.setContainerAllocationExpirer(containerAllocationExpirer);
this.setContainerAllocationExpired(containerAllocationExpired);
this.setAMLivelinessMonitor(amLivelinessMonitor);
this.setAMFinishingMonitor(amFinishingMonitor);
this.setDelegationTokenRenewer(delegationTokenRenewer);
Expand Down Expand Up @@ -214,8 +214,8 @@ public ConcurrentMap<NodeId, RMNode> getInactiveRMNodes() {

@Private
@Unstable
public ContainerAllocationExpirer getContainerAllocationExpirer() {
return this.containerAllocationExpirer;
public ContainerAllocationExpired getContainerAllocationExpired() {
return this.containerAllocationExpired;
}

@Private
Expand Down Expand Up @@ -299,9 +299,9 @@ public void setRMDelegationTokenSecretManager(

@Private
@Unstable
void setContainerAllocationExpirer(
ContainerAllocationExpirer containerAllocationExpirer) {
this.containerAllocationExpirer = containerAllocationExpirer;
void setContainerAllocationExpired(
ContainerAllocationExpired containerAllocationExpired) {
this.containerAllocationExpired = containerAllocationExpired;
}

@Private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.monitor.RMAppLifetimeMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpired;
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNode;
Expand Down Expand Up @@ -84,7 +84,7 @@ public interface RMContext extends ApplicationMasterServiceContext {

AMLivelinessMonitor getAMFinishingMonitor();

ContainerAllocationExpirer getContainerAllocationExpirer();
ContainerAllocationExpired getContainerAllocationExpirer();

DelegationTokenRenewer getDelegationTokenRenewer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.net.URISyntaxException;
import java.util.concurrent.ConcurrentMap;

import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.classification.InterfaceAudience.Private;
Expand All @@ -46,7 +47,6 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.monitor.RMAppLifetimeMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNode;
Expand Down Expand Up @@ -112,7 +112,7 @@ public RMContextImpl() {
@VisibleForTesting
// helper constructor for tests
public RMContextImpl(Dispatcher rmDispatcher,
ContainerAllocationExpirer containerAllocationExpirer,
ContainerAllocationExpired containerAllocationExpired,
AMLivelinessMonitor amLivelinessMonitor,
AMLivelinessMonitor amFinishingMonitor,
DelegationTokenRenewer delegationTokenRenewer,
Expand All @@ -124,7 +124,7 @@ public RMContextImpl(Dispatcher rmDispatcher,
this();
this.setDispatcher(rmDispatcher);
setActiveServiceContext(new RMActiveServiceContext(rmDispatcher,
containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor,
containerAllocationExpired, amLivelinessMonitor, amFinishingMonitor,
delegationTokenRenewer, appTokenSecretManager,
containerTokenSecretManager, nmTokenSecretManager,
clientToAMTokenSecretManager,
Expand All @@ -137,7 +137,7 @@ public RMContextImpl(Dispatcher rmDispatcher,
@VisibleForTesting
// helper constructor for tests
public RMContextImpl(Dispatcher rmDispatcher,
ContainerAllocationExpirer containerAllocationExpirer,
ContainerAllocationExpired containerAllocationExpired,
AMLivelinessMonitor amLivelinessMonitor,
AMLivelinessMonitor amFinishingMonitor,
DelegationTokenRenewer delegationTokenRenewer,
Expand All @@ -147,7 +147,7 @@ public RMContextImpl(Dispatcher rmDispatcher,
ClientToAMTokenSecretManagerInRM clientToAMTokenSecretManager) {
this(
rmDispatcher,
containerAllocationExpirer,
containerAllocationExpired,
amLivelinessMonitor,
amFinishingMonitor,
delegationTokenRenewer,
Expand Down Expand Up @@ -328,8 +328,8 @@ public ConcurrentMap<NodeId, RMNode> getInactiveRMNodes() {
}

@Override
public ContainerAllocationExpirer getContainerAllocationExpirer() {
return activeServiceContext.getContainerAllocationExpirer();
public ContainerAllocationExpired getContainerAllocationExpirer() {
return activeServiceContext.getContainerAllocationExpired();
}

@Override
Expand Down Expand Up @@ -420,9 +420,9 @@ public void setRMDelegationTokenSecretManager(
}

void setContainerAllocationExpirer(
ContainerAllocationExpirer containerAllocationExpirer) {
ContainerAllocationExpired containerAllocationExpired) {
activeServiceContext
.setContainerAllocationExpirer(containerAllocationExpirer);
.setContainerAllocationExpired(containerAllocationExpired);
}

void setAMLivelinessMonitor(AMLivelinessMonitor amLivelinessMonitor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEvent;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.monitor.RMAppLifetimeMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpired;
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeEvent;
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeEventType;
Expand Down Expand Up @@ -638,7 +638,7 @@ public class RMActiveServices extends CompositeService {
private DelegationTokenRenewer delegationTokenRenewer;
private EventHandler<SchedulerEvent> schedulerDispatcher;
private ApplicationMasterLauncher applicationMasterLauncher;
private ContainerAllocationExpirer containerAllocationExpirer;
private ContainerAllocationExpired containerAllocationExpired;
private ResourceManager rm;
private boolean fromActive = false;
private StandByTransitionRunnable standByTransitionRunnable;
Expand All @@ -656,9 +656,9 @@ protected void serviceInit(Configuration configuration) throws Exception {
rmSecretManagerService = createRMSecretManagerService();
addService(rmSecretManagerService);

containerAllocationExpirer = new ContainerAllocationExpirer(rmDispatcher);
addService(containerAllocationExpirer);
rmContext.setContainerAllocationExpirer(containerAllocationExpirer);
containerAllocationExpired = new ContainerAllocationExpired(rmDispatcher);
addService(containerAllocationExpired);
rmContext.setContainerAllocationExpirer(containerAllocationExpired);

AMLivelinessMonitor amLivelinessMonitor = createAMLivelinessMonitor();
addService(amLivelinessMonitor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import org.apache.hadoop.yarn.util.AbstractLivelinessMonitor;

@SuppressWarnings({"unchecked", "rawtypes"})
public class ContainerAllocationExpirer extends
public class ContainerAllocationExpired extends
AbstractLivelinessMonitor<AllocationExpirationInfo> {

private EventHandler dispatcher;

public ContainerAllocationExpirer(Dispatcher d) {
super(ContainerAllocationExpirer.class.getName());
public ContainerAllocationExpired(Dispatcher d) {
super(ContainerAllocationExpired.class.getName());
this.dispatcher = d.getEventHandler();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum RMContainerEventType {
// Source: ApplicationMasterService->Scheduler
RELEASED,

// Source: ContainerAllocationExpirer
// Source: ContainerAllocationExpired
EXPIRE,

RECOVER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ RMContainerEventType.RESERVED, new ContainerReservedTransition())
private final NodeId nodeId;
private final RMContext rmContext;
private final EventHandler eventHandler;
private final ContainerAllocationExpirer containerAllocationExpirer;
private final ContainerAllocationExpired containerAllocationExpired;
private final String user;
private final String nodeLabelExpression;

Expand Down Expand Up @@ -239,7 +239,7 @@ public RMContainerImpl(Container container, SchedulerRequestKey schedulerKey,
this.creationTime = creationTime;
this.rmContext = rmContext;
this.eventHandler = rmContext.getDispatcher().getEventHandler();
this.containerAllocationExpirer = rmContext.getContainerAllocationExpirer();
this.containerAllocationExpired = rmContext.getContainerAllocationExpirer();
this.isAMContainer = false;
this.nodeLabelExpression = nodeLabelExpression;
this.lastConfirmedResource = container.getResource();
Expand Down Expand Up @@ -600,8 +600,8 @@ public void transition(RMContainerImpl container, RMContainerEvent event) {
// this anymore.
container.setContainerRequest(null);

// Register with containerAllocationExpirer.
container.containerAllocationExpirer.register(
// Register with containerAllocationExpired.
container.containerAllocationExpired.register(
new AllocationExpirationInfo(container.getContainerId()));

// Tell the app
Expand All @@ -624,8 +624,8 @@ public void transition(RMContainerImpl container, RMContainerEvent event) {
(RMContainerUpdatesAcquiredEvent) event;
if (acquiredEvent.isIncreasedContainer()) {
// If container is increased but not started by AM, we will start
// containerAllocationExpirer for this container in this transition.
container.containerAllocationExpirer.register(
// containerAllocationExpired for this container in this transition.
container.containerAllocationExpired.register(
new AllocationExpirationInfo(event.getContainerId(), true));
}
}
Expand All @@ -649,7 +649,7 @@ public void transition(RMContainerImpl container, RMContainerEvent event) {
// - Set the lastConfirmedResource as nmContainerResource
// - Unregister the allocation expirer
container.lastConfirmedResource = nmContainerResource;
container.containerAllocationExpirer.unregister(
container.containerAllocationExpired.unregister(
new AllocationExpirationInfo(event.getContainerId()));
} else if (Resources.fitsIn(rmContainerResource, nmContainerResource)) {
// If rmContainerResource < nmContainerResource, this is caused by the
Expand All @@ -664,7 +664,7 @@ public void transition(RMContainerImpl container, RMContainerEvent event) {
// - Unregister the allocation expirer
// - Notify NM to reduce its resource to rmContainerResource
container.lastConfirmedResource = rmContainerResource;
container.containerAllocationExpirer.unregister(
container.containerAllocationExpired.unregister(
new AllocationExpirationInfo(event.getContainerId()));
container.eventHandler.handle(new RMNodeUpdateContainerEvent(
container.nodeId,
Expand Down Expand Up @@ -779,8 +779,8 @@ private static final class KillTransition extends FinishedTransition {
@Override
public void transition(RMContainerImpl container, RMContainerEvent event) {

// Unregister from containerAllocationExpirer.
container.containerAllocationExpirer.unregister(
// Unregister from containerAllocationExpired.
container.containerAllocationExpired.unregister(
new AllocationExpirationInfo(container.getContainerId()));

// Inform node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppRunningOnNodeEvent;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpired;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.AllocationExpirationInfo;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.NodeAddedSchedulerEvent;
Expand Down Expand Up @@ -146,7 +146,7 @@ public class RMNodeImpl implements RMNode, EventHandler<RMNodeEvent> {
/* Container Queue Information for the node.. Used by Distributed Scheduler */
private OpportunisticContainersStatus opportunisticContainersStatus;

private final ContainerAllocationExpirer containerAllocationExpirer;
private final ContainerAllocationExpired containerAllocationExpired;
/* set of containers that have just launched */
private final Set<ContainerId> launchedContainers =
new HashSet<ContainerId>();
Expand Down Expand Up @@ -412,7 +412,7 @@ public RMNodeImpl(NodeId nodeId, RMContext context, String hostName,

this.nodeUpdateQueue = new ConcurrentLinkedQueue<UpdatedContainerInfo>();

this.containerAllocationExpirer = context.getContainerAllocationExpirer();
this.containerAllocationExpired = context.getContainerAllocationExpirer();
}

@Override
Expand Down Expand Up @@ -1432,8 +1432,8 @@ private void handleContainerStatus(List<ContainerStatus> containerStatuses) {
// Just launched container. RM knows about it the first time.
launchedContainers.add(containerId);
newlyLaunchedContainers.add(remoteContainer);
// Unregister from containerAllocationExpirer.
containerAllocationExpirer
// Unregister from containerAllocationExpired.
containerAllocationExpired
.unregister(new AllocationExpirationInfo(containerId));
}

Expand Down Expand Up @@ -1462,8 +1462,8 @@ private void handleContainerStatus(List<ContainerStatus> containerStatuses) {
if (completedContainers.add(containerId)) {
newlyCompletedContainers.add(remoteContainer);
}
// Unregister from containerAllocationExpirer.
containerAllocationExpirer
// Unregister from containerAllocationExpired.
containerAllocationExpired
.unregister(new AllocationExpirationInfo(containerId));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
package org.apache.hadoop.yarn.server.resourcemanager.scheduler.event;

import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpired;

/**
* The {@link SchedulerEvent} which notifies that a {@link ContainerId}
* has expired, sent by {@link ContainerAllocationExpirer}
* has expired, sent by {@link ContainerAllocationExpired}
*
*/
public class ContainerExpiredSchedulerEvent extends SchedulerEvent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum SchedulerEventType {
APP_ATTEMPT_ADDED,
APP_ATTEMPT_REMOVED,

// Source: ContainerAllocationExpirer
// Source: ContainerAllocationExpired
CONTAINER_EXPIRED,

// Source: SchedulerAppAttempt::pullNewlyUpdatedContainer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptImpl;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpired;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
Expand Down Expand Up @@ -185,15 +185,15 @@ private ConcurrentMap<ApplicationId, RMApp> createRMAppsMapMixedLogAggStatus(

private RMContext createMockRMContextInternal(ConcurrentMap<ApplicationId, RMApp> map) {
Dispatcher rmDispatcher = new AsyncDispatcher();
ContainerAllocationExpirer containerAllocationExpirer = new ContainerAllocationExpirer(
ContainerAllocationExpired containerAllocationExpired = new ContainerAllocationExpired(
rmDispatcher);
AMLivelinessMonitor amLivelinessMonitor = new AMLivelinessMonitor(
rmDispatcher);
AMLivelinessMonitor amFinishingMonitor = new AMLivelinessMonitor(
rmDispatcher);
RMApplicationHistoryWriter writer = mock(RMApplicationHistoryWriter.class);
RMContext context = new RMContextImpl(rmDispatcher,
containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor,
containerAllocationExpired, amLivelinessMonitor, amFinishingMonitor,
null, null, null, null, null) {
@Override
public ConcurrentMap<ApplicationId, RMApp> getRMApps() {
Expand Down
Loading