Updated Branches:
  refs/heads/branch-1.4 4720ee5c6 -> 1737fb0fb

AMBARI-3707. YARN dynamic configs generate 0 map/reduce memory on 2GB machines. 
(srimanth)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/1737fb0f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/1737fb0f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/1737fb0f

Branch: refs/heads/branch-1.4
Commit: 1737fb0fba47a2dcb5fcef5cbd2f61a18977119b
Parents: 4720ee5
Author: Srimanth Gunturi <[email protected]>
Authored: Wed Nov 6 13:07:50 2013 -0800
Committer: Srimanth Gunturi <[email protected]>
Committed: Wed Nov 6 13:15:46 2013 -0800

----------------------------------------------------------------------
 .../app/utils/defaults_providers/yarn_defaults_provider.js     | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/1737fb0f/ambari-web/app/utils/defaults_providers/yarn_defaults_provider.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/defaults_providers/yarn_defaults_provider.js 
b/ambari-web/app/utils/defaults_providers/yarn_defaults_provider.js
index 4b10e97..a22395a 100644
--- a/ambari-web/app/utils/defaults_providers/yarn_defaults_provider.js
+++ b/ambari-web/app/utils/defaults_providers/yarn_defaults_provider.js
@@ -101,6 +101,9 @@ App.YARNDefaultsProvider = App.DefaultsProvider.create({
     if (this.get('clusterData.hBaseInstalled')) {
       ram -= this.get('hBaseRam')
     }
+    if (ram < 1) {
+      ram = 1;
+    }
     ram *= this.get('GB');
     ram /= containerSize;
     return Math.round(Math.max(cpu, Math.min(disk, ram)));
@@ -119,6 +122,9 @@ App.YARNDefaultsProvider = App.DefaultsProvider.create({
     if (this.get('clusterData.hBaseInstalled')) {
       ram -= this.get('hBaseRam')
     }
+    if (ram < 1) {
+      ram = 1;
+    }
     ram *= this.get('GB');
     var container_ram = Math.abs(ram / containers);
     return container_ram > this.get('GB') ? container_ram / (512 * 512) : 
container_ram;

Reply via email to