From 141627778d2773852ab5387abf3f6f3c2c4bc922 Mon Sep 17 00:00:00 2001 From: Eremenko Valentin <102166616+EremenkoValentin@users.noreply.github.com> Date: Sat, 3 Feb 2024 14:34:42 +0300 Subject: [PATCH] YARN-11362: Fix several typos in YARN codebase of misspelled resource (#6474) Contributed by EremenkoValentin. Reviewed-by: Shilun Fan Signed-off-by: Shilun Fan --- ...dulerInvalidResourceRequestException.java} | 8 ++--- .../hadoop/yarn/client/cli/TestYarnCLI.java | 8 ++--- .../timeline/TimelineEntityV2Converter.java | 8 ++--- ...licationHistoryManagerOnTimelineStore.java | 8 ++--- .../resourcemanager/DefaultAMSProcessor.java | 4 +-- .../scheduler/SchedulerUtils.java | 5 ++-- .../allocator/RegularContainerAllocator.java | 30 +++++++++---------- .../scheduler/fair/FairScheduler.java | 5 ++-- .../LocalityAppPlacementAllocator.java | 6 ++-- ...SingleConstraintAppPlacementAllocator.java | 14 ++++----- .../recovery/TestZKRMStateStore.java | 8 ++--- .../capacity/TestCapacityScheduler.java | 2 +- .../scheduler/fair/TestFairScheduler.java | 4 +-- ...SingleConstraintAppPlacementAllocator.java | 4 +-- 14 files changed, 56 insertions(+), 58 deletions(-) rename hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/{SchedulerInvalidResoureRequestException.java => SchedulerInvalidResourceRequestException.java} (83%) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/SchedulerInvalidResoureRequestException.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/SchedulerInvalidResourceRequestException.java similarity index 83% rename from hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/SchedulerInvalidResoureRequestException.java rename to hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/SchedulerInvalidResourceRequestException.java index f55ad832dd..459df22793 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/SchedulerInvalidResoureRequestException.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/exceptions/SchedulerInvalidResourceRequestException.java @@ -29,18 +29,18 @@ */ @InterfaceAudience.Private @InterfaceStability.Unstable -public class SchedulerInvalidResoureRequestException extends YarnRuntimeException { +public class SchedulerInvalidResourceRequestException extends YarnRuntimeException { private static final long serialVersionUID = 10081123982L; - public SchedulerInvalidResoureRequestException(String message) { + public SchedulerInvalidResourceRequestException(String message) { super(message); } - public SchedulerInvalidResoureRequestException(Throwable cause) { + public SchedulerInvalidResourceRequestException(Throwable cause) { super(cause); } - public SchedulerInvalidResoureRequestException(String message, + public SchedulerInvalidResourceRequestException(String message, Throwable cause) { super(message, cause); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java index 2bcf84c086..57ec83fc61 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/cli/TestYarnCLI.java @@ -133,17 +133,17 @@ public void testGetApplicationReport() throws Exception { ApplicationCLI cli = createAndGetAppCLI(); ApplicationId applicationId = ApplicationId.newInstance(1234, 5); Map resourceSecondsMap = new HashMap<>(); - Map preemptedResoureSecondsMap = new HashMap<>(); + Map preemptedResourceSecondsMap = new HashMap<>(); resourceSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), 123456L); resourceSecondsMap.put(ResourceInformation.VCORES.getName(), 4567L); - preemptedResoureSecondsMap + preemptedResourceSecondsMap .put(ResourceInformation.MEMORY_MB.getName(), 1111L); - preemptedResoureSecondsMap + preemptedResourceSecondsMap .put(ResourceInformation.VCORES.getName(), 2222L); ApplicationResourceUsageReport usageReport = i == 0 ? null : ApplicationResourceUsageReport .newInstance(2, 0, null, null, null, resourceSecondsMap, 0, 0, - preemptedResoureSecondsMap); + preemptedResourceSecondsMap); ApplicationReport newApplicationReport = ApplicationReport.newInstance( applicationId, ApplicationAttemptId.newInstance(applicationId, 1), "user", "queue", "appname", "host", 124, null, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/timeline/TimelineEntityV2Converter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/timeline/TimelineEntityV2Converter.java index 9fefc09bc0..b32d9d4d6b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/timeline/TimelineEntityV2Converter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/timeline/TimelineEntityV2Converter.java @@ -395,19 +395,19 @@ public static ApplicationReport convertToApplicationReport( } } Map resourceSecondsMap = new HashMap<>(); - Map preemptedResoureSecondsMap = new HashMap<>(); + Map preemptedResourceSecondsMap = new HashMap<>(); resourceSecondsMap .put(ResourceInformation.MEMORY_MB.getName(), memorySeconds); resourceSecondsMap .put(ResourceInformation.VCORES.getName(), vcoreSeconds); - preemptedResoureSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), + preemptedResourceSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), preemptedMemorySeconds); - preemptedResoureSecondsMap + preemptedResourceSecondsMap .put(ResourceInformation.VCORES.getName(), preemptedVcoreSeconds); appResources = ApplicationResourceUsageReport .newInstance(0, 0, null, null, null, resourceSecondsMap, 0, 0, - preemptedResoureSecondsMap); + preemptedResourceSecondsMap); } NavigableSet events = entity.getEvents(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java index 1df379238c..d3eced7ed2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java @@ -345,19 +345,19 @@ private static ApplicationReportExt convertToApplicationReport( long preemptedVcoreSeconds = parseLong(entityInfo, ApplicationMetricsConstants.APP_CPU_PREEMPT_METRICS); Map resourceSecondsMap = new HashMap<>(); - Map preemptedResoureSecondsMap = new HashMap<>(); + Map preemptedResourceSecondsMap = new HashMap<>(); resourceSecondsMap .put(ResourceInformation.MEMORY_MB.getName(), memorySeconds); resourceSecondsMap .put(ResourceInformation.VCORES.getName(), vcoreSeconds); - preemptedResoureSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), + preemptedResourceSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), preemptedMemorySeconds); - preemptedResoureSecondsMap + preemptedResourceSecondsMap .put(ResourceInformation.VCORES.getName(), preemptedVcoreSeconds); appResources = ApplicationResourceUsageReport .newInstance(0, 0, null, null, null, resourceSecondsMap, 0, 0, - preemptedResoureSecondsMap); + preemptedResourceSecondsMap); } if (entityInfo.containsKey(ApplicationMetricsConstants.APP_TAGS_INFO)) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/DefaultAMSProcessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/DefaultAMSProcessor.java index 96e65855fe..89fb3f7bd4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/DefaultAMSProcessor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/DefaultAMSProcessor.java @@ -55,7 +55,7 @@ import org.apache.hadoop.yarn.exceptions.InvalidContainerReleaseException; import org.apache.hadoop.yarn.exceptions.InvalidResourceBlacklistRequestException; import org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException; -import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResoureRequestException; +import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResourceRequestException; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.factories.RecordFactory; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; @@ -301,7 +301,7 @@ public void allocate(ApplicationAttemptId appAttemptId, allocation = getScheduler().allocate(appAttemptId, ask, request.getSchedulingRequests(), release, blacklistAdditions, blacklistRemovals, containerUpdateRequests); - } catch (SchedulerInvalidResoureRequestException e) { + } catch (SchedulerInvalidResourceRequestException e) { LOG.warn("Exceptions caught when scheduler handling requests"); throw new YarnException(e); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerUtils.java index 1c7446b493..c34458f4b0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerUtils.java @@ -43,8 +43,7 @@ import org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException; import org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException .InvalidResourceType; -import org.apache.hadoop.yarn.exceptions - .SchedulerInvalidResoureRequestException; +import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResourceRequestException; import org.apache.hadoop.yarn.factories.RecordFactory; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; import org.apache.hadoop.yarn.security.AccessType; @@ -430,7 +429,7 @@ static void checkResourceRequestAgainstAvailableResource(Resource reqResource, public static MaxResourceValidationResult validateResourceRequestsAgainstQueueMaxResource( ResourceRequest resReq, Resource availableResource) - throws SchedulerInvalidResoureRequestException { + throws SchedulerInvalidResourceRequestException { final Resource reqResource = resReq.getCapability(); Map resourcesWithZeroAmount = getZeroResources(availableResource); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java index f211b65b34..1db33408d7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java @@ -370,11 +370,11 @@ private ContainerAllocation assignNodeLocalContainers( Resource clusterResource, PendingAsk nodeLocalAsk, FiCaSchedulerNode node, SchedulerRequestKey schedulerKey, RMContainer reservedContainer, SchedulingMode schedulingMode, - ResourceLimits currentResoureLimits) { + ResourceLimits currentResourceLimits) { if (canAssign(schedulerKey, node, NodeType.NODE_LOCAL, reservedContainer)) { return assignContainer(clusterResource, node, schedulerKey, nodeLocalAsk, NodeType.NODE_LOCAL, reservedContainer, - schedulingMode, currentResoureLimits); + schedulingMode, currentResourceLimits); } // Skip node-local request, go to rack-local request @@ -385,11 +385,11 @@ private ContainerAllocation assignRackLocalContainers( Resource clusterResource, PendingAsk rackLocalAsk, FiCaSchedulerNode node, SchedulerRequestKey schedulerKey, RMContainer reservedContainer, SchedulingMode schedulingMode, - ResourceLimits currentResoureLimits) { + ResourceLimits currentResourceLimits) { if (canAssign(schedulerKey, node, NodeType.RACK_LOCAL, reservedContainer)) { return assignContainer(clusterResource, node, schedulerKey, rackLocalAsk, NodeType.RACK_LOCAL, reservedContainer, - schedulingMode, currentResoureLimits); + schedulingMode, currentResourceLimits); } // Skip rack-local request, go to off-switch request @@ -400,11 +400,11 @@ private ContainerAllocation assignOffSwitchContainers( Resource clusterResource, PendingAsk offSwitchAsk, FiCaSchedulerNode node, SchedulerRequestKey schedulerKey, RMContainer reservedContainer, SchedulingMode schedulingMode, - ResourceLimits currentResoureLimits) { + ResourceLimits currentResourceLimits) { if (canAssign(schedulerKey, node, NodeType.OFF_SWITCH, reservedContainer)) { return assignContainer(clusterResource, node, schedulerKey, offSwitchAsk, NodeType.OFF_SWITCH, reservedContainer, - schedulingMode, currentResoureLimits); + schedulingMode, currentResourceLimits); } application.updateAppSkipNodeDiagnostics( @@ -419,7 +419,7 @@ private ContainerAllocation assignOffSwitchContainers( private ContainerAllocation assignContainersOnNode(Resource clusterResource, FiCaSchedulerNode node, SchedulerRequestKey schedulerKey, RMContainer reservedContainer, SchedulingMode schedulingMode, - ResourceLimits currentResoureLimits) { + ResourceLimits currentResourceLimits) { ContainerAllocation allocation; NodeType requestLocalityType = null; @@ -431,7 +431,7 @@ private ContainerAllocation assignContainersOnNode(Resource clusterResource, allocation = assignNodeLocalContainers(clusterResource, nodeLocalAsk, node, schedulerKey, reservedContainer, schedulingMode, - currentResoureLimits); + currentResourceLimits); if (Resources.greaterThan(rc, clusterResource, allocation.getResourceToBeAllocated(), Resources.none())) { allocation.requestLocalityType = requestLocalityType; @@ -458,7 +458,7 @@ private ContainerAllocation assignContainersOnNode(Resource clusterResource, allocation = assignRackLocalContainers(clusterResource, rackLocalAsk, node, schedulerKey, reservedContainer, schedulingMode, - currentResoureLimits); + currentResourceLimits); if (Resources.greaterThan(rc, clusterResource, allocation.getResourceToBeAllocated(), Resources.none())) { allocation.requestLocalityType = requestLocalityType; @@ -485,7 +485,7 @@ private ContainerAllocation assignContainersOnNode(Resource clusterResource, allocation = assignOffSwitchContainers(clusterResource, offSwitchAsk, node, schedulerKey, reservedContainer, schedulingMode, - currentResoureLimits); + currentResourceLimits); // When a returned allocation is LOCALITY_SKIPPED, since we're in // off-switch request now, we will skip this app w.r.t priorities @@ -507,7 +507,7 @@ private ContainerAllocation assignContainersOnNode(Resource clusterResource, private ContainerAllocation assignContainer(Resource clusterResource, FiCaSchedulerNode node, SchedulerRequestKey schedulerKey, PendingAsk pendingAsk, NodeType type, RMContainer rmContainer, - SchedulingMode schedulingMode, ResourceLimits currentResoureLimits) { + SchedulingMode schedulingMode, ResourceLimits currentResourceLimits) { if (LOG.isDebugEnabled()) { LOG.debug("assignContainers: node=" + node.getNodeName() @@ -547,8 +547,8 @@ private ContainerAllocation assignContainer(Resource clusterResource, // max(required - headroom, amountNeedUnreserve) Resource resourceNeedToUnReserve = Resources.max(rc, clusterResource, - Resources.subtract(capability, currentResoureLimits.getHeadroom()), - currentResoureLimits.getAmountNeededUnreserve()); + Resources.subtract(capability, currentResourceLimits.getHeadroom()), + currentResourceLimits.getAmountNeededUnreserve()); boolean needToUnreserve = rc.isAnyMajorResourceAboveZero(resourceNeedToUnReserve); @@ -559,7 +559,7 @@ private ContainerAllocation assignContainer(Resource clusterResource, // Check if we need to kill some containers to allocate this one List toKillContainers = null; - if (availableContainers == 0 && currentResoureLimits.isAllowPreemption()) { + if (availableContainers == 0 && currentResourceLimits.isAllowPreemption()) { Resource availableAndKillable = Resources.clone(available); for (RMContainer killableContainer : node .getKillableContainers().values()) { @@ -590,7 +590,7 @@ private ContainerAllocation assignContainer(Resource clusterResource, if (!needToUnreserve) { // If we shouldn't allocate/reserve new container then we should // unreserve one the same size we are asking for since the - // currentResoureLimits.getAmountNeededUnreserve could be zero. If + // currentResourceLimits.getAmountNeededUnreserve could be zero. If // the limit was hit then use the amount we need to unreserve to be // under the limit. resourceNeedToUnReserve = capability; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java index dc4e842518..f72351e26c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java @@ -41,8 +41,7 @@ import org.apache.hadoop.yarn.api.records.SchedulingRequest; import org.apache.hadoop.yarn.api.records.Priority; import org.apache.hadoop.yarn.conf.YarnConfiguration; -import org.apache.hadoop.yarn.exceptions - .SchedulerInvalidResoureRequestException; +import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResourceRequestException; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; @@ -912,7 +911,7 @@ public Allocation allocate(ApplicationAttemptId appAttemptId, // scheduler would clear them right away and AM // would not get this information. if (!invalidAsks.isEmpty()) { - throw new SchedulerInvalidResoureRequestException(String.format( + throw new SchedulerInvalidResourceRequestException(String.format( "Resource request is invalid for application %s because queue %s " + "has 0 amount of resource for a resource type! " + "Validation result: %s", diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/LocalityAppPlacementAllocator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/LocalityAppPlacementAllocator.java index 19ba719c30..f078409847 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/LocalityAppPlacementAllocator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/LocalityAppPlacementAllocator.java @@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory; import org.apache.hadoop.yarn.api.records.ResourceRequest; import org.apache.hadoop.yarn.api.records.SchedulingRequest; -import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResoureRequestException; +import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResourceRequestException; import org.apache.hadoop.yarn.server.resourcemanager.RMContext; import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AppSchedulingInfo; @@ -172,8 +172,8 @@ public PendingAskUpdateResult updatePendingAsk( SchedulerRequestKey schedulerRequestKey, SchedulingRequest schedulingRequest, boolean recoverPreemptedRequestForAContainer) - throws SchedulerInvalidResoureRequestException { - throw new SchedulerInvalidResoureRequestException(this.getClass().getName() + throws SchedulerInvalidResourceRequestException { + throw new SchedulerInvalidResourceRequestException(this.getClass().getName() + " not be able to handle SchedulingRequest, there exists a " + "ResourceRequest with the same scheduler key=" + schedulerRequestKey + ", please send SchedulingRequest with a different allocationId and " diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java index 89b7e1a759..27e116660f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java @@ -28,7 +28,7 @@ import org.apache.hadoop.yarn.api.records.SchedulingRequest; import org.apache.hadoop.yarn.api.records.impl.pb.SchedulingRequestPBImpl; import org.apache.hadoop.yarn.api.resource.PlacementConstraint; -import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResoureRequestException; +import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResourceRequestException; import org.apache.hadoop.yarn.server.resourcemanager.RMContext; import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AppSchedulingInfo; @@ -81,7 +81,7 @@ public PendingAskUpdateResult updatePendingAsk( Collection requests, boolean recoverPreemptedRequestForAContainer) { if (requests != null && !requests.isEmpty()) { - throw new SchedulerInvalidResoureRequestException( + throw new SchedulerInvalidResourceRequestException( this.getClass().getName() + " not be able to handle ResourceRequest, there exists a " + "SchedulingRequest with the same scheduler key=" @@ -98,7 +98,7 @@ private PendingAskUpdateResult internalUpdatePendingAsk( SchedulingRequest newSchedulingRequest, boolean recoverContainer) { // When it is a recover container, there must exists an schedulingRequest. if (recoverContainer && schedulingRequest == null) { - throw new SchedulerInvalidResoureRequestException("Trying to recover a " + throw new SchedulerInvalidResourceRequestException("Trying to recover a " + "container request=" + newSchedulingRequest.toString() + ", however" + "there's no existing scheduling request, this should not happen."); } @@ -127,7 +127,7 @@ private PendingAskUpdateResult internalUpdatePendingAsk( if (!schedulingRequest.equals(newSchedulingRequest)) { // Rollback #numAllocations sizing.setNumAllocations(newNumAllocations); - throw new SchedulerInvalidResoureRequestException( + throw new SchedulerInvalidResourceRequestException( "Invalid updated SchedulingRequest added to scheduler, " + " we only allows changing numAllocations for the updated " + "SchedulingRequest. Old=" + schedulingRequest.toString() @@ -148,7 +148,7 @@ private PendingAskUpdateResult internalUpdatePendingAsk( // Basic sanity check if (newNumAllocations < 0) { - throw new SchedulerInvalidResoureRequestException( + throw new SchedulerInvalidResourceRequestException( "numAllocation in ResourceSizing field must be >= 0, " + "updating schedulingRequest failed."); } @@ -197,12 +197,12 @@ private String throwExceptionWithMetaInfo(String message) { sb.append("AppId=").append(appSchedulingInfo.getApplicationId()).append( " Key=").append(this.schedulerRequestKey).append(". Exception message:") .append(message); - throw new SchedulerInvalidResoureRequestException(sb.toString()); + throw new SchedulerInvalidResourceRequestException(sb.toString()); } private void validateAndSetSchedulingRequest(SchedulingRequest newSchedulingRequest) - throws SchedulerInvalidResoureRequestException { + throws SchedulerInvalidResourceRequestException { // Check sizing exists if (newSchedulingRequest.getResourceSizing() == null || newSchedulingRequest.getResourceSizing().getResources() == null) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java index c8aba28326..404fae9d85 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/TestZKRMStateStore.java @@ -814,19 +814,19 @@ private static ApplicationAttemptStateData createFinishedAttempt( ApplicationAttemptId attemptId, Container container, long startTime, int amExitStatus) { Map resourceSecondsMap = new HashMap<>(); - Map preemptedResoureSecondsMap = new HashMap<>(); + Map preemptedResourceSecondsMap = new HashMap<>(); resourceSecondsMap .put(ResourceInformation.MEMORY_MB.getName(), 0L); resourceSecondsMap .put(ResourceInformation.VCORES.getName(), 0L); - preemptedResoureSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), + preemptedResourceSecondsMap.put(ResourceInformation.MEMORY_MB.getName(), 0L); - preemptedResoureSecondsMap + preemptedResourceSecondsMap .put(ResourceInformation.VCORES.getName(), 0L); return ApplicationAttemptStateData.newInstance(attemptId, container, null, startTime, RMAppAttemptState.FINISHED, "myTrackingUrl", "attemptDiagnostics", FinalApplicationStatus.SUCCEEDED, - amExitStatus, 0, resourceSecondsMap, preemptedResoureSecondsMap, 0); + amExitStatus, 0, resourceSecondsMap, preemptedResourceSecondsMap, 0); } private ApplicationAttemptId storeAttempt(RMStateStore store, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java index e46d6b07f7..3bef712547 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java @@ -1486,7 +1486,7 @@ public void testHierarchyQueuesCurrentLimits() throws Exception { waitContainerAllocated(am1, 1 * GB, 1, 2, rm1, nm1); - // Maximum resoure of b1 is 100 * 0.895 * 0.792 = 71 GB + // Maximum resource of b1 is 100 * 0.895 * 0.792 = 71 GB // 2 GBs used by am, so it's 71 - 2 = 69G. Assert.assertEquals(69 * GB, am1.doHeartbeat().getAvailableResources().getMemorySize()); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java index 2f700f3d82..30fb894be9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java @@ -46,7 +46,7 @@ import org.apache.hadoop.yarn.event.Dispatcher; import org.apache.hadoop.yarn.event.Event; import org.apache.hadoop.yarn.event.EventHandler; -import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResoureRequestException; +import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResourceRequestException; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.security.YarnAuthorizationProvider; @@ -5513,7 +5513,7 @@ private void testSchedulingRejectedToQueueZeroCapacityOfResource( + resource + " and requested resource capabilities are: " + requests.stream().map(ResourceRequest::getCapability) .collect(Collectors.toList())); - } catch (SchedulerInvalidResoureRequestException e) { + } catch (SchedulerInvalidResourceRequestException e) { assertTrue( "The thrown exception is not the expected one. Exception message: " + e.getMessage(), diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/TestSingleConstraintAppPlacementAllocator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/TestSingleConstraintAppPlacementAllocator.java index d7fa600060..14b9e4b0a6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/TestSingleConstraintAppPlacementAllocator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/TestSingleConstraintAppPlacementAllocator.java @@ -21,7 +21,7 @@ import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.AllocationTags; import org.apache.hadoop.yarn.api.resource.PlacementConstraints; -import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResoureRequestException; +import org.apache.hadoop.yarn.exceptions.SchedulerInvalidResourceRequestException; import org.apache.hadoop.yarn.server.resourcemanager.RMContext; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AppSchedulingInfo; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.NodeType; @@ -104,7 +104,7 @@ private void assertInvalidSchedulingRequest( allocator.initialize(appSchedulingInfo, schedulerRequestKey, rmContext); } allocator.updatePendingAsk(schedulerRequestKey, schedulingRequest, false); - } catch (SchedulerInvalidResoureRequestException e) { + } catch (SchedulerInvalidResourceRequestException e) { // Expected return; }