Repository: twill
Updated Branches:
  refs/heads/master d6095d487 -> 00a844ade


(TWILL-255) Incorrect logging after memory was adjusted. Does not show memory 
before adjustment

This closes #66 on Github.

Signed-off-by: Terence Yim <[email protected]>


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

Branch: refs/heads/master
Commit: 00a844adedd2b86d3c2ea55a58a4a743c1724aaf
Parents: d6095d4
Author: Yuliya Feldman <[email protected]>
Authored: Wed Feb 28 14:52:56 2018 -0800
Committer: Terence Yim <[email protected]>
Committed: Thu Mar 1 10:07:14 2018 -0800

----------------------------------------------------------------------
 .../org/apache/twill/internal/yarn/Hadoop20YarnAMClient.java       | 2 +-
 .../org/apache/twill/internal/yarn/Hadoop21YarnAMClient.java       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/twill/blob/00a844ad/twill-yarn/src/main/hadoop20/org/apache/twill/internal/yarn/Hadoop20YarnAMClient.java
----------------------------------------------------------------------
diff --git 
a/twill-yarn/src/main/hadoop20/org/apache/twill/internal/yarn/Hadoop20YarnAMClient.java
 
b/twill-yarn/src/main/hadoop20/org/apache/twill/internal/yarn/Hadoop20YarnAMClient.java
index 67bef3e..76de0c0 100644
--- 
a/twill-yarn/src/main/hadoop20/org/apache/twill/internal/yarn/Hadoop20YarnAMClient.java
+++ 
b/twill-yarn/src/main/hadoop20/org/apache/twill/internal/yarn/Hadoop20YarnAMClient.java
@@ -126,8 +126,8 @@ public final class Hadoop20YarnAMClient extends 
AbstractYarnAMClient<AMRMClient.
     updatedMemory = (int) Math.ceil(((double) updatedMemory / minMemory)) * 
minMemory;
 
     if (resource.getMemory() != updatedMemory) {
-      resource.setMemory(updatedMemory);
       LOG.info("Adjust memory requirement from {} to {} MB.", 
resource.getMemory(), updatedMemory);
+      resource.setMemory(updatedMemory);
     }
 
     return resource;

http://git-wip-us.apache.org/repos/asf/twill/blob/00a844ad/twill-yarn/src/main/hadoop21/org/apache/twill/internal/yarn/Hadoop21YarnAMClient.java
----------------------------------------------------------------------
diff --git 
a/twill-yarn/src/main/hadoop21/org/apache/twill/internal/yarn/Hadoop21YarnAMClient.java
 
b/twill-yarn/src/main/hadoop21/org/apache/twill/internal/yarn/Hadoop21YarnAMClient.java
index f349b4e..42bff62 100644
--- 
a/twill-yarn/src/main/hadoop21/org/apache/twill/internal/yarn/Hadoop21YarnAMClient.java
+++ 
b/twill-yarn/src/main/hadoop21/org/apache/twill/internal/yarn/Hadoop21YarnAMClient.java
@@ -165,8 +165,8 @@ public class Hadoop21YarnAMClient extends 
AbstractYarnAMClient<AMRMClient.Contai
 
     int updatedMemory = Math.min(resource.getMemory(), 
maxCapability.getMemory());
     if (resource.getMemory() != updatedMemory) {
-      resource.setMemory(updatedMemory);
       LOG.info("Adjust memory requirement from {} to {} MB.", 
resource.getMemory(), updatedMemory);
+      resource.setMemory(updatedMemory);
     }
 
     return resource;

Reply via email to