YARN-7137. [YARN-3926] Move newly added APIs to unstable in YARN-3926 branch. Contributed by Wangda Tan.

This commit is contained in:
Sunil G 2017-09-12 20:31:47 +05:30 committed by Wangda Tan
parent bf2b687412
commit da0b6a354b
5 changed files with 19 additions and 41 deletions

View File

@ -206,8 +206,8 @@ public void setMemorySize(long memory) {
*
* @return Map of resource name to ResourceInformation
*/
@Public
@Evolving
@InterfaceAudience.Private
@InterfaceStability.Unstable
public ResourceInformation[] getResources() {
return resources;
}
@ -220,7 +220,7 @@ public ResourceInformation[] getResources() {
* @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 ResourceInformation getResourceInformation(String resource)
* @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 ResourceInformation getResourceInformation(int index)
* @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 long getResourceValue(String resource)
* @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 void setResourceInformation(String resource,
* @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 void setResourceInformation(int index,
* @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 void setResourceValue(String resource, long value)
* @throws ResourceNotFoundException
* if the resource is not found
*/
@Public
@Evolving
@InterfaceAudience.Private
@InterfaceStability.Unstable
public void setResourceValue(int index, long value)
throws ResourceNotFoundException {
try {

View File

@ -21,6 +21,7 @@
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;
@ -103,7 +104,7 @@ public static ResourceRequest newInstance(Priority priority, String hostName,
}
@Public
@Evolving
@Unstable
public static ResourceRequest newInstance(Priority priority, String hostName,
Resource capability, int numContainers, boolean relaxLocality,
String labelExpression, ExecutionTypeRequest executionTypeRequest,
@ -261,7 +262,7 @@ public ResourceRequestBuilder allocationRequestId(
* @return {@link ResourceRequestBuilder}
*/
@Public
@Evolving
@InterfaceStability.Unstable
public ResourceRequestBuilder profileCapability(
ProfileCapability profileCapability) {
resourceRequest.setProfileCapability(profileCapability);
@ -486,11 +487,11 @@ public ExecutionTypeRequest getExecutionTypeRequest() {
public abstract void setNodeLabelExpression(String nodelabelExpression);
@Public
@Evolving
@InterfaceStability.Unstable
public abstract ProfileCapability getProfileCapability();
@Public
@Evolving
@InterfaceStability.Unstable
public abstract void setProfileCapability(ProfileCapability p);
/**

View File

@ -49,8 +49,6 @@
/**
* 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<String, Integer> RESOURCE_NAME_TO_INDEX =
new ConcurrentHashMap<String, Integer>();
private static volatile Map<String, ResourceInformation> resourceTypes;
private static volatile String[] resourceNamesArray;
private static volatile ResourceInformation[] resourceTypesArray;
private static volatile boolean initializedNodeResources = false;
private static volatile Map<String, ResourceInformation> readOnlyNodeResources;
@ -270,7 +267,6 @@ public static void initializeResourcesFromResourceInformationMap(
private static void updateKnownResources() {
// Update resource names.
resourceNamesArray = new String[resourceTypes.size()];
resourceTypesArray = new ResourceInformation[resourceTypes.size()];
int index = 2;
@ -278,14 +274,11 @@ private static void updateKnownResources() {
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 static Map<String, ResourceInformation> getResourceTypes() {
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);

View File

@ -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;
package org.apache.hadoop.yarn.util.resource;

View File

@ -458,7 +458,7 @@ public long getPreemptedVcoreSeconds() {
public Map<String, Long> getPreemptedResourceSecondsMap() {
return preemptedResourceSecondsMap;
}
public List<ResourceRequestInfo> getResourceRequests() {
return this.resourceRequests;
}