hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From templ...@apache.org
Subject [45/50] [abbrv] hadoop git commit: YARN-7137. [YARN-3926] Move newly added APIs to unstable in YARN-3926 branch. Contributed by Wangda Tan.
Date Wed, 25 Oct 2017 23:14:37 GMT
YARN-7137. [YARN-3926] Move newly added APIs to unstable in YARN-3926 branch. Contributed by
Wangda Tan.

(cherry picked from commit da0b6a354bf6f6bf37ca5a05a4a8eece09aa4893)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/921c2658
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/921c2658
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/921c2658

Branch: refs/heads/resource-types
Commit: 921c2658a5709a3c29534bd15653e7e0586e48bc
Parents: 54c73d6
Author: Sunil G <sunilg@apache.org>
Authored: Tue Sep 12 20:31:47 2017 +0530
Committer: Daniel Templeton <templedf@apache.org>
Committed: Wed Oct 25 16:09:12 2017 -0700

----------------------------------------------------------------------
 .../hadoop/yarn/api/records/Resource.java       | 24 ++++++++++----------
 .../yarn/api/records/ResourceRequest.java       |  1 +
 .../yarn/util/resource/ResourceUtils.java       | 19 ----------------
 .../hadoop/yarn/util/resource/package-info.java |  6 +----
 .../resourcemanager/webapp/dao/AppInfo.java     |  2 +-
 5 files changed, 15 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/921c2658/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java
----------------------------------------------------------------------
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 37b50f2..9a5bc79 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<Resource> {
    *
    * @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<Resource> {
    * @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<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 abstract class Resource implements Comparable<Resource> {
    * @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<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 abstract class Resource implements Comparable<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 abstract class Resource implements Comparable<Resource> {
    * @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<Resource> {
    * @throws ResourceNotFoundException
    *           if the resource is not found
    */
-  @Public
-  @Evolving
+  @InterfaceAudience.Private
+  @InterfaceStability.Unstable
   public void setResourceValue(int index, long value)
       throws ResourceNotFoundException {
     try {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/921c2658/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java
----------------------------------------------------------------------
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 e9be6c3..43a339c 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;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/921c2658/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java
----------------------------------------------------------------------
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 110453a..1da5d6a 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<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 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);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/921c2658/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/package-info.java
----------------------------------------------------------------------
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 1e925d7..d7c799d 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

http://git-wip-us.apache.org/repos/asf/hadoop/blob/921c2658/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
----------------------------------------------------------------------
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 45e4952..40d7b4c 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
@@ -498,7 +498,7 @@ public class AppInfo {
   public Map<String, Long> getPreemptedResourceSecondsMap() {
     return preemptedResourceSecondsMap;
   }
-  
+
   public List<ResourceRequestInfo> getResourceRequests() {
     return this.resourceRequests;
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message