diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/ams/ApplicationMasterServiceProcessor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/ams/ApplicationMasterServiceProcessor.java index b7d925a6592..ec4e29d24ba 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/ams/ApplicationMasterServiceProcessor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/ams/ApplicationMasterServiceProcessor.java @@ -53,10 +53,10 @@ void init(ApplicationMasterServiceContext amsContext, * @param response Register Response. * @throws IOException IOException. */ - void registerApplicationMaster( - ApplicationAttemptId applicationAttemptId, + void registerApplicationMaster(ApplicationAttemptId applicationAttemptId, RegisterApplicationMasterRequest request, - RegisterApplicationMasterResponse response) throws IOException; + RegisterApplicationMasterResponse response) + throws IOException, YarnException; /** * Allocate call. diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java index 5ed57123f95..35643b179c8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java @@ -28,6 +28,7 @@ import org.apache.hadoop.yarn.api.protocolrecords.ResourceTypes; import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.ResourceInformation; +import org.apache.hadoop.yarn.api.records.ResourceTypeInfo; import org.apache.hadoop.yarn.conf.ConfigurationProvider; import org.apache.hadoop.yarn.conf.ConfigurationProviderFactory; import org.apache.hadoop.yarn.conf.YarnConfiguration; @@ -37,9 +38,12 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -561,4 +565,21 @@ public static String getDefaultUnit(String resourceType) { } return ""; } + + /** + * Get all resource types information from known resource types. + * @return List of ResourceTypeInfo + */ + public static List getResourcesTypeInfo() { + List array = new ArrayList<>(); + // Add all resource types + Collection resourcesInfo = + ResourceUtils.getResourceTypes().values(); + for (ResourceInformation resourceInfo : resourcesInfo) { + array.add(ResourceTypeInfo + .newInstance(resourceInfo.getName(), resourceInfo.getUnits(), + resourceInfo.getResourceType())); + } + return array; + } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AMSProcessingChain.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AMSProcessingChain.java index 931b1c8b7d5..7ae23e7bb63 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AMSProcessingChain.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AMSProcessingChain.java @@ -82,7 +82,7 @@ public synchronized void addProcessor( public void registerApplicationMaster( ApplicationAttemptId applicationAttemptId, RegisterApplicationMasterRequest request, - RegisterApplicationMasterResponse resp) throws IOException { + RegisterApplicationMasterResponse resp) throws IOException, YarnException { this.head.registerApplicationMaster(applicationAttemptId, request, resp); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java index f657415f827..0326ebcd569 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java @@ -182,6 +182,7 @@ import org.apache.hadoop.yarn.util.UTCClock; import com.google.common.annotations.VisibleForTesting; +import org.apache.hadoop.yarn.util.resource.ResourceUtils; import org.apache.hadoop.yarn.util.timeline.TimelineUtils; @@ -1775,42 +1776,26 @@ public GetAllResourceProfilesResponse getResourceProfiles( GetAllResourceProfilesRequest request) throws YarnException, IOException { GetAllResourceProfilesResponse response = GetAllResourceProfilesResponse.newInstance(); - response.setResourceProfiles(getResourceProfiles()); + response.setResourceProfiles(resourceProfilesManager.getResourceProfiles()); return response; } @Override public GetResourceProfileResponse getResourceProfile( GetResourceProfileRequest request) throws YarnException, IOException { - Map profiles = getResourceProfiles(); - if (!profiles.containsKey(request.getProfileName())) { - throw new YarnException( - "Resource profile '" + request.getProfileName() + "' not found"); - } GetResourceProfileResponse response = GetResourceProfileResponse.newInstance(); - response.setResource(profiles.get(request.getProfileName())); + response.setResource( + resourceProfilesManager.getProfile(request.getProfileName())); return response; } - private Map getResourceProfiles() throws YarnException { - boolean resourceProfilesEnabled = getConfig() - .getBoolean(YarnConfiguration.RM_RESOURCE_PROFILES_ENABLED, - YarnConfiguration.DEFAULT_RM_RESOURCE_PROFILES_ENABLED); - if (!resourceProfilesEnabled) { - throw new ResourceProfilesNotEnabledException( - "Resource profiles are not enabled"); - } - return resourceProfilesManager.getResourceProfiles(); - } - @Override public GetAllResourceTypeInfoResponse getResourceTypeInfo( GetAllResourceTypeInfoRequest request) throws YarnException, IOException { GetAllResourceTypeInfoResponse response = GetAllResourceTypeInfoResponse.newInstance(); - response.setResourceTypeInfo( - resourceProfilesManager.getAllResourceTypeInfo()); + response.setResourceTypeInfo(ResourceUtils.getResourcesTypeInfo()); return response; } } 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 3f12f31e43f..3a5ab0b9f2d 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 @@ -113,7 +113,8 @@ public void init(ApplicationMasterServiceContext amsContext, public void registerApplicationMaster( ApplicationAttemptId applicationAttemptId, RegisterApplicationMasterRequest request, - RegisterApplicationMasterResponse response) throws IOException { + RegisterApplicationMasterResponse response) + throws IOException, YarnException { RMApp app = getRmContext().getRMApps().get( applicationAttemptId.getApplicationId()); @@ -173,10 +174,11 @@ public void registerApplicationMaster( response.setSchedulerResourceTypes(getScheduler() .getSchedulingResourceTypes()); - if (getRmContext().getYarnConfiguration().getBoolean(YarnConfiguration.RM_RESOURCE_PROFILES_ENABLED, - YarnConfiguration.DEFAULT_RM_RESOURCE_PROFILES_ENABLED)) { - response - .setResourceProfiles(resourceProfilesManager.getResourceProfiles()); + if (getRmContext().getYarnConfiguration().getBoolean( + YarnConfiguration.RM_RESOURCE_PROFILES_ENABLED, + YarnConfiguration.DEFAULT_RM_RESOURCE_PROFILES_ENABLED)) { + response.setResourceProfiles( + resourceProfilesManager.getResourceProfiles()); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/OpportunisticContainerAllocatorAMService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/OpportunisticContainerAllocatorAMService.java index 3c278de19ab..daf3160747c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/OpportunisticContainerAllocatorAMService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/OpportunisticContainerAllocatorAMService.java @@ -127,7 +127,8 @@ public void init(ApplicationMasterServiceContext amsContext, public void registerApplicationMaster( ApplicationAttemptId applicationAttemptId, RegisterApplicationMasterRequest request, - RegisterApplicationMasterResponse response) throws IOException { + RegisterApplicationMasterResponse response) + throws IOException, YarnException { SchedulerApplicationAttempt appAttempt = ((AbstractYarnScheduler) getScheduler()).getApplicationAttempt(applicationAttemptId); if (appAttempt.getOpportunisticContainerContext() == null) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMServerUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMServerUtils.java index d3e834578d9..2aae3a5c55e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMServerUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMServerUtils.java @@ -628,20 +628,6 @@ public static int getApplicableNodeCountForAM(RMContext rmContext, } } - public static void convertProfileToResourceCapability( - List asks, Configuration conf, - ResourceProfilesManager resourceProfilesManager) throws YarnException { - boolean profilesEnabled = - conf.getBoolean(YarnConfiguration.RM_RESOURCE_PROFILES_ENABLED, - YarnConfiguration.DEFAULT_RM_RESOURCE_PROFILES_ENABLED); - if (!profilesEnabled) { - return; - } - for (ResourceRequest req : asks) { - convertProfileToResourceCapability(req, conf, resourceProfilesManager); - } - } - public static void convertProfileToResourceCapability(ResourceRequest ask, Configuration conf, ResourceProfilesManager resourceProfilesManager) throws YarnException { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManager.java index 896312178ee..35c68c7849e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManager.java @@ -18,11 +18,10 @@ package org.apache.hadoop.yarn.server.resourcemanager.resource; -import org.apache.hadoop.classification.InterfaceAudience.Public; -import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.ResourceTypeInfo; +import org.apache.hadoop.yarn.exceptions.YarnException; import java.io.IOException; import java.util.List; @@ -32,8 +31,6 @@ * Interface for the resource profiles manager. Provides an interface to get * the list of available profiles and some helper functions. */ -@Public -@Unstable public interface ResourceProfilesManager { /** @@ -48,13 +45,13 @@ * @param profile name of resource profile * @return resource capability for given profile */ - Resource getProfile(String profile); + Resource getProfile(String profile) throws YarnException; /** * Get all supported resource profiles. * @return a map of resource objects associated with each profile */ - Map getResourceProfiles(); + Map getResourceProfiles() throws YarnException; /** * Reload profiles based on updated configuration. @@ -66,23 +63,17 @@ * Get default supported resource profile. * @return resource object which is default */ - Resource getDefaultProfile(); + Resource getDefaultProfile() throws YarnException; /** * Get minimum supported resource profile. * @return resource object which is minimum */ - Resource getMinimumProfile(); + Resource getMinimumProfile() throws YarnException; /** * Get maximum supported resource profile. * @return resource object which is maximum */ - Resource getMaximumProfile(); - - /** - * List of ResourceTypeInfo objects which carry all resources supported by RM. - * @return list of ResourceTypeInfo objects - */ - List getAllResourceTypeInfo(); + Resource getMaximumProfile() throws YarnException; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.java index ff4e3e4ec30..99625abf7d4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/resource/ResourceProfilesManagerImpl.java @@ -26,6 +26,8 @@ import org.apache.hadoop.yarn.api.records.ResourceInformation; import org.apache.hadoop.yarn.api.records.ResourceTypeInfo; import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.apache.hadoop.yarn.exceptions.YarnException; +import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.util.resource.ResourceUtils; import org.apache.hadoop.yarn.util.resource.Resources; import org.codehaus.jackson.map.ObjectMapper; @@ -52,6 +54,7 @@ private List resourceTypeInfo = new ArrayList(); private Configuration conf; + private boolean profileEnabled = false; private static final String MEMORY = ResourceInformation.MEMORY_MB.getName(); private static final String VCORES = ResourceInformation.VCORES.getName(); @@ -65,6 +68,9 @@ private static final String[] MANDATORY_PROFILES = { DEFAULT_PROFILE, MINIMUM_PROFILE, MAXIMUM_PROFILE }; + private static final String FEATURE_NOT_ENABLED_MSG = + "Resource profile is not enabled, please " + + "enable resource profile feature before using its functions"; public ResourceProfilesManagerImpl() { ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); @@ -98,10 +104,10 @@ private void loadResourceTypes() { } private void loadProfiles() throws IOException { - boolean profilesEnabled = + profileEnabled = conf.getBoolean(YarnConfiguration.RM_RESOURCE_PROFILES_ENABLED, YarnConfiguration.DEFAULT_RM_RESOURCE_PROFILES_ENABLED); - if (!profilesEnabled) { + if (!profileEnabled) { return; } String sourceFile = @@ -182,13 +188,31 @@ private Resource parseResource(Map profileInfo) throws IOException { return resource; } + private void checkAndThrowExceptionWhenFeatureDisabled() throws YarnException { + if (!profileEnabled) { + throw new YarnException(FEATURE_NOT_ENABLED_MSG); + } + } + @Override - public Resource getProfile(String profile) { - return Resources.clone(profiles.get(profile)); + public Resource getProfile(String profile) throws YarnException{ + checkAndThrowExceptionWhenFeatureDisabled(); + + if (profile == null) { + throw new YarnException("Name of profile cannot be null"); + } + + Resource profileRes = profiles.get(profile); + if (profileRes == null) { + throw new YarnException( + "Resource profile '" + profile + "' not found"); + } + return Resources.clone(profileRes); } @Override - public Map getResourceProfiles() { + public Map getResourceProfiles() throws YarnException { + checkAndThrowExceptionWhenFeatureDisabled(); return Collections.unmodifiableMap(profiles); } @@ -200,17 +224,17 @@ public void reloadProfiles() throws IOException { } @Override - public Resource getDefaultProfile() { + public Resource getDefaultProfile() throws YarnException { return getProfile(DEFAULT_PROFILE); } @Override - public Resource getMinimumProfile() { + public Resource getMinimumProfile() throws YarnException { return getProfile(MINIMUM_PROFILE); } @Override - public Resource getMaximumProfile() { + public Resource getMaximumProfile() throws YarnException { return getProfile(MAXIMUM_PROFILE); } @@ -220,13 +244,4 @@ private ResourceInformation fromString(String name, String value) { Long.valueOf(value.substring(0, value.length() - units.length())); return ResourceInformation.newInstance(name, units, resourceValue); } - - public List getAllResourceTypeInfo() { - try { - readLock.lock(); - return Collections.unmodifiableList(resourceTypeInfo); - } finally { - readLock.unlock(); - } - } } 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/AbstractYarnScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractYarnScheduler.java index 99b798d8ff9..a5fea638581 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractYarnScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractYarnScheduler.java @@ -58,6 +58,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.InvalidResourceRequestException; import org.apache.hadoop.yarn.exceptions.YarnException; +import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; import org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus; import org.apache.hadoop.yarn.server.resourcemanager.RMAppManagerEvent; @@ -1279,7 +1280,12 @@ public Resource getMinimumAllocation() { if (!profilesEnabled) { ret = ResourceUtils.getResourceTypesMinimumAllocation(); } else { - ret = rmContext.getResourceProfilesManager().getMinimumProfile(); + try { + ret = rmContext.getResourceProfilesManager().getMinimumProfile(); + } catch (YarnException e) { + LOG.error("Exception when get minimum profile from profile manager", e); + throw new YarnRuntimeException(e); + } } LOG.info("Minimum allocation = " + ret); return ret; @@ -1301,7 +1307,14 @@ public Resource getMaximumAllocation() { if (!profilesEnabled) { ret = ResourceUtils.getResourceTypesMaximumAllocation(); } else { - ret = rmContext.getResourceProfilesManager().getMaximumProfile(); + try { + ret = rmContext.getResourceProfilesManager().getMaximumProfile(); + } catch (YarnException e) { + LOG.error( + "Exception when get maximum profile from ResourceProfileManager", + e); + throw new YarnRuntimeException(e); + } } LOG.info("Maximum allocation = " + ret); return ret; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationMasterService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationMasterService.java index 4af1e320bbe..2815564368c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationMasterService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationMasterService.java @@ -103,9 +103,11 @@ public void init(ApplicationMasterServiceContext amsContext, } @Override - public void registerApplicationMaster(ApplicationAttemptId - applicationAttemptId, RegisterApplicationMasterRequest request, - RegisterApplicationMasterResponse response) throws IOException { + public void registerApplicationMaster( + ApplicationAttemptId applicationAttemptId, + RegisterApplicationMasterRequest request, + RegisterApplicationMasterResponse response) + throws IOException, YarnException { nextProcessor.registerApplicationMaster( applicationAttemptId, request, response); } @@ -145,7 +147,8 @@ public void init(ApplicationMasterServiceContext amsContext, public void registerApplicationMaster( ApplicationAttemptId applicationAttemptId, RegisterApplicationMasterRequest request, - RegisterApplicationMasterResponse response) throws IOException { + RegisterApplicationMasterResponse response) + throws IOException, YarnException { beforeRegCount.incrementAndGet(); nextProcessor.registerApplicationMaster(applicationAttemptId, request, response);