diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java index be0ab58be83..7e8c01d3636 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java @@ -206,8 +206,8 @@ public abstract class Resource implements Comparable { * * @return Map of resource name to ResourceInformation */ - @Public - @Evolving + @InterfaceAudience.Private + @InterfaceStability.Unstable public ResourceInformation[] getResources() { return resources; } @@ -220,7 +220,7 @@ public abstract class Resource implements Comparable { * @throws ResourceNotFoundException if the resource can't be found */ @Public - @Evolving + @InterfaceStability.Unstable public ResourceInformation getResourceInformation(String resource) throws ResourceNotFoundException { Integer index = ResourceUtils.getResourceTypeIndex().get(resource); @@ -240,8 +240,8 @@ public abstract class Resource implements Comparable { * @throws ResourceNotFoundException * if the resource can't be found */ - @Public - @Evolving + @InterfaceAudience.Private + @InterfaceStability.Unstable public ResourceInformation getResourceInformation(int index) throws ResourceNotFoundException { ResourceInformation ri = null; @@ -262,7 +262,7 @@ public abstract class Resource implements Comparable { * @throws ResourceNotFoundException if the resource can't be found */ @Public - @Evolving + @InterfaceStability.Unstable public long getResourceValue(String resource) throws ResourceNotFoundException { return getResourceInformation(resource).getValue(); @@ -276,7 +276,7 @@ public abstract class Resource implements Comparable { * @throws ResourceNotFoundException if the resource is not found */ @Public - @Evolving + @InterfaceStability.Unstable public void setResourceInformation(String resource, ResourceInformation resourceInformation) throws ResourceNotFoundException { @@ -302,8 +302,8 @@ public abstract class Resource implements Comparable { * @throws ResourceNotFoundException * if the resource is not found */ - @Public - @Evolving + @InterfaceAudience.Private + @InterfaceStability.Unstable public void setResourceInformation(int index, ResourceInformation resourceInformation) throws ResourceNotFoundException { @@ -323,7 +323,7 @@ public abstract class Resource implements Comparable { * @throws ResourceNotFoundException if the resource is not found */ @Public - @Evolving + @InterfaceStability.Unstable public void setResourceValue(String resource, long value) throws ResourceNotFoundException { if (resource.equals(ResourceInformation.MEMORY_URI)) { @@ -350,8 +350,8 @@ public abstract class Resource implements Comparable { * @throws ResourceNotFoundException * if the resource is not found */ - @Public - @Evolving + @InterfaceAudience.Private + @InterfaceStability.Unstable public void setResourceValue(int index, long value) throws ResourceNotFoundException { try { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java index 94eda7c4826..e1a98ae8045 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java @@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.records; import java.io.Serializable; import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Unstable; 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 110453abde7..1da5d6afb08 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 @@ -49,8 +49,6 @@ import java.util.concurrent.ConcurrentHashMap; /** * Helper class to read the resource-types to be supported by the system. */ -@InterfaceAudience.Public -@InterfaceStability.Unstable public class ResourceUtils { public static final String UNITS = ".units"; @@ -65,7 +63,6 @@ public class ResourceUtils { private static final Map RESOURCE_NAME_TO_INDEX = new ConcurrentHashMap(); private static volatile Map resourceTypes; - private static volatile String[] resourceNamesArray; private static volatile ResourceInformation[] resourceTypesArray; private static volatile boolean initializedNodeResources = false; private static volatile Map readOnlyNodeResources; @@ -270,7 +267,6 @@ public class ResourceUtils { private static void updateKnownResources() { // Update resource names. - resourceNamesArray = new String[resourceTypes.size()]; resourceTypesArray = new ResourceInformation[resourceTypes.size()]; int index = 2; @@ -278,14 +274,11 @@ public class ResourceUtils { if (resInfo.getName().equals(MEMORY)) { resourceTypesArray[0] = ResourceInformation .newInstance(resourceTypes.get(MEMORY)); - resourceNamesArray[0] = MEMORY; } else if (resInfo.getName().equals(VCORES)) { resourceTypesArray[1] = ResourceInformation .newInstance(resourceTypes.get(VCORES)); - resourceNamesArray[1] = VCORES; } else { resourceTypesArray[index] = ResourceInformation.newInstance(resInfo); - resourceNamesArray[index] = resInfo.getName(); index++; } } @@ -319,18 +312,6 @@ public class ResourceUtils { YarnConfiguration.RESOURCE_TYPES_CONFIGURATION_FILE); } - /** - * Get resource names array, this is mostly for performance perspective. Never - * modify returned array. - * - * @return resourceNamesArray - */ - public static String[] getResourceNamesArray() { - initializeResourceTypesIfNeeded(null, - YarnConfiguration.RESOURCE_TYPES_CONFIGURATION_FILE); - return resourceNamesArray; - } - public static ResourceInformation[] getResourceTypesArray() { initializeResourceTypesIfNeeded(null, YarnConfiguration.RESOURCE_TYPES_CONFIGURATION_FILE); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/package-info.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/package-info.java index 1e925d7d57c..d7c799d7cbf 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/package-info.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/package-info.java @@ -19,8 +19,4 @@ * Package org.apache.hadoop.yarn.util.resource contains classes * which is used as utility class for resource profile computations. */ -@InterfaceAudience.Public -@InterfaceStability.Unstable -package org.apache.hadoop.yarn.util.resource; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; \ No newline at end of file +package org.apache.hadoop.yarn.util.resource; \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java index 1c9df717c74..880d22fd3f0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java @@ -503,7 +503,7 @@ public class AppInfo { public Map getPreemptedResourceSecondsMap() { return preemptedResourceSecondsMap; } - + public List getResourceRequests() { return this.resourceRequests; }