ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-10593. YARN CPU vCore values returned by not being shown in UI (onechiporenko)
Date Mon, 20 Apr 2015 11:56:10 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d36d89464 -> e5cfe183f


AMBARI-10593. YARN CPU vCore values returned by not being shown in UI (onechiporenko)


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

Branch: refs/heads/trunk
Commit: e5cfe183f87ca0a8fa93d8797f360338893927a5
Parents: d36d894
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Mon Apr 20 14:20:23 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Mon Apr 20 14:55:36 2015 +0300

----------------------------------------------------------------------
 .../YARN/2.1.0.2.0/configuration/yarn-site.xml  |  2 +-
 .../widgets/slider_config_widget_view.js        | 46 +++++++++++---------
 2 files changed, 27 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e5cfe183/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
index 9b338ae..ed59973 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml
@@ -100,7 +100,7 @@
       <minimum>0</minimum>
       <maximum>5120</maximum>
       <unit>MB</unit>
-      <increment-step>250</increment-step>
+      <increment-step>256</increment-step>
     </value-attributes>
     <depends-on>
       <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5cfe183/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
index d1f0b05..228f6e2 100644
--- a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
@@ -253,26 +253,32 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
     ticks.forEach(function (tick, index) {
       ticksLabels.push(index % 2 === 0 ? tick + ' ' + self.get('unitLabel') : '');
     });
-    // process additional tick for default value if it not defined in previous computation
-    if (!ticks.contains(defaultValue)) {
-      // push default value
-      ticks.push(defaultValue);
-      // and resort array
-      ticks = ticks.sort(function(a,b) { return a-b; });
-      defaultValueId = ticks.indexOf(defaultValue);
-      // to save nice tick labels layout we should add new tick value which is mirrored by
index to default value
-      defaultValueMirroredId = ticks.length - defaultValueId;
-      // push empty label for default value tick
-      ticksLabels.insertAt(defaultValueId, '');
-      // push empty to mirrored position
-      ticksLabels.insertAt(defaultValueMirroredId, '');
-      // for saving correct sliding need to add value to mirrored position which is average
between previous
-      // and next value
-      ticks.insertAt(defaultValueMirroredId, (ticks[defaultValueMirroredId] + ticks[defaultValueMirroredId
- 1])/2);
-      // get new index for default value
-      defaultValueId = ticks.indexOf(defaultValue);
-    } else {
-      defaultValueId = ticks.indexOf(defaultValue);
+
+    // default-value marker should be added only if defaultValue is in range [min, max]
+    if (defaultValue <= this.get('maxMirrorValue') && defaultValue >= this.get('minMirrorValue'))
{
+      // process additional tick for default value if it not defined in previous computation
+      if (!ticks.contains(defaultValue)) {
+        // push default value
+        ticks.push(defaultValue);
+        // and resort array
+        ticks = ticks.sort(function (a, b) {
+          return a - b;
+        });
+        defaultValueId = ticks.indexOf(defaultValue);
+        // to save nice tick labels layout we should add new tick value which is mirrored
by index to default value
+        defaultValueMirroredId = ticks.length - defaultValueId;
+        // push empty label for default value tick
+        ticksLabels.insertAt(defaultValueId, '');
+        // push empty to mirrored position
+        ticksLabels.insertAt(defaultValueMirroredId, '');
+        // for saving correct sliding need to add value to mirrored position which is average
between previous
+        // and next value
+        ticks.insertAt(defaultValueMirroredId, (ticks[defaultValueMirroredId] + ticks[defaultValueMirroredId
- 1]) / 2);
+        // get new index for default value
+        defaultValueId = ticks.indexOf(defaultValue);
+      } else {
+        defaultValueId = ticks.indexOf(defaultValue);
+      }
     }
     var slider = new Slider(this.$('input.slider-input')[0], {
       value: this.get('mirrorValue'),


Mime
View raw message