hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From templ...@apache.org
Subject [44/50] [abbrv] hadoop git commit: YARN-7270 addendum: Reapplied changes after YARN-3926 backports
Date Mon, 23 Oct 2017 18:20:45 GMT
YARN-7270 addendum: Reapplied changes after YARN-3926 backports


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

Branch: refs/heads/resource-types
Commit: ecb6d0f88dac394419f74795d0b951e9e7d2a9d8
Parents: 69d2544
Author: Daniel Templeton <templedf@apache.org>
Authored: Mon Oct 16 11:43:54 2017 -0700
Committer: Daniel Templeton <templedf@apache.org>
Committed: Mon Oct 23 11:19:25 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/yarn/api/records/Resource.java   | 4 ++--
 .../apache/hadoop/yarn/api/records/impl/LightWeightResource.java | 4 ++--
 .../apache/hadoop/yarn/api/records/impl/pb/ResourcePBImpl.java   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ecb6d0f8/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 9a5bc79..7e8c01d 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
@@ -285,7 +285,7 @@ public abstract class Resource implements Comparable<Resource> {
       return;
     }
     if (resource.equals(ResourceInformation.VCORES_URI)) {
-      this.setVirtualCores((int) resourceInformation.getValue());
+      this.setVirtualCores(castToIntSafely(resourceInformation.getValue()));
       return;
     }
     ResourceInformation storedResourceInfo = getResourceInformation(resource);
@@ -331,7 +331,7 @@ public abstract class Resource implements Comparable<Resource> {
       return;
     }
     if (resource.equals(ResourceInformation.VCORES_URI)) {
-      this.setVirtualCores((int)value);
+      this.setVirtualCores(castToIntSafely(value));
       return;
     }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ecb6d0f8/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/LightWeightResource.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/LightWeightResource.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/LightWeightResource.java
index b80e133..a64d242 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/LightWeightResource.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/LightWeightResource.java
@@ -92,7 +92,7 @@ public class LightWeightResource extends Resource {
   @Override
   @SuppressWarnings("deprecation")
   public int getMemory() {
-    return (int) memoryResInfo.getValue();
+    return castToIntSafely(memoryResInfo.getValue());
   }
 
   @Override
@@ -113,7 +113,7 @@ public class LightWeightResource extends Resource {
 
   @Override
   public int getVirtualCores() {
-    return (int) vcoresResInfo.getValue();
+    return castToIntSafely(vcoresResInfo.getValue());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ecb6d0f8/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ResourcePBImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ResourcePBImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ResourcePBImpl.java
index 06c30ff..4ae64c2 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ResourcePBImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ResourcePBImpl.java
@@ -117,7 +117,7 @@ public class ResourcePBImpl extends Resource {
   @Override
   public int getVirtualCores() {
     // vcores should always be present
-    return (int) resources[VCORES_INDEX].getValue();
+    return castToIntSafely(resources[VCORES_INDEX].getValue());
   }
 
   @Override


---------------------------------------------------------------------
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