You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2016/12/06 17:04:35 UTC

[1/2] ambari git commit: AMBARI-19110. "Cluster Load" widget in ambari-dashboard, download as CSV is not working (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 149104c27 -> 0f2975106


AMBARI-19110. "Cluster Load" widget in ambari-dashboard, download as CSV is not working (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 0f297510640f24db5c11bfbabaa390bb29e619a6
Parents: 2cd12ce
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue Dec 6 18:29:00 2016 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue Dec 6 19:04:30 2016 +0200

----------------------------------------------------------------------
 .../common/widgets/export_metrics_mixin.js      | 28 ++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f297510/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
index 7517efd..aa4f77c 100644
--- a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
@@ -85,6 +85,7 @@ App.ExportMetricsMixin = Em.Mixin.create({
       ticksNumber,
       metricsNumber,
       metricsArray;
+    this.checkGraphDataForValidity(data);
     titles = data.map(function (item) {
       return displayUnit ? item.name + ' (' + displayUnit + ')' : item.name;
     }, this);
@@ -95,12 +96,35 @@ App.ExportMetricsMixin = Em.Mixin.create({
     for (var i = 0; i < ticksNumber; i++) {
       metricsArray.push([data[0].data[i][1]]);
       for (var j = 0; j < metricsNumber; j++) {
-        metricsArray[i + 1].push(data[j].data[i][0]);
+         metricsArray[i + 1].push(data[j].data[i][0]);
       };
-    }
+    };
     return stringUtils.arrayToCSV(metricsArray);
   },
 
+  checkGraphDataForValidity: function (data) {
+    data.sort(function (a, b) {
+      return b.data.length - a.data.length
+    });
+
+    var maxLength = data[0].data.length;
+
+    for (var i = 1; i < data.length; i ++) {
+      if (data[i].data.length !== maxLength) this.fillGraphDataArrayWithMockedData(data[i], maxLength);
+    }
+  },
+
+  fillGraphDataArrayWithMockedData: function (dataArray, neededLength) {
+    var startIndex = dataArray.data.length,
+      timestampInterval = dataArray.data[2][1] - dataArray.data[1][1];
+
+    for (var i = startIndex; i < neededLength; i++) {
+      var previousTimestamp = dataArray.data[i - 1][1];
+
+      dataArray.data.push([null, previousTimestamp + timestampInterval]);
+    }
+  },
+
   jsonReplacer: function () {
     var displayUnit = this.get('targetView.displayUnit');
     return function (key, value) {


[2/2] ambari git commit: Revert "AMBARI-18662. Check that Stack Version and repo URLs match up when registering repo (alexantonenko)"

Posted by al...@apache.org.
Revert "AMBARI-18662. Check that Stack Version and repo URLs match up when registering repo (alexantonenko)"

This reverts commit 00f1e71b62f4133e70d7d8f9f2cd6fa0624ec40d.


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

Branch: refs/heads/trunk
Commit: 2cd12ce4cebcf0a3a6fa58ff6f79a79b0a92f631
Parents: 149104c
Author: Alex Antonenko <hi...@gmail.com>
Authored: Fri Dec 2 20:22:01 2016 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue Dec 6 19:04:30 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/installer.js         |  3 +--
 .../app/controllers/wizard/step1_controller.js  | 21 +-------------------
 ambari-web/app/messages.js                      |  2 --
 ambari-web/test/controllers/installer_test.js   | 13 +++++-------
 4 files changed, 7 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/app/controllers/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js
index f736ba3..e2c60c4 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -841,7 +841,6 @@ App.InstallerController = App.WizardController.extend({
       selectedStack.get('operatingSystems').forEach(function (os) {
         if (os.get('isSelected') && !os.get('isEmpty')) {
           os.get('repositories').forEach(function (repo) {
-            if (!repo.get('isUtils') && wizardStep1Controller.inappropriateUrlForStackVersion(repo, stackVersion)) return;
             repo.setProperties({
               errorTitle: '',
               errorContent: '',
@@ -889,8 +888,8 @@ App.InstallerController = App.WizardController.extend({
       }
     }
     this.set('validationCnt', this.get('validationCnt') - 1);
-    this.set('content.isCheckInProgress', false);
     if (!this.get('validationCnt')) {
+      this.set('content.isCheckInProgress', false);
       data.dfd.resolve();
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/app/controllers/wizard/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step1_controller.js b/ambari-web/app/controllers/wizard/step1_controller.js
index 72f3944..f397cd8 100644
--- a/ambari-web/app/controllers/wizard/step1_controller.js
+++ b/ambari-web/app/controllers/wizard/step1_controller.js
@@ -272,25 +272,6 @@ App.WizardStep1Controller = Em.Controller.extend({
     this.selectStackBy('id', event.context.get('id'));
   },
 
-  inappropriateUrlForStackVersion: function (repo, stackVersion) {
-    var baseUrl = repo.get('baseUrl'),
-      splittedBaseUrlArray = baseUrl.split('/'),
-      versionInUrl =  baseUrl[baseUrl.length - 1] === '/' ? splittedBaseUrlArray[splittedBaseUrlArray.length - 2] :
-                      splittedBaseUrlArray[splittedBaseUrlArray.length - 1],
-      versionInUrlString = String(parseFloat(versionInUrl)),
-      UrlIsInvalidForStackVersion = versionInUrlString !== stackVersion;
-
-    if (UrlIsInvalidForStackVersion) {
-      repo.setProperties({
-        validation: App.Repository.validation.INVALID,
-        errorTitle: Em.I18n.t("installer.step1.error.inappropriateUrlForStackVersion.title"),
-        errorContent: Em.I18n.t("installer.step1.error.inappropriateUrlForStackVersion.content").format(stackVersion, versionInUrlString)
-      });
-    }
-
-    return UrlIsInvalidForStackVersion;
-  },
-
   /**
    * Show popup with options to upload new version
    *
@@ -461,7 +442,7 @@ App.WizardStep1Controller = Em.Controller.extend({
            */
           enterUrlRadioButton: App.RadioButtonView.extend({
             labelTranslate: 'installer.step1.useLocalRepo.enterUrl',
-            checked: Em.computed.alias('controller.optionsToSelect.useLocalRepo.enterUrl.isSelected'),
+            checked: Em.computed.alias('controller.optionsToSelect.useLocalRepo.enterUrl.isSelected')
           }),
 
           click: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 090244c..595cd5d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -642,8 +642,6 @@ Em.I18n.translations = {
   'installer.step1.invalidURLAttention': '<b>Attention:</b> Please make sure all repository URLs are valid before proceeding.',
   'installer.step1.checkAtLeastOneAttention': '<b>Attention:</b> Please check at least one repository.',
   'installer.step1.retryRepoUrls': 'Click <b>here</b> to retry.',
-  'installer.step1.error.inappropriateUrlForStackVersion.title':'Inappropriate Url for selected Stack Version',
-  'installer.step1.error.inappropriateUrlForStackVersion.content': 'Your stack version is {0} when version in Url is {1}',
 
   'installer.step2.header':'Install Options',
   'installer.step2.body':'Enter the list of hosts to be included in the cluster and provide your SSH key.',

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cd12ce4/ambari-web/test/controllers/installer_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/installer_test.js b/ambari-web/test/controllers/installer_test.js
index 63578bc..441af87 100644
--- a/ambari-web/test/controllers/installer_test.js
+++ b/ambari-web/test/controllers/installer_test.js
@@ -75,8 +75,8 @@ describe('App.InstallerController', function () {
       Em.Object.create({
         isSelected: true,
         reload: false,
-        id: 'nn-2.5',
-        stackNameVersion: 'nn-2.5',
+        id: 'nn-cc',
+        stackNameVersion: 'nn-cc',
         repositories: Em.A([
           Em.Object.create({
             isSelected: true,
@@ -89,7 +89,6 @@ describe('App.InstallerController', function () {
             isEmpty: false,
             repositories: Em.A([
               Em.Object.create({
-                baseUrl: 'url/2.5',
                 isEmpty: false,
                 errorTitle: '1',
                 errorContent: '1',
@@ -101,8 +100,7 @@ describe('App.InstallerController', function () {
       })
     ]);
     var wizard = Em.Object.create({
-      skipValidationChecked: true,
-      inappropriateUrlForStackVersion: App.WizardStep1Controller.create().inappropriateUrlForStackVersion
+      skipValidationChecked: true
     });
     it ('Should reload installed stacks', function() {
 
@@ -116,8 +114,8 @@ describe('App.InstallerController', function () {
         {
           "isSelected": true,
           "reload": true,
-          "id": "nn-2.5",
-          "stackNameVersion": 'nn-2.5',
+          "id": "nn-cc",
+          "stackNameVersion": 'nn-cc',
           "repositories": [
             {
               "isSelected": true,
@@ -130,7 +128,6 @@ describe('App.InstallerController', function () {
               "isEmpty": false,
               "repositories": [
                 {
-                  "baseUrl": "url/2.5",
                   "isEmpty": false,
                   "errorTitle": "",
                   "errorContent": "",