浏览代码

AMBARI-9001 remove the mirroring stuff from ambari-web. (ababiichuk)

aBabiichuk 10 年之前
父节点
当前提交
dd3d39a423
共有 47 个文件被更改,包括 0 次插入5418 次删除
  1. 0 23
      ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset1_definition.xml
  2. 0 42
      ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset1_instances.json
  3. 0 23
      ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset2_definition.xml
  4. 0 42
      ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset2_instances.json
  5. 0 23
      ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset3_definition.xml
  6. 0 22
      ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset3_instances.json
  7. 0 15
      ambari-web/app/assets/data/mirroring/cluster1_definition.xml
  8. 0 15
      ambari-web/app/assets/data/mirroring/cluster2_definition.xml
  9. 0 11
      ambari-web/app/assets/data/mirroring/clusters.xml
  10. 0 18
      ambari-web/app/assets/data/mirroring/feeds.xml
  11. 0 5
      ambari-web/app/assets/data/mirroring/succeeded.json
  12. 0 1
      ambari-web/app/config.js
  13. 0 23
      ambari-web/app/controllers/main/mirroring/datasets_controller.js
  14. 0 365
      ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
  15. 0 201
      ambari-web/app/controllers/main/mirroring/jobs_controller.js
  16. 0 176
      ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
  17. 0 377
      ambari-web/app/controllers/main/mirroring_controller.js
  18. 0 1
      ambari-web/app/mappers.js
  19. 0 70
      ambari-web/app/mappers/dataset_mapper.js
  20. 0 117
      ambari-web/app/messages.js
  21. 0 92
      ambari-web/app/models/dataset.js
  22. 0 82
      ambari-web/app/models/dataset_job.js
  23. 0 64
      ambari-web/app/routes/main.js
  24. 0 335
      ambari-web/app/styles/application.less
  25. 0 584
      ambari-web/app/styles/apps.less
  26. 0 20
      ambari-web/app/templates/main/mirroring.hbs
  27. 0 19
      ambari-web/app/templates/main/mirroring/addTargetCluster.hbs
  28. 0 76
      ambari-web/app/templates/main/mirroring/create_new_cluster.hbs
  29. 0 110
      ambari-web/app/templates/main/mirroring/datasets.hbs
  30. 0 134
      ambari-web/app/templates/main/mirroring/edit_dataset.hbs
  31. 0 181
      ambari-web/app/templates/main/mirroring/jobs.hbs
  32. 0 83
      ambari-web/app/templates/main/mirroring/manage_clusters.hbs
  33. 0 150
      ambari-web/app/utils/ajax/ajax.js
  34. 0 184
      ambari-web/app/utils/graph.js
  35. 0 38
      ambari-web/app/utils/misc.js
  36. 0 131
      ambari-web/app/views/main/mirroring/datasets_view.js
  37. 0 141
      ambari-web/app/views/main/mirroring/edit_dataset_view.js
  38. 0 220
      ambari-web/app/views/main/mirroring/jobs_view.js
  39. 0 78
      ambari-web/app/views/main/mirroring/manage_clusters_view.js
  40. 0 42
      ambari-web/app/views/main/mirroring_view.js
  41. 0 416
      ambari-web/test/controllers/main/mirroring/edit_dataset_controller_test.js
  42. 0 111
      ambari-web/test/mappers/jobs_mapper_test.js
  43. 0 138
      ambari-web/test/models/dataset_job_test.js
  44. 0 148
      ambari-web/test/models/dataset_test.js
  45. 0 24
      ambari-web/test/utils/misc_test.js
  46. 0 4
      ambari-web/test/views/main/menu_test.js
  47. 0 243
      ambari-web/test/views/main/mirroring/edit_dataset_view_test.js

+ 0 - 23
ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset1_definition.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<feed xmlns="uri:falcon:feed:0.1" name="ambari-mirroring-dataset1" description=""><frequency>hours(1)</frequency>
-    <clusters>
-        <cluster name="source-cluster" type="source">
-            <validity end="2014-12-31T00:00Z" start="2013-10-24T00:00Z"/>
-            <retention action="delete" limit="days(7)"/>
-        </cluster>
-
-        <cluster name="tdk" type="target">
-            <validity end="2014-12-31T00:00Z" start="2013-10-24T00:00Z"/>
-            <retention action="delete" limit="months(1)"/>
-            <locations>
-                <location type="data" path="/backup/app-logs1"/>
-            </locations>
-        </cluster>
-    </clusters>
-
-    <locations>
-        <location type="data" path="/app-logs1"/>
-    </locations>
-    <ACL permission="0755" group="users" owner="hue"/>
-    <schema provider="none" location="/none"/>
-</feed>

+ 0 - 42
ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset1_instances.json

@@ -1,42 +0,0 @@
-{"status": "SUCCEEDED", "message": "default/STATUS\n", "requestId": "default/a7463898-4d2a-4857-866d-15fdf65da84f\n", "instances": [
-  {
-    "instance": "2013-10-24T00:00Z",
-    "status": "KILLED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000004-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-14T06:23:33Z",
-    "endTime": "2014-01-09T06:24:29Z",
-    "details": ""
-  },
-  {
-    "instance": "2013-10-24T01:00Z",
-    "status": "KILLED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000005-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:25:35Z",
-    "endTime": "2014-01-09T06:26:02Z",
-    "details": ""
-  },
-  {
-    "instance": "2013-10-24T02:00Z",
-    "status": "KILLED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000006-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:30:35Z",
-    "endTime": "2014-01-07T06:31:03Z",
-    "details": ""
-  },
-  {
-    "instance": "2013-10-24T03:00Z",
-    "status": "KILLED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000007-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:35:35Z",
-    "endTime": "2014-01-02T06:36:03Z",
-    "details": ""
-  }
-]}

+ 0 - 23
ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset2_definition.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<feed xmlns="uri:falcon:feed:0.1" name="ambari-mirroring-dataset2" description=""><frequency>hours(1)</frequency>
-    <clusters>
-        <cluster name="source-cluster" type="source">
-            <validity end="2014-12-31T00:00Z" start="2013-10-24T00:00Z"/>
-            <retention action="delete" limit="days(7)"/>
-        </cluster>
-
-        <cluster name="tdk" type="target">
-            <validity end="2014-12-31T00:00Z" start="2013-10-24T00:00Z"/>
-            <retention action="delete" limit="months(1)"/>
-            <locations>
-                <location type="data" path="/backup/app-logs2"/>
-            </locations>
-        </cluster>
-    </clusters>
-
-    <locations>
-        <location type="data" path="/app-logs2"/>
-    </locations>
-    <ACL permission="0755" group="users" owner="hue"/>
-    <schema provider="none" location="/none"/>
-</feed>

+ 0 - 42
ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset2_instances.json

@@ -1,42 +0,0 @@
-{"status": "SUCCEEDED", "message": "default/STATUS\n", "requestId": "default/a7463898-4d2a-4857-866d-15fdf65da84f\n", "instances": [
-  {
-    "instance": "2012-10-24T00:00Z",
-    "status": "RUNNING",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000004-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:23:33Z",
-    "endTime": "2014-01-09T06:24:29Z",
-    "details": ""
-  },
-  {
-    "instance": "2012-10-24T01:00Z",
-    "status": "SUCCEEDED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000005-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:25:35Z",
-    "endTime": "2014-01-09T06:26:02Z",
-    "details": ""
-  },
-  {
-    "instance": "2012-10-24T02:00Z",
-    "status": "FAILED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000006-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:30:35Z",
-    "endTime": "2014-01-09T06:31:03Z",
-    "details": ""
-  },
-  {
-    "instance": "2012-10-24T03:00Z",
-    "status": "SUSPENDED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000007-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:35:35Z",
-    "endTime": "2014-01-09T06:36:03Z",
-    "details": ""
-  }
-]}

+ 0 - 23
ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset3_definition.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<feed xmlns="uri:falcon:feed:0.1" name="ambari-mirroring-dataset3" description=""><frequency>hours(1)</frequency>
-    <clusters>
-        <cluster name="source-cluster" type="source">
-            <validity end="2014-12-31T00:00Z" start="2013-10-24T00:00Z"/>
-            <retention action="delete" limit="days(7)"/>
-        </cluster>
-
-        <cluster name="tdk" type="target">
-            <validity end="2014-12-31T00:00Z" start="2013-10-24T00:00Z"/>
-            <retention action="delete" limit="months(1)"/>
-            <locations>
-                <location type="data" path="/backup/app-logs3"/>
-            </locations>
-        </cluster>
-    </clusters>
-
-    <locations>
-        <location type="data" path="/app-logs3"/>
-    </locations>
-    <ACL permission="0755" group="users" owner="hue"/>
-    <schema provider="none" location="/none"/>
-</feed>

+ 0 - 22
ambari-web/app/assets/data/mirroring/ambari-mirroring-dataset3_instances.json

@@ -1,22 +0,0 @@
-{"status": "SUCCEEDED", "message": "default/STATUS\n", "requestId": "default/a7463898-4d2a-4857-866d-15fdf65da84f\n", "instances": [
-  {
-    "instance": "2014-10-24T00:00Z",
-    "status": "FAILED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000004-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:23:33Z",
-    "endTime": "2014-01-09T06:24:29Z",
-    "details": ""
-  },
-  {
-    "instance": "2014-10-24T01:00Z",
-    "status": "SUSPENDED",
-    "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000005-140108205147729-oozie-oozi-W",
-    "cluster": "tdk",
-    "sourceCluster": "mcluster",
-    "startTime": "2014-01-09T06:25:35Z",
-    "endTime": "2014-01-09T06:26:02Z",
-    "details": ""
-  }
-]}

+ 0 - 15
ambari-web/app/assets/data/mirroring/cluster1_definition.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<cluster name="cluster1" description="" colo="default" xmlns="uri:falcon:cluster:0.1">
-    <interfaces>
-        <interface type="readonly" endpoint="hftp://c6401.ambari.apache.org:50070" version="2.2.0.2.0.6.0-76"/>
-        <interface type="write" endpoint="hdfs://c6401.ambari.apache.org:8020" version="2.2.0.2.0.6.0-76"/>
-        <interface type="execute" endpoint="c6401.ambari.apache.org:8050" version="2.2.0.2.0.6.0-76"/>
-        <interface type="workflow" endpoint="http://c6401.ambari.apache.org:11000/oozie" version="3.1.4"/>
-        <interface type="messaging" endpoint="tcp://c6401.ambari.apache.org:61616?daemon=true" version="5.1.6"/>
-    </interfaces>
-    <locations>
-        <location name="staging" path="/projects/falcon/staging"/>
-        <location name="temp" path="/tmp"/>
-        <location name="working" path="/projects/falcon/working"/>
-    </locations>
-</cluster>

+ 0 - 15
ambari-web/app/assets/data/mirroring/cluster2_definition.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<cluster name="cluster2" description="" colo="default" xmlns="uri:falcon:cluster:0.1">
-    <interfaces>
-        <interface type="readonly" endpoint="hftp://c6401.ambari.apache.org:50070" version="2.2.0.2.0.6.0-76"/>
-        <interface type="write" endpoint="hdfs://c6401.ambari.apache.org:8020" version="2.2.0.2.0.6.0-76"/>
-        <interface type="execute" endpoint="c6401.ambari.apache.org:8050" version="2.2.0.2.0.6.0-76"/>
-        <interface type="workflow" endpoint="http://c6401.ambari.apache.org:11000/oozie" version="3.1.4"/>
-        <interface type="messaging" endpoint="tcp://c6401.ambari.apache.org:61616?daemon=true" version="5.1.6"/>
-    </interfaces>
-    <locations>
-        <location name="staging" path="/projects/falcon/staging"/>
-        <location name="temp" path="/tmp"/>
-        <location name="working" path="/projects/falcon/working"/>
-    </locations>
-</cluster>

+ 0 - 11
ambari-web/app/assets/data/mirroring/clusters.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<entities>
-    <entity>
-        <type>cluster</type>
-        <name>cluster1</name>
-    </entity>
-    <entity>
-        <type>cluster</type>
-        <name>cluster2</name>
-    </entity>
-</entities>

+ 0 - 18
ambari-web/app/assets/data/mirroring/feeds.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<entities>
-    <entity>
-        <type>feed</type>
-        <name>ambari-mirroring-dataset1</name>
-        <status>RUNNING</status>
-    </entity>
-    <entity>
-        <type>feed</type>
-        <name>ambari-mirroring-dataset2</name>
-        <status>SUSPENDED</status>
-    </entity>
-    <entity>
-        <type>feed</type>
-        <name>ambari-mirroring-dataset3</name>
-        <status>SUBMITTED</status>
-    </entity>
-</entities>

+ 0 - 5
ambari-web/app/assets/data/mirroring/succeeded.json

@@ -1,5 +0,0 @@
-{
-  "requestId": "schedule\/default\/b5b40931-175b-4b15-8f2b-02ef2e66f06b\n\nsubmit\/default\/b5b40931-175b-4b15-8f2b-02ef2e66f06b\n\n",
-  "message": "schedule\/default\/SampleProcess(process) scheduled successfully\n\nsubmit\/default\/Submit successful (process) SampleProcess\n\n",
-  "status": "SUCCEEDED"
-}

+ 0 - 1
ambari-web/app/config.js

@@ -45,7 +45,6 @@ App.singleNodeInstall = false;
 App.singleNodeAlias = document.location.hostname;
 App.minDiskSpace = 2.0; // minimum disk space required for '/' for each host before install, unit GB
 App.minDiskSpaceUsrLib = 1.0; // minimum disk space for '/usr/lib' for each host before install, unit GB
-App.mirroringDatasetNamePrefix = 'ambari-mirroring-'; // special prefix to be added for each Falcon feed name created with Ambari
 App.healthIconClassGreen = 'icon-ok-sign'; // bootstrap icon class for healthy/started service/host/host-component
 App.healthIconClassRed = 'icon-warning-sign'; // bootstrap icon class for master down/stopped service/host/host-component
 App.healthIconClassOrange = 'icon-minus-sign'; // bootstrap icon class for slave down/decommissioned host/host-component

+ 0 - 23
ambari-web/app/controllers/main/mirroring/datasets_controller.js

@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.MainDatasetsController = Em.ArrayController.extend({
-  name: 'mainDatasetsController'
-});

+ 0 - 365
ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js

@@ -1,365 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-App.MainMirroringEditDataSetController = Ember.Controller.extend({
-  name: 'mainMirroringEditDataSetController',
-
-  /**
-   * Defines to show Edit Dataset or Create New Dataset popup
-   * @type {Boolean}
-   */
-  isEdit: false,
-
-  /**
-   * Contains Dataset id if <code>isEdit</code> is true
-   * @type {Boolean}
-   */
-  datasetIdToEdit: null,
-
-  /**
-   * Fields values from Edit DataSet form
-   * @type {Object}
-   */
-  formFields: Ember.Object.create({
-    datasetName: null,
-    datasetTargetClusterName: null,
-    datasetSourceDir: null,
-    datasetTargetDir: null,
-    datasetStartDate: null,
-    hoursForStart: null,
-    minutesForStart: null,
-    middayPeriodForStart: null,
-    datasetEndDate: null,
-    hoursForEnd: null,
-    minutesForEnd: null,
-    middayPeriodForEnd: null,
-    datasetFrequency: null,
-    repeatOptionSelected: null
-  }),
-
-  /**
-   * Messages for errors occurred during Edit DataSet form validation
-   * @type {Object}
-   */
-  errorMessages: Ember.Object.create({
-    name: '',
-    sourceDir: '',
-    targetDir: '',
-    startDate: '',
-    endDate: '',
-    frequency: '',
-    targetClusterName: ''
-  }),
-
-  /**
-   * Flags with errors related to each field in Edit/Create Dataset form
-   * @type {Object}
-   */
-  errors: Ember.Object.create({
-    isNameError: false,
-    isSourceDirError: false,
-    isTargetDirError: false,
-    isStartDateError: false,
-    isEndDateError: false,
-    isFrequencyError: false,
-    isTargetClusterNameError: false
-  }),
-
-  /**
-   * Clear all fields in Edit/Create Dataset form and clears all errors
-   */
-  clearStep: function () {
-    var formFields = this.get('formFields');
-    Em.keys(formFields).forEach(function (key) {
-      formFields.set(key, null);
-    }, this);
-    this.clearErrors();
-  },
-
-  /**
-   * Clear all error flags and messages
-   */
-  clearErrors: function () {
-    var errorMessages = this.get('errorMessages');
-    Em.keys(errorMessages).forEach(function (key) {
-      errorMessages.set(key, '');
-    }, this);
-    var errors = this.get('errors');
-    Em.keys(errors).forEach(function (key) {
-      errors.set(key, false);
-    }, this);
-  },
-
-  /**
-   * Show Create New Dataset popup
-   * @return {Object} popup view
-   */
-  showAddPopup: function () {
-    var popup = this.showPopup(Em.I18n.t('mirroring.dataset.newDataset'));
-    this.set('isEdit', false);
-    return popup;
-  },
-
-  /**
-   * Show Edit Dataset popup
-   * @return {Object} popup view
-   */
-  showEditPopup: function (dataset) {
-    this.set('datasetIdToEdit', dataset.get('id'));
-    var popup = this.showPopup(Em.I18n.t('mirroring.dataset.editDataset'));
-    this.set('isEdit', true);
-    return popup;
-  },
-
-  /**
-   * Show popup with Dataset form fields
-   * @return {Object} popup view
-   */
-  showPopup: function (header) {
-    var self = this;
-    var popup = App.ModalPopup.show({
-      classNames: ['sixty-percent-width-modal'],
-      header: header,
-      primary: Em.I18n.t('mirroring.dataset.save'),
-      secondary: Em.I18n.t('common.cancel'),
-      showCloseButton: false,
-      isSaving: false,
-      saveDisabled: function () {
-        return self.get('saveDisabled');
-      }.property('App.router.' + self.get('name') + '.saveDisabled'),
-      disablePrimary: function () {
-        return this.get('saveDisabled') || this.get('isSaving');
-      }.property('saveDisabled', 'isSaving'),
-      onPrimary: function () {
-        // Apply form validation for first click
-        if (!this.get('primaryWasClicked')) {
-          this.toggleProperty('primaryWasClicked');
-          self.applyValidation();
-          if (this.get('saveDisabled')) {
-            return false;
-          }
-        }
-        self.save();
-        App.router.transitionTo('main.mirroring.index');
-      },
-      primaryWasClicked: false,
-      onSecondary: function () {
-        this.hide();
-        App.router.send('gotoShowJobs');
-      },
-      bodyClass: App.MainMirroringEditDataSetView.extend({
-        controller: self
-      })
-    });
-    this.set('popup', popup);
-    return popup;
-  },
-
-  /**
-   * Set observer to call validate method if any property from formFields will change
-   */
-  applyValidation: function () {
-    Em.keys(this.get('formFields')).forEach(function (key) {
-      this.addObserver('formFields.' + key, this, 'validate');
-    }, this);
-    this.validate();
-  },
-
-  /**
-   * Return date object calculated from appropriate fields
-   * @type {Date}
-   */
-  scheduleStartDate: function () {
-    var startDate = this.get('formFields.datasetStartDate');
-    var hoursForStart = this.get('formFields.hoursForStart');
-    var minutesForStart = this.get('formFields.minutesForStart');
-    var middayPeriodForStart = this.get('formFields.middayPeriodForStart');
-    if (startDate && hoursForStart && minutesForStart && middayPeriodForStart) {
-      return new Date(startDate + ' ' + hoursForStart + ':' + minutesForStart + ' ' + middayPeriodForStart);
-    }
-    return null;
-  }.property('formFields.datasetStartDate', 'formFields.hoursForStart', 'formFields.minutesForStart', 'formFields.middayPeriodForStart'),
-
-  /**
-   * Return date object calculated from appropriate fields
-   * @type {Date}
-   */
-  scheduleEndDate: function () {
-    var endDate = this.get('formFields.datasetEndDate');
-    var hoursForEnd = this.get('formFields.hoursForEnd');
-    var minutesForEnd = this.get('formFields.minutesForEnd');
-    var middayPeriodForEnd = this.get('formFields.middayPeriodForEnd');
-    if (endDate && hoursForEnd && minutesForEnd && middayPeriodForEnd) {
-      return new Date(endDate + ' ' + hoursForEnd + ':' + minutesForEnd + ' ' + middayPeriodForEnd);
-    }
-    return null;
-  }.property('formFields.datasetEndDate', 'formFields.hoursForEnd', 'formFields.minutesForEnd', 'formFields.middayPeriodForEnd'),
-
-
-  /**
-   * Validation for every field in Edit DataSet form
-   */
-  validate: function () {
-    var formFields = this.get('formFields');
-    var errors = this.get('errors');
-    var errorMessages = this.get('errorMessages');
-    this.clearErrors();
-    // Check if feild is empty
-    Em.keys(errorMessages).forEach(function (key) {
-      if (!formFields.get('dataset' + key.capitalize())) {
-        errors.set('is' + key.capitalize() + 'Error', true);
-        errorMessages.set(key, Em.I18n.t('mirroring.required.error'));
-      }
-    }, this);
-    // Check that endDate is after startDate
-    var scheduleStartDate = this.get('scheduleStartDate');
-    var scheduleEndDate = this.get('scheduleEndDate');
-    if (scheduleStartDate && scheduleEndDate && (scheduleStartDate > scheduleEndDate)) {
-      errors.set('isEndDateError', true);
-      errorMessages.set('endDate', Em.I18n.t('mirroring.dateOrder.error'));
-    }
-    // Check that startDate is after current date
-    if (scheduleStartDate && !this.get('isEdit') && new Date(App.dateTime()) > scheduleStartDate) {
-      errors.set('isStartDateError', true);
-      errorMessages.set('startDate', Em.I18n.t('mirroring.startDate.error'));
-    }
-    // Check that repeat field value consists only from digits
-    if (isNaN(this.get('formFields.datasetFrequency'))) {
-      errors.set('isFrequencyError', true);
-      errorMessages.set('frequency', Em.I18n.t('mirroring.required.invalidNumberError'));
-    }
-  },
-
-
-  /**
-   * Add '0' for numbers less than 10
-   * @param {Number|String} number
-   * @return {String}
-   */
-  addZero: function (number) {
-    return ('0' + number).slice(-2);
-  },
-
-  /**
-   * Convert date to TZ format
-   * @param {Date} date
-   * @return {String}
-   */
-  toTZFormat: function (date) {
-    return date.toISOString().replace(/\:\d{2}\.\d{3}/,'');
-  },
-
-  /**
-   * Converts hours value from 24-hours format to AM/PM format
-   * @param {Number|String} hours
-   * @return {String}
-   */
-  toAMPMHours: function (hours) {
-    var result = hours % 12;
-    result = result ? result : 12;
-    return this.addZero(result);
-  },
-
-  /**
-   * Save data from dataset form to server
-   */
-  save: function () {
-    this.set('popup.isSaving', true);
-    var datasetXML = this.createDatasetXML();
-    this.sendDatasetToServer(datasetXML);
-  },
-
-  /**
-   * Compose XML-object from populated dataset form fields
-   * @return {String}
-   */
-  createDatasetXML: function () {
-    var datasetNamePrefix = App.get('mirroringDatasetNamePrefix');
-    var datasetName = this.get('formFields.datasetName');
-    var prefixedDatasetName = datasetNamePrefix + datasetName;
-    var sourceCluster = App.get('clusterName');
-    var targetCluster = this.get('formFields.datasetTargetClusterName');
-    var sourceDir = this.get('formFields.datasetSourceDir');
-    var targetDir = this.get('formFields.datasetTargetDir');
-    var datasetFrequency = this.get('formFields.datasetFrequency');
-    var repeatOptionSelected = this.get('formFields.repeatOptionSelected');
-    var startDate = this.get('scheduleStartDate');
-    var endDate = this.get('scheduleEndDate');
-    var scheduleStartDateFormatted = this.toTZFormat(startDate);
-    var scheduleEndDateFormatted = this.toTZFormat(endDate);
-
-    return '<?xml version="1.0"?><feed description="" name="' + prefixedDatasetName + '" xmlns="uri:falcon:feed:0.1"><frequency>' + repeatOptionSelected + '(' + datasetFrequency + ')' +
-        '</frequency><clusters><cluster name="' + sourceCluster + '" type="source"><validity start="' + scheduleStartDateFormatted + '" end="' + scheduleEndDateFormatted +
-        '"/><retention limit="days(7)" action="delete"/></cluster><cluster name="' + targetCluster + '" type="target"><validity start="' + scheduleStartDateFormatted + '" end="' + scheduleEndDateFormatted +
-        '"/><retention limit="months(1)" action="delete"/><locations><location type="data" path="' + targetDir + '" /></locations></cluster></clusters><locations><location type="data" path="' +
-        sourceDir + '" /></locations><ACL owner="hue" group="users" permission="0755" /><schema location="/none" provider="none"/></feed>';
-  },
-
-  /**
-   * Send dataset XML-data to server
-   * @param {String} datasetXML
-   */
-  sendDatasetToServer: function (datasetXML) {
-    var datasetNamePrefix = App.get('mirroringDatasetNamePrefix');
-    var datasetName = this.get('formFields.datasetName');
-    var prefixedDatasetName = datasetNamePrefix + datasetName;
-    return App.ajax.send({
-      name: this.get('isEdit') ? 'mirroring.update_entity' : 'mirroring.create_new_dataset',
-      sender: this,
-      data: {
-        name: prefixedDatasetName,
-        type: 'feed',
-        entity: datasetXML,
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onSaveSuccess',
-      error: 'onSaveError'
-    });
-  },
-
-  /**
-   * Callback for success saving XML-data on server
-   */
-  onSaveSuccess: function () {
-    this.set('popup.isSaving', false);
-    this.get('popup').hide();
-    App.router.get('mainMirroringController').loadData();
-  },
-
-  /**
-   * Callback for error while saving XML-data on server
-   */
-  onSaveError: function (response) {
-    this.set('popup.isSaving', false);
-    if (response && response.responseText) {
-      var errorMessage = /(?:\<message\>)((.|\n)+)(?:\<\/message\>)/.exec(response.responseText);
-      if (errorMessage.length > 1) {
-        App.showAlertPopup(Em.I18n.t('common.error'), Em.I18n.t('mirroring.manageClusters.error') + ': ' + errorMessage[1]);
-      }
-    }
-  },
-
-  /**
-   * Defines if save button should be disabled
-   * @type {Boolean}
-   */
-  saveDisabled: function () {
-    var errors = this.get('errors');
-    return errors.get('isNameError') || errors.get('isSourceDirError') || errors.get('isTargetDirError') || errors.get('isStartDateError') || errors.get('isEndDateError') || errors.get('isFrequencyError') || errors.get('isTargetClusterNameError');
-  }.property('errors.isNameError', 'errors.isSourceDirError', 'errors.isTargetDirError', 'errors.isStartDateError', 'errors.isEndDateError', 'errors.isFrequencyError', 'errors.isTargetClusterNameError')
-});

+ 0 - 201
ambari-web/app/controllers/main/mirroring/jobs_controller.js

@@ -1,201 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.MainDatasetJobsController = Em.Controller.extend({
-  name: 'mainDatasetJobsController',
-
-  suspend: function () {
-    App.ajax.send({
-      name: 'mirroring.suspend_entity',
-      sender: this,
-      data: {
-        name: this.get('content.prefixedName'),
-        type: 'feed',
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onSuspendSuccess',
-      error: 'onError'
-    });
-  },
-
-  onSuspendSuccess: function() {
-    this.set('content.status', 'SUSPENDED');
-    this.get('content.datasetJobs').filterProperty('status', 'RUNNING').setEach('status', 'SUSPENDED');
-  },
-
-  resume: function () {
-    App.ajax.send({
-      name: 'mirroring.resume_entity',
-      sender: this,
-      data: {
-        name: this.get('content.prefixedName'),
-        type: 'feed',
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onResumeSuccess',
-      error: 'onError'
-    });
-  },
-
-  onResumeSuccess: function() {
-    this.set('content.status', 'RUNNING');
-    this.get('content.datasetJobs').filterProperty('status', 'SUSPENDED').setEach('status', 'RUNNING');
-  },
-
-  schedule: function () {
-    App.ajax.send({
-      name: 'mirroring.schedule_entity',
-      sender: this,
-      data: {
-        name: this.get('content.prefixedName'),
-        type: 'feed',
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onScheduleSuccess',
-      error: 'onError'
-    });
-  },
-
-  onScheduleSuccess: function() {
-    this.set('content.status', 'RUNNING');
-  },
-
-
-  delete: function () {
-    var self = this;
-    App.showConfirmationPopup(function () {
-      App.ajax.send({
-        name: 'mirroring.delete_entity',
-        sender: self,
-        data: {
-          name: self.get('content.prefixedName'),
-          type: 'feed',
-          falconServer: App.get('falconServerURL')
-        },
-        success: 'onDeleteSuccess',
-        error: 'onError'
-      });
-    });
-  },
-
-  onDeleteSuccess: function() {
-    var dataset = this.get('content');
-    dataset.deleteRecord();
-    App.store.commit();
-    dataset.get('stateManager').transitionTo('loading');
-    this.set('content', null);
-    App.router.get('mainMirroringController').set('selectedDataset', null);
-    App.router.send('gotoShowJobs');
-  },
-
-  suspendInstance: function (event) {
-    App.ajax.send({
-      name: 'mirroring.suspend_instance',
-      sender: this,
-      data: {
-        feed: this.get('content.prefixedName'),
-        name: event.context.get('name'),
-        job: event.context,
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onSuspendInstanceSuccess',
-      error: 'onError'
-    });
-  },
-
-  onSuspendInstanceSuccess: function () {
-    this.get('content.datasetJobs').filterProperty('name', arguments[2].name).setEach('status', 'SUSPENDED');
-  },
-
-  resumeInstance: function (event) {
-    App.ajax.send({
-      name: 'mirroring.resume_instance',
-      sender: this,
-      data: {
-        feed: this.get('content.prefixedName'),
-        name: event.context.get('name'),
-        job: event.context,
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onResumeInstanceSuccess',
-      error: 'onError'
-    });
-  },
-
-  onResumeInstanceSuccess: function () {
-    this.get('content.datasetJobs').filterProperty('name', arguments[2].name).setEach('status', 'RUNNING');
-  },
-
-  killInstance: function (event) {
-    App.ajax.send({
-      name: 'mirroring.kill_instance',
-      sender: this,
-      data: {
-        feed: this.get('content.prefixedName'),
-        name: event.context.get('name'),
-        job: event.context,
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onKillInstanceSuccess',
-      error: 'onError'
-    });
-  },
-
-  onKillInstanceSuccess: function () {
-    this.get('content.datasetJobs').filterProperty('name', arguments[2].name).setEach('status', 'KILLED');
-  },
-
-  onError: function () {
-    App.showAlertPopup(Em.I18n.t('common.error'), arguments[2]);
-  },
-
-  downloadEntity: function () {
-    var xml = this.formatDatasetXML(this.get('content'));
-    if ($.browser.msie && $.browser.version < 10) {
-      this.openInfoInNewTab(xml);
-    } else {
-      try {
-        var blob = new Blob([xml], {type: 'text/xml;charset=utf-8;'});
-        saveAs(blob, Em.I18n.t('mirroring.dataset.entity') + '.xml');
-      } catch (e) {
-        this.openInfoInNewTab(xml);
-      }
-    }
-  },
-
-  openInfoInNewTab: function (xml) {
-    var newWindow = window.open('');
-    var newDocument = newWindow.document;
-    newDocument.write('<pre>' + xml + '</pre>');
-    newWindow.focus();
-  },
-
-  formatDatasetXML: function (dataset) {
-    return '<?xml version="1.0"?>\n' + '<feed description="" name="' + dataset.get('name') + '" xmlns="uri:falcon:feed:0.1">\n' +
-        '<frequency>' + dataset.get('frequencyUnit') + '(' + dataset.get('frequency') + ')' + '</frequency>\n' +
-        '<clusters>\n<cluster name="' + dataset.get('sourceClusterName') + '" type="source">\n' +
-        '<validity start="' + dataset.get('scheduleStartDate') + '" end="' + dataset.get('scheduleEndDate') + '"/>\n' +
-        '<retention limit="days(7)" action="delete"/>\n</cluster>\n<cluster name="' + dataset.get('targetClusterName') +
-        '" type="target">\n<validity start="' + dataset.get('scheduleStartDate') + '" end="' + dataset.get('scheduleEndDate') + '"/>\n' +
-        '<retention limit="months(1)" action="delete"/>\n<locations>\n<location type="data" path="' + dataset.get('targetDir') + '" />\n' +
-        '</locations>\n</cluster>\n</clusters>\n<locations>\n<location type="data" path="' + dataset.get('sourceDir') + '" />\n' +
-        '</locations>\n<ACL owner="hue" group="users" permission="0755" />\n<schema location="/none" provider="none"/>\n</feed>';
-  }
-});

+ 0 - 176
ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js

@@ -1,176 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.MainMirroringManageClustersController = Em.ArrayController.extend({
-  name: 'mainMirroringManageClustersController',
-
-  // link to popup object
-  popup: null,
-
-  executeTooltip: Em.I18n.t('mirroring.manageClusters.executeTooltip'),
-  readonlyTooltip: Em.I18n.t('mirroring.manageClusters.readonlyTooltip'),
-  workflowTooltip: Em.I18n.t('mirroring.manageClusters.workflowTooltip'),
-  writeTooltip: Em.I18n.t('mirroring.manageClusters.writeTooltip'),
-
-  clusters: [],
-
-  newCluster: null,
-
-  isLoaded: function () {
-    return App.router.get('mainMirroringController.isLoaded');
-  }.property('App.router.mainMirroringController.isLoaded'),
-
-  onLoad: function () {
-    if (this.get('isLoaded')) {
-      var clusters = [];
-      App.TargetCluster.find().forEach(function (cluster) {
-        var newCluster = {
-          name: cluster.get('name'),
-          execute: cluster.get('execute'),
-          workflow: cluster.get('workflow'),
-          write: cluster.get('write'),
-          readonly: cluster.get('readonly'),
-          staging: cluster.get('staging'),
-          working: cluster.get('working'),
-          temp: cluster.get('temp')
-        };
-        // Source cluster should be shown on top
-        if (cluster.get('name') === App.get('clusterName')) {
-          clusters.unshift(Ember.Object.create(newCluster));
-        } else {
-          clusters.push(Ember.Object.create(newCluster));
-        }
-      }, this);
-      this.set('clusters', clusters);
-    }
-  }.observes('isLoaded'),
-
-  selectedCluster: null,
-
-  addCluster: function () {
-    var self = this;
-    var newClusterPopup = App.ModalPopup.show({
-      header: Em.I18n.t('mirroring.manageClusters.create.cluster.popup'),
-      bodyClass: Em.View.extend({
-        controller: self,
-        templateName: require('templates/main/mirroring/create_new_cluster')
-      }),
-      classNames: ['create-target-cluster-popup'],
-      primary: Em.I18n.t('common.save'),
-      secondary: Em.I18n.t('common.cancel'),
-      onPrimary: function () {
-        this.set('disablePrimary', true);
-        self.createNewCluster();
-      },
-      willInsertElement: function () {
-        var clusterName = App.get('clusterName');
-        var newCluster = Ember.Object.create({
-          name: '',
-          execute: '',
-          workflow: '',
-          write: '',
-          readonly: '',
-          staging: '/apps/falcon/<cluster-name>/staging',
-          working: '/apps/falcon/<cluster-name>/working',
-          temp: '/tmp'
-        });
-        self.set('newCluster', newCluster);
-      },
-      didInsertElement: function () {
-        this._super();
-        this.fitHeight();
-      }
-    });
-    this.set('newClusterPopup', newClusterPopup);
-  },
-
-  removeCluster: function () {
-    var self = this;
-    var selectedClusterName = self.get('selectedCluster.name');
-    App.showConfirmationPopup(function () {
-      App.ajax.send({
-        name: 'mirroring.delete_entity',
-        sender: self,
-        data: {
-          name: selectedClusterName,
-          type: 'cluster',
-          falconServer: App.get('falconServerURL')
-        },
-        success: 'onRemoveClusterSuccess',
-        error: 'onError'
-      });
-    }, Em.I18n.t('mirroring.manageClusters.remove.confirmation').format(selectedClusterName));
-  },
-
-  onRemoveClusterSuccess: function () {
-    this.set('clusters', this.get('clusters').without(this.get('selectedCluster')));
-  },
-
-  onError: function (response) {
-    if (response && response.responseText) {
-      var errorMessage = /(?:\<message\>)((.|\n)+)(?:\<\/message\>)/.exec(response.responseText);
-      if (errorMessage.length > 1) {
-        App.showAlertPopup(Em.I18n.t('common.error'), Em.I18n.t('mirroring.manageClusters.error') + ': ' + errorMessage[1]);
-      }
-    }
-  },
-
-  createNewCluster: function () {
-    App.ajax.send({
-      name: 'mirroring.submit_entity',
-      sender: this,
-      data: {
-        type: 'cluster',
-        entity: this.formatClusterXML(this.get('newCluster')),
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onCreateClusterSuccess',
-      error: 'onCreateClusterError'
-    });
-  },
-
-  onCreateClusterSuccess: function () {
-    this.get('clusters').pushObject(this.get('newCluster'));
-    this.get('newClusterPopup').hide();
-  },
-
-  onCreateClusterError: function (response) {
-    this.set('newClusterPopup.disablePrimary', false);
-    this.onError(response);
-  },
-
-  /**
-   * Return XML-formatted string made from cluster object
-   * @param {Object} cluster - object with cluster data
-   * @return {String}
-   */
-  formatClusterXML: function (cluster) {
-    return '<?xml version="1.0"?><cluster colo="local" description="" name="' + cluster.get('name') +
-        '" xmlns="uri:falcon:cluster:0.1"><interfaces><interface type="readonly" endpoint="' + cluster.get('readonly') +
-        '" version="2.2.0" /><interface type="execute" endpoint="' + cluster.get('execute') +
-        '" version="2.2.0" /><interface type="workflow" endpoint="' + cluster.get('workflow') +
-        '" version="4.0.0" />' + '<interface type="messaging" endpoint="tcp://' + App.get('falconServerURL') + ':61616?daemon=true" version="5.1.6" />' +
-        '<interface type="write" endpoint="' + cluster.get('write') + '" version="2.2.0" />' +
-        '</interfaces><locations><location name="staging" path="' + cluster.get('staging') +
-        '" /><location name="temp" path="' + cluster.get('temp') +
-        '" /><location name="working" path="' + cluster.get('working') +
-        '" /></locations></cluster>';
-  }
-});

+ 0 - 377
ambari-web/app/controllers/main/mirroring_controller.js

@@ -1,377 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-var misc = require('utils/misc');
-
-App.MainMirroringController = Em.ArrayController.extend({
-  name: 'mainMirroringController',
-
-  datasetsData: [],
-
-  // formatted data for targetClusterMapper
-  clustersData: {},
-
-  // counter for datasets load queries
-  datasetCount: 0,
-
-  // counter for target cluster load queries
-  clusterCount: 0,
-
-  selectedDataset: null,
-
-  isDatasetsLoaded: false,
-
-  isTargetClustersLoaded: false,
-
-  isRequiredServicesStarted: false,
-
-  isDatasetLoadingError: false,
-
-  actionsDisabled: function () {
-    return !this.get('isRequiredServicesStarted') || this.get('isDatasetLoadingError');
-  }.property('isRequiredServicesStarted', 'isDatasetLoadingError'),
-
-  isLoaded: function () {
-    return this.get('isDatasetsLoaded') && this.get('isTargetClustersLoaded');
-  }.property('isDatasetsLoaded', 'isTargetClustersLoaded'),
-
-  datasets: App.Dataset.find(),
-
-  loadData: function () {
-    var isRequiredServicesStarted = App.Service.find().findProperty('serviceName', 'OOZIE').get('workStatus') == 'STARTED' && App.Service.find().findProperty('serviceName', 'FALCON').get('workStatus') == 'STARTED';
-    this.set('isRequiredServicesStarted', isRequiredServicesStarted);
-    if (isRequiredServicesStarted) {
-      this.set('isDatasetLoadingError', false);
-      this.get('datasetsData').clear();
-      this.set('clustersData', {});
-      this.set('datasetCount', 0);
-      this.set('clusterCount', 0);
-      this.loadDatasets();
-      this.loadClusters();
-    } else {
-      this.set('isDatasetLoadingError', true);
-    }
-  },
-
-  loadDatasets: function () {
-    App.ajax.send({
-      name: 'mirroring.get_all_entities',
-      sender: this,
-      data: {
-        type: 'feed',
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onLoadDatasetsListSuccess',
-      error: 'onLoadDatasetsListError'
-    });
-  },
-
-  onLoadDatasetsListSuccess: function (data) {
-    var parsedData = misc.xmlToObject(data);
-    var datasets = parsedData.entities.entity;
-    if (datasets) {
-      datasets = Em.isArray(datasets) ? datasets : [datasets];
-      datasets = datasets.filter(function (dataset) {
-        return dataset.name['#text'].indexOf(App.mirroringDatasetNamePrefix) === 0;
-      });
-    }
-    if (datasets && datasets.length) {
-      this.set('datasetCount', datasets.length);
-      datasets.forEach(function (dataset) {
-        App.ajax.send({
-          name: 'mirroring.get_definition',
-          sender: this,
-          data: {
-            name: dataset.name['#text'],
-            type: 'feed',
-            status: dataset.status['#text'],
-            falconServer: App.get('falconServerURL')
-          },
-          success: 'onLoadDatasetDefinitionSuccess',
-          error: 'onLoadDatasetDefinitionError'
-        });
-      }, this);
-    } else {
-      this.set('isDatasetsLoaded', true);
-    }
-  },
-
-  onLoadDatasetsListError: function () {
-    this.set('isDatasetLoadingError', true);
-    console.error('Failed to load datasets list.');
-  },
-
-  onLoadDatasetDefinitionSuccess: function (data) {
-    var parsedData = misc.xmlToObject(data);
-    var clusters = parsedData.feed.clusters;
-    var targetCluster, sourceCluster;
-
-    if (clusters.cluster[0].locations) {
-      targetCluster = clusters.cluster[0];
-      sourceCluster = clusters.cluster[1];
-    } else {
-      targetCluster = clusters.cluster[1];
-      sourceCluster = clusters.cluster[0];
-    }
-    var datasetName = parsedData.feed['@attributes'].name.replace(App.mirroringDatasetNamePrefix, '');
-    this.get('datasetsData').push(
-        Ember.Object.create({
-          name: datasetName,
-          status: arguments[2].status,
-          sourceClusterName: sourceCluster['@attributes'].name,
-          targetClusterName: targetCluster['@attributes'].name,
-          sourceDir: parsedData.feed.locations.location['@attributes'].path,
-          targetDir: targetCluster.locations.location['@attributes'].path,
-          frequency: parsedData.feed.frequency['#text'].match(/\d+/)[0],
-          frequencyUnit: parsedData.feed.frequency['#text'].match(/\w+(?=\()/)[0],
-          scheduleEndDate: sourceCluster.validity['@attributes'].end,
-          scheduleStartDate: sourceCluster.validity['@attributes'].start,
-          instances: []
-        })
-    );
-    var currentDate = new Date(App.dateTime());
-    if (currentDate > new Date(sourceCluster.validity['@attributes'].start)) {
-      App.ajax.send({
-        name: 'mirroring.dataset.get_all_instances',
-        sender: this,
-        data: {
-          dataset: parsedData.feed['@attributes'].name,
-          formattedDatasetName: datasetName,
-          start: sourceCluster.validity['@attributes'].start,
-          end: App.router.get('mainMirroringEditDataSetController').toTZFormat(currentDate),
-          falconServer: App.get('falconServerURL')
-        },
-        success: 'onLoadDatasetInstancesSuccess',
-        error: 'onLoadDatasetsInstancesError'
-      });
-    } else {
-      this.saveDataset();
-    }
-  },
-
-  onLoadDatasetDefinitionError: function () {
-    this.set('isDatasetLoadingError', true);
-    console.error('Failed to load dataset definition.');
-  },
-
-  onLoadDatasetInstancesSuccess: function (data, sender, opts) {
-    var datasetsData = this.get('datasetsData');
-    if (data && data.instances) {
-      var datasetJobs = [];
-      data.instances.forEach(function (instance) {
-        if (instance.cluster == App.get('clusterName')) {
-          datasetJobs.push({
-            dataset: opts.formattedDatasetName,
-            id: instance.instance + '_' + opts.dataset,
-            name: instance.instance,
-            status: instance.status,
-            endTime: new Date(instance.endTime).getTime() || 0,
-            startTime: new Date(instance.startTime).getTime() || 0
-          });
-        }
-      }, this);
-      datasetsData.findProperty('name', opts.formattedDatasetName).set('instances', datasetJobs);
-    }
-    this.saveDataset();
-  },
-
-  saveDataset: function () {
-    this.set('datasetCount', this.get('datasetCount') - 1);
-    if (this.get('datasetCount') < 1) {
-      App.dataSetMapper.map(this.get('datasetsData'));
-      this.set('isDatasetsLoaded', true);
-      if (App.router.get('currentState.name') === 'index' && App.router.get('currentState.parentState.name') === 'mirroring') {
-        App.router.send('gotoShowJobs');
-      }
-    }
-  },
-
-  onLoadDatasetsInstancesError: function () {
-    console.error('Failed to load dataset instances.');
-    this.saveDataset();
-  },
-
-  loadClusters: function () {
-    App.ajax.send({
-      name: 'mirroring.get_all_entities',
-      sender: this,
-      data: {
-        type: 'cluster',
-        falconServer: App.get('falconServerURL')
-      },
-      success: 'onLoadClustersListSuccess',
-      error: 'onLoadClustersListError'
-    });
-  },
-
-  onLoadClustersListSuccess: function (data) {
-    var clustersData = this.get('clustersData');
-    clustersData.items = [];
-    var parsedData = misc.xmlToObject(data);
-    var clusters = parsedData.entities.entity;
-    if (data && clusters) {
-      clusters = Em.isArray(clusters) ? clusters : [clusters];
-      this.set('clusterCount', clusters.length);
-      clusters.mapProperty('name.#text').forEach(function (cluster) {
-        App.ajax.send({
-          name: 'mirroring.get_definition',
-          sender: this,
-          data: {
-            name: cluster,
-            type: 'cluster',
-            falconServer: App.get('falconServerURL')
-          },
-          success: 'onLoadClusterDefinitionSuccess',
-          error: 'onLoadClusterDefinitionError'
-        });
-      }, this);
-    } else {
-      this.loadDefaultFS(function (defaultFS) {
-        var clusterName = App.get('clusterName');
-        var sourceCluster = Ember.Object.create({
-          name: clusterName,
-          execute: App.HostComponent.find().findProperty('componentName', 'RESOURCEMANAGER').get('hostName') + ':8050',
-          readonly: 'hftp://' + App.HostComponent.find().findProperty('componentName', 'NAMENODE').get('hostName') + ':50070',
-          workflow: 'http://' + App.HostComponent.find().findProperty('componentName', 'OOZIE_SERVER').get('hostName') + ':11000/oozie',
-          write: defaultFS,
-          staging: '/apps/falcon/' + clusterName + '/staging',
-          working: '/apps/falcon/' + clusterName + '/working',
-          temp: '/tmp'
-        });
-        var sourceClusterData = App.router.get('mainMirroringManageClustersController').formatClusterXML(sourceCluster);
-        App.ajax.send({
-          name: 'mirroring.submit_entity',
-          sender: this,
-          data: {
-            type: 'cluster',
-            entity: sourceClusterData,
-            falconServer: App.get('falconServerURL')
-          },
-          success: 'onSourceClusterCreateSuccess',
-          error: 'onSourceClusterCreateError'
-        });
-        clustersData.items.push(sourceCluster);
-      });
-    }
-  },
-
-  /**
-   * Return fs.defaultFS config property loaded from server
-   * @return {String}
-   */
-  loadDefaultFS: function (callback) {
-    App.ajax.send({
-      name: 'config.tags',
-      sender: this,
-      data: {
-        callback: callback
-      },
-      success: 'onLoadConfigTagsSuccess',
-      error: 'onLoadConfigTagsError'
-    });
-  },
-
-  // Loaded core-site tag version
-  tag: null,
-
-  onLoadConfigTagsSuccess: function (data, opt, params) {
-    this.set('tag', data.Clusters.desired_configs['core-site'].tag);
-    App.router.get('configurationController').getConfigsByTags([
-      {
-        siteName: "core-site",
-        tagName: this.get('tag')
-      }
-    ]).done(function (configs) {
-        params.callback(configs[0].properties['fs.defaultFS']);
-      });
-  },
-
-  onLoadConfigTagsError: function (request, ajaxOptions, error, opt, params) {
-    console.error('Error in loading fs.defaultFS');
-    params.callback(null);
-  },
-
-  onLoadClustersListError: function () {
-    this.set('isDatasetLoadingError', true);
-    console.error('Failed to load clusters list.');
-  },
-
-  onSourceClusterCreateSuccess: function () {
-    App.targetClusterMapper.map(this.get('clustersData'));
-    this.set('isTargetClustersLoaded', true);
-  },
-
-  onSourceClusterCreateError: function () {
-    console.error('Error in creating source cluster entity.');
-  },
-
-  onLoadClusterDefinitionSuccess: function (data) {
-    var parsedData = misc.xmlToObject(data);
-    var clustersData = this.get('clustersData');
-    var interfaces = parsedData.cluster.interfaces.interface;
-    var locations = parsedData.cluster.locations.location;
-    var staging = locations.findProperty('@attributes.name', 'staging');
-    var working = locations.findProperty('@attributes.name', 'working');
-    var temp = locations.findProperty('@attributes.name', 'temp');
-    clustersData.items.push(
-        {
-          name: parsedData.cluster['@attributes'].name,
-          execute: interfaces.findProperty('@attributes.type', 'execute')['@attributes'].endpoint,
-          readonly: interfaces.findProperty('@attributes.type', 'readonly')['@attributes'].endpoint,
-          workflow: interfaces.findProperty('@attributes.type', 'workflow')['@attributes'].endpoint,
-          write: interfaces.findProperty('@attributes.type', 'write')['@attributes'].endpoint,
-          staging: staging && staging['@attributes'].path,
-          working: working && working['@attributes'].path,
-          temp: temp && temp['@attributes'].path
-        }
-    );
-    this.set('clusterCount', this.get('clusterCount') - 1);
-    if (this.get('clusterCount') < 1) {
-      App.targetClusterMapper.map(clustersData);
-      this.set('isTargetClustersLoaded', true);
-    }
-  },
-
-  onLoadClusterDefinitionError: function () {
-    this.set('isDatasetLoadingError', true);
-    console.error('Failed to load cluster definition.');
-  },
-
-  manageClusters: function () {
-    var self = this;
-    App.ModalPopup.show({
-      header: Em.I18n.t('mirroring.dataset.manageClusters'),
-      classNames: ['sixty-percent-width-modal'],
-      bodyClass: App.MainMirroringManageClusterstView.extend({
-        controller: App.router.get('mainMirroringManageClustersController')
-      }),
-      primary: null,
-      secondary: Em.I18n.t('common.close'),
-      hide: function () {
-        self.loadData();
-        App.router.send('gotoShowJobs');
-        this._super();
-      },
-      didInsertElement: function () {
-        this._super();
-        this.fitHeight();
-      }
-    });
-  }
-});

+ 0 - 1
ambari-web/app/mappers.js

@@ -29,7 +29,6 @@ require('mappers/users_mapper');
 require('mappers/service_mapper');
 require('mappers/service_metrics_mapper');
 require('mappers/target_cluster_mapper');
-require('mappers/dataset_mapper');
 require('mappers/component_config_mapper');
 require('mappers/components_state_mapper');
 require('mappers/service_config_version_mapper');

+ 0 - 70
ambari-web/app/mappers/dataset_mapper.js

@@ -1,70 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.dataSetMapper = App.QuickDataMapper.create({
-  model: App.Dataset,
-  Jobs_model: App.DataSetJob,
-  config: {
-    id: 'name',
-    name: 'name',
-    status: 'status',
-    source_cluster_name: 'sourceClusterName',
-    target_cluster_name: 'targetClusterName',
-    source_dir: 'sourceDir',
-    target_dir: 'targetDir',
-    frequency: 'frequency',
-    frequency_unit: 'frequencyUnit',
-    schedule_start_date: 'scheduleStartDate',
-    schedule_end_date: 'scheduleEndDate',
-    dataset_jobs_key: 'instances',
-    dataset_jobs_type: 'array',
-    dataset_jobs: {
-      item: 'id'
-    }
-  },
-  jobs_config: {
-    id: 'id',
-    name: 'name',
-    status : 'status',
-    start_date: 'startTime',
-    end_date: 'endTime',
-    dataset_id: 'dataset'
-  },
-
-  map: function (json) {
-    if (!this.get('model')) {
-      return;
-    }
-    if (json && json.length > 0) {
-      var datasetResults = [];
-      var dataSetJobResults = [];
-      json.forEach(function (item) {
-        item.instances.forEach(function (job) {
-          var newInstance = this.parseIt(job, this.get('jobs_config'));
-          dataSetJobResults.push(newInstance);
-        }, this);
-        var newitem = this.parseIt(item, this.get('config'));
-            datasetResults.push(newitem);
-      }, this);
-      App.store.loadMany(this.get('Jobs_model'), dataSetJobResults);
-      App.store.loadMany(this.get('model'), datasetResults);
-    }
-  }
-});

+ 0 - 117
ambari-web/app/messages.js

@@ -2304,8 +2304,6 @@ Em.I18n.translations = {
   'dashboard.configHistory.info-bar.compare.button.disabled': 'You cannot compare against the same version.',
   'dashboard.configHistory.info-bar.revert.button.disabled': 'This is the current version.',
 
-
-
   'timeRange.presets.1hour':'1h',
   'timeRange.presets.12hour':'12h',
   'timeRange.presets.1day':'1d',
@@ -2321,87 +2319,6 @@ Em.I18n.translations = {
   'tableView.filters.showAll': 'Show All',
   'tableView.filters.filteredConfigVersionInfo': '{0} of {1} versions showing',
 
-  'jobs.type':'Jobs Type',
-  'jobs.type.hive':'Hive',
-  'jobs.show.up.to':'Show up to',
-  'jobs.filtered.jobs':'{0} jobs showing',
-  'jobs.filtered.clear':'clear filters',
-  'jobs.column.id':'Id',
-  'jobs.column.user':'User',
-  'jobs.column.start.time':'Start Time',
-  'jobs.column.end.time':'End Time',
-  'jobs.column.duration':'Duration',
-  'jobs.new_jobs.info':'New jobs available on server.',
-
-  'mirroring.dataset.dataSets':'Datasets',
-  'mirroring.dataset.createDataset':'Create Dataset',
-  'mirroring.dataset.editDataset':'Edit Dataset',
-  'mirroring.dataset.manageClusters':'Manage Clusters',
-  'mirroring.dataset.newDataset':'New Dataset',
-  'mirroring.dataset.selectTargetClusters':'Select Target Cluster...',
-  'mirroring.dataset.name':'Name',
-  'mirroring.dataset.type':'Type',
-  'mirroring.dataset.save': 'Save & Schedule',
-  'mirroring.dataset.sourceDir':'Source Directory',
-  'mirroring.dataset.sourceCluster':'Source Cluster',
-  'mirroring.dataset.target':'Target',
-  'mirroring.dataset.source':'Source',
-  'mirroring.dataset.targetCluster':'Target Cluster',
-  'mirroring.dataset.targetDir':'Target Directory',
-  'mirroring.dataset.schedule':'Schedule',
-  'mirroring.dataset.resume':'Resume',
-  'mirroring.dataset.suspend':'Suspend',
-  'mirroring.dataset.suspendInstance':'Suspend Instance',
-  'mirroring.dataset.resumeInstance':'Resume Instance',
-  'mirroring.dataset.killInstance':'Kill Instance',
-  'mirroring.dataset.schedule.to':'to',
-  'mirroring.dataset.schedule.repeatEvery':'Repeat every ',
-  'mirroring.dataset.addTargetCluster':'Add Target Cluster',
-  'mirroring.dataset.type.HDFS':'HDFS',
-  'mirroring.dataset.repeat.minutes':'minutes',
-  'mirroring.dataset.repeat.hours':'hours',
-  'mirroring.dataset.repeat.days':'days',
-  'mirroring.dataset.repeat.months':'months',
-  'mirroring.dataset.middayPeriod.am':'AM',
-  'mirroring.dataset.middayPeriod.pm':'PM',
-  'mirroring.dataset.entity':'entity',
-  'mirroring.dataset.services.not.started':'Both Falcon and Oozie should be started for correct work',
-  'mirroring.dataset.dataset.loading.error':'Unable to load datasets',
-  'mirroring.dataset.dataset.loading.instances':'Unable to load instances',
-
-  'mirroring.manageClusters.ambariServer':'Ambari Server',
-  'mirroring.manageClusters.interfaces':'Interfaces',
-  'mirroring.manageClusters.locations':'Locations',
-  'mirroring.manageClusters.specifyName':'Specify name for new target cluster:',
-  'mirroring.manageClusters.execute':'Execute',
-  'mirroring.manageClusters.readonly':'Readonly',
-  'mirroring.manageClusters.workflow':'Workflow',
-  'mirroring.manageClusters.write':'Write',
-  'mirroring.manageClusters.staging':'Staging',
-  'mirroring.manageClusters.working':'Working',
-  'mirroring.manageClusters.temp':'Temp',
-  'mirroring.manageClusters.error' :'Error in saving changes',
-  'mirroring.manageClusters.create.cluster.popup' :'Create Target Cluster',
-  'mirroring.manageClusters.remove.confirmation' :'Are you sure you want to delete the target cluster {0}?',
-  'mirroring.manageClusters.executeTooltip' :'The "execute" interface specifies the endpoint for ResourceManager.<br>Example: resourcemanager-host:8050',
-  'mirroring.manageClusters.readonlyTooltip' :'The "readonly" interface specifies the endpoint for Hadoop\'s HFTP protocol.<br>Example: hftp://namenode-host:50070',
-  'mirroring.manageClusters.workflowTooltip' :'The "workflow" interface specifies the endpoint for Oozie URL.<br>Example: http://oozie-host:11000/oozie',
-  'mirroring.manageClusters.writeTooltip' :'The "write" interface is the endpoint to write to HDFS. Set this to the value of fs.defaultFS (in core-site.xml) of the target cluster.<br>Example:<br>hdfs://namenode-host:8020 (non-HA); hdfs://nameservice-id:8020 (HA)',
-  'mirroring.manageClusters.locationsMessage' :'Specify the following for the target cluster, not the source cluster.',
-
-  'mirroring.table.noDatasets':'No datasets to display',
-  'mirroring.table.datasetStatus':'Status',
-  'mirroring.table.noJobs':'No instances to display',
-  'mirroring.table.jobId':'Instance ID',
-  'mirroring.table.start':'Start',
-  'mirroring.table.end':'End',
-  'mirroring.table.status':'Status',
-
-  'mirroring.required.error': 'This field is required',
-  'mirroring.dateOrder.error': 'End Date must be after Start Date',
-  'mirroring.startDate.error': 'Start Date in the past is not allowed',
-  'mirroring.required.invalidNumberError' : 'Enter valid number',
-
   'rollingrestart.dialog.title': 'Restart {0}s',
   'rollingrestart.dialog.primary': 'Trigger Rolling Restart',
   'rollingrestart.notsupported.hostComponent': 'Rolling restart not supported for {0} components',
@@ -2439,8 +2356,6 @@ Em.I18n.translations = {
   'menu.item.dashboard':'Dashboard',
   'menu.item.services':'Services',
   'menu.item.hosts':'Hosts',
-  'menu.item.mirroring':'Mirroring',
-  'menu.item.jobs':'Jobs',
   'menu.item.admin':'Admin',
   'menu.item.alerts': 'Alerts',
   'menu.item.views':'<i class="icon-th"></i>',
@@ -2459,38 +2374,6 @@ Em.I18n.translations = {
   'jobs.customDateFilter.error.date.order':'End Date must be after Start Date',
   'jobs.customDateFilter.startTime':'Start Time',
   'jobs.customDateFilter.endTime':'End Time',
-  'jobs.hive.failed':'JOB FAILED',
-  'jobs.hive.more':'show more',
-  'jobs.hive.less':'show less',
-  'jobs.hive.query':'Hive Query',
-  'jobs.hive.stages':'Stages',
-  'jobs.hive.yarnApplication':'YARN&nbsp;Application',
-  'jobs.hive.tez.tasks':'Tez Tasks',
-  'jobs.hive.tez.hdfs':'HDFS',
-  'jobs.hive.tez.localFiles':'Local Files',
-  'jobs.hive.tez.spilledRecords':'Spilled Records',
-  'jobs.hive.tez.records':'Records',
-  'jobs.hive.tez.reads':'{0} reads',
-  'jobs.hive.tez.writes':'{0} writes',
-  'jobs.hive.tez.records.count':'{0} Records',
-  'jobs.hive.tez.operatorPlan':'Operator Plan',
-  'jobs.hive.tez.dag.summary.metric':'Summary Metric',
-  'jobs.hive.tez.dag.error.noDag.title':'No Tez Information',
-  'jobs.hive.tez.dag.error.noDag.message':'This job does not identify any Tez information.',
-  'jobs.hive.tez.dag.error.noDagId.title':'No Tez Information',
-  'jobs.hive.tez.dag.error.noDagId.message':'No Tez information was found for this job. Either it is waiting to be run, or has exited unexpectedly.',
-  'jobs.hive.tez.dag.error.noDagForId.title':'No Tez Information',
-  'jobs.hive.tez.dag.error.noDagForId.message':'No details were found for the Tez ID given to this job.',
-  'jobs.hive.tez.metric.input':'Input',
-  'jobs.hive.tez.metric.output':'Output',
-  'jobs.hive.tez.metric.recordsRead':'Records Read',
-  'jobs.hive.tez.metric.recordsWrite':'Records Written',
-  'jobs.hive.tez.metric.tezTasks':'Tez Tasks',
-  'jobs.hive.tez.metric.spilledRecords':'Spilled Records',
-  'jobs.hive.tez.edge.':'Unknown',
-  'jobs.hive.tez.edge.contains':'Contains',
-  'jobs.hive.tez.edge.broadcast':'Broadcast',
-  'jobs.hive.tez.edge.scatter_gather':'Shuffle',
 
   'views.main.yourViews': 'Your Views',
   'views.main.noViews': 'No views',

+ 0 - 92
ambari-web/app/models/dataset.js

@@ -1,92 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-var App = require('app');
-
-App.Dataset = DS.Model.extend({
-  name: DS.attr('string'),
-  status: DS.attr('string'),
-  sourceClusterName: DS.attr('string'),
-  targetClusterName: DS.attr('string'),
-  sourceDir: DS.attr('string'),
-  targetDir: DS.attr('string'),
-  frequency: DS.attr('string'),
-  frequencyUnit: DS.attr('string'),
-  scheduleStartDate: DS.attr('string'),
-  scheduleEndDate: DS.attr('string'),
-  datasetJobs: DS.hasMany('App.DataSetJob'),
-
-  // name with special prefix to distinguish feeds created with Ambari
-  prefixedName: function () {
-    return App.mirroringDatasetNamePrefix + this.get('name');
-  }.property('name'),
-
-  statusFormatted: function (){
-    var status = this.get('status');
-    if (status) {
-      return status.toLowerCase().capitalize();
-    }
-  }.property('status'),
-
-  isRunning: function () {
-    return this.get('status') === 'RUNNING';
-  }.property('status'),
-
-  isSuspended: function () {
-    return this.get('status') === 'SUSPENDED';
-  }.property('status'),
-
-  isSubmitted: function () {
-    return this.get('status') === 'SUBMITTED';
-  }.property('status'),
-
-  //Last succeeded date. Will be calculated later.
-  lastSucceededDate: function () {
-    return '';
-  }.property(),
-
-  //Next instance to run. Will be calculated later.
-  nextInstance: function () {
-    return '';
-  }.property(),
-
-  //Class name for dataset health status indicator
-  healthClass: function () {
-    var jobs = this.get('datasetJobs').toArray();
-    jobs = jobs.filterProperty('status', 'FAILED').concat(jobs.filterProperty('status', 'SUCCESSFUL'));
-    jobs = jobs.sortProperty('endDate');
-    return jobs.length && jobs[0].get('status') === 'FAILED' ? 'health-status-DEAD-RED' : 'health-status-LIVE';
-  }.property('datasetJobs', 'datasetJobs.@each.status'),
-
-  healthIconClass: function () {
-    switch (this.get('healthClass')) {
-      case 'health-status-LIVE':
-        return App.healthIconClassGreen;
-        break;
-      case 'health-status-DEAD-RED':
-        return App.healthIconClassRed;
-        break;
-      default:
-        return "";
-        break;
-    }
-  }.property('healthClass')
-});
-
-App.Dataset.FIXTURES = [];

+ 0 - 82
ambari-web/app/models/dataset_job.js

@@ -1,82 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-var App = require('app');
-var date = require('utils/date');
-
-App.DataSetJob = DS.Model.extend({
-  name: DS.attr('string'),
-  dataset: DS.belongsTo('App.Dataset'),
-  status: DS.attr('string'),
-  startDate: DS.attr('number'),
-  endDate: DS.attr('number'),
-
-  statusFormatted: function () {
-    return this.get('status').toLowerCase().capitalize();
-  }.property('status'),
-
-  isSuspended: function () {
-    return this.get('status') === 'SUSPENDED';
-  }.property('status'),
-
-  startFormatted: function () {
-    if (this.get('startDate')) {
-      return $.timeago(this.get('startDate'));
-    }
-    return '';
-  }.property('startDate'),
-
-  endFormatted: function () {
-    if (this.get('endDate')) {
-      return $.timeago(this.get('endDate'));
-    }
-    return '';
-  }.property('endDate'),
-
-  healthClass: function () {
-    var result = 'icon-question-sign';
-    switch (this.get('status')) {
-      case 'SUCCEEDED':
-        result = 'icon-ok';
-        break;
-      case 'SUSPENDED':
-        result = 'icon-cog';
-        break;
-      case 'WAITING':
-        result = 'icon-time';
-        break;
-      case 'RUNNING':
-        result = 'icon-play';
-        break;
-      case 'KILLED':
-        result = 'icon-exclamation-sign';
-        break;
-      case 'FAILED':
-        result = 'icon-warning-sign';
-        break;
-      case 'ERROR':
-        result = 'icon-remove';
-        break;
-    }
-    return result;
-  }.property('status')
-});
-
-
-App.DataSetJob.FIXTURES = [];

+ 0 - 64
ambari-web/app/routes/main.js

@@ -154,70 +154,6 @@ module.exports = Em.Route.extend({
     }
   }),
 
-
-  mirroring: Em.Route.extend({
-    route: '/mirroring',
-    index: Ember.Route.extend({
-      route: '/'
-    }),
-
-    connectOutlets: function (router) {
-      router.get('mainController').connectOutlet('mainMirroring');
-    },
-
-    gotoShowJobs: function (router, context) {
-      var dataset = context || router.get('mainMirroringController.selectedDataset') || App.Dataset.find().objectAt(0);
-      if (dataset) {
-        router.transitionTo('showDatasetJobs', dataset);
-      } else {
-        router.transitionTo('index');
-      }
-    },
-
-    showDatasetJobs: Em.Route.extend({
-      route: '/:dataset_id',
-      connectOutlets: function (router, dataset) {
-        router.get('mainDatasetJobsController').set('content', dataset);
-        router.get('mainMirroringController').set('selectedDataset', dataset);
-      }
-    }),
-
-    editDatasetRoute: Em.Route.extend({
-      route: '/edit/:dataset_id',
-      connectOutlets: function (router, dataset) {
-        router.get('mainMirroringEditDataSetController').showEditPopup(dataset);
-      }
-    }),
-
-    editDataset: function (router, event) {
-      router.transitionTo('editDatasetRoute', event.view.get('dataset'));
-    },
-
-    addNewDataset: function (router) {
-      router.transitionTo('addNewDatasetRoute');
-    },
-
-    addNewDatasetRoute: Em.Route.extend({
-      route: '/dataset/add',
-      enter: function (router) {
-        var controller = router.get('mainMirroringEditDataSetController');
-        controller.showAddPopup();
-      }
-    }),
-
-    manageClustersRoute: Em.Route.extend({
-      route: '/dataset/clusters/edit',
-      enter: function (router) {
-        var controller = router.get('mainMirroringController');
-        controller.manageClusters();
-      }
-    }),
-
-    manageClusters: function (router) {
-      router.transitionTo('manageClustersRoute');
-    }
-  }),
-
   views: require('routes/views'),
 
   hosts: Em.Route.extend({

文件差异内容过多而无法显示
+ 0 - 335
ambari-web/app/styles/application.less


文件差异内容过多而无法显示
+ 0 - 584
ambari-web/app/styles/apps.less


+ 0 - 20
ambari-web/app/templates/main/mirroring.hbs

@@ -1,20 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-
-  {{view App.MainDatasetsView}}

+ 0 - 19
ambari-web/app/templates/main/mirroring/addTargetCluster.hbs

@@ -1,19 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-
-{{outlet}}

+ 0 - 76
ambari-web/app/templates/main/mirroring/create_new_cluster.hbs

@@ -1,76 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-<div class="mirroring-manage-clusters">
-  <form class="form-horizontal">
-    <div class="control-group row-fluid">
-      <div class="control-label-manage-clusters span2">{{t common.name}}</div>
-      <div class="span10">
-        {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.name"}}
-      </div>
-    </div>
-    <div class="control-group form-category">
-      <div class="category-title">{{t mirroring.manageClusters.interfaces}}</div>
-      {{#view App.InputContainer titleBinding="controller.executeTooltip"}}
-        <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.execute}}</div>
-        <div class="span10">
-          {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.execute" placeholder="resourcemanager-host:8050"}}
-        </div>
-      {{/view}}
-      {{#view App.InputContainer titleBinding="controller.readonlyTooltip"}}
-        <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.readonly}}</div>
-        <div class="span10">
-          {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.readonly" placeholder="hftp://namenode-host:50070"}}
-        </div>
-      {{/view}}
-      {{#view App.InputContainer titleBinding="controller.workflowTooltip"}}
-        <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.workflow}}</div>
-        <div class="span10">
-          {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.workflow" placeholder="http://oozie-host:11000/oozie"}}
-        </div>
-      {{/view}}
-      {{#view App.InputContainer titleBinding="controller.writeTooltip"}}
-        <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.write}}</div>
-        <div class="span10">
-          {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.write" placeholder="hdfs://namenode-host:8020"}}
-        </div>
-      {{/view}}
-    </div>
-    <div class="alert alert-info">{{t mirroring.manageClusters.locationsMessage}}</div>
-    <div class="control-group form-category">
-      <div class="category-title">{{t mirroring.manageClusters.locations}}</div>
-      <div class="control-group row-fluid">
-        <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.staging}}</div>
-        <div class="span10">
-          {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.staging"}}
-        </div>
-      </div>
-      <div class="control-group row-fluid">
-        <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.working}}</div>
-        <div class="span10">
-          {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.working"}}
-        </div>
-      </div>
-      <div class="control-group row-fluid">
-        <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.temp}}</div>
-        <div class="span10">
-          {{view Ember.TextField class="input-fluid" valueBinding="controller.newCluster.temp"}}
-        </div>
-      </div>
-    </div>
-  </form>
-</div>

+ 0 - 110
ambari-web/app/templates/main/mirroring/datasets.hbs

@@ -1,110 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-<div id="mirroring">
-  {{#unless controller.isRequiredServicesStarted}}
-    <div class="alert alert-error">{{t mirroring.dataset.services.not.started}}</div>
-  {{/unless}}
-  <div class="row-fluid">
-    <div class="span4">
-      <div>
-        <div class="pull-left">
-          <h4>{{t mirroring.dataset.dataSets}}</h4>
-        </div>
-        {{#isAccessible ADMIN}}
-          <div class="mirroring-top-nav pull-right btn-group">
-            <button {{bindAttr disabled="controller.actionsDisabled"}} class="btn">{{t common.actions}}</button>
-            <button {{bindAttr disabled="controller.actionsDisabled"}} class="btn dropdown-toggle" data-toggle="dropdown">
-              <span class="caret"></span>
-            </button>
-            <ul class="dropdown-menu pull-left">
-              <li>
-                <a href="javascript:void(null);" {{action addNewDataset}}>
-                  <i class="icon-plus"></i>&nbsp;{{t mirroring.dataset.createDataset}}
-                </a>
-              </li>
-              <li>
-                <a {{action manageClusters}} href="javascript:void(null);">
-                  <i class="icon-cog"></i>&nbsp;{{t mirroring.dataset.manageClusters}}...
-                </a>
-              </li>
-            </ul>
-          </div>
-        {{/isAccessible}}
-      </div>
-      <table class="table advanced-header-table table-bordered dataset-thead">
-        <thead>
-          {{#view view.sortView contentBinding="view.filteredContent" class="label-row"}}
-            <th class="first"></th>
-            {{view view.parentView.nameSort}}
-            {{view view.parentView.statusSort}}
-          {{/view}}
-        <tr class="filter-row">
-          <th class="first"></th>
-          <th>{{view view.nameFilterView}}</th>
-          <th>{{view view.statusFilterView}}</th>
-        </tr>
-        </thead>
-      </table>
-      <div class="scrollable-table">
-        <table class="table">
-          <tbody>
-          {{#if controller.isDatasetLoadingError}}
-            <td class="first"></td>
-            <td colspan="2">
-              {{t mirroring.dataset.dataset.loading.error}}
-            </td>
-          {{else}}
-            {{#if controller.isLoaded}}
-              {{#if view.pageContent}}
-                {{#each dataset in view.pageContent}}
-                {{#view view.DatasetView contentBinding="dataset"}}
-                <td class="first">
-                  <span {{bindAttr class="dataset.healthClass dataset.healthIconClass"}}></span>
-                </td>
-                <td class="name">
-                  <a title="{{unbound dataset.name}}" href="javascript:void(null)">{{unbound dataset.name}}</a>
-                </td>
-                <td><span {{bindAttr class="dataset.isRunning:text-info dataset.isSuspended:text-warning"}}>{{dataset.statusFormatted}}</span></td>
-                {{/view}}
-                {{/each}}
-              {{else}}
-                <tr>
-                  <td class="first"></td>
-                  <td colspan="2">
-                    {{t mirroring.table.noDatasets}}
-                  </td>
-                </tr>
-              {{/if}}
-            {{else}}
-              <tr>
-                <td class="first"></td>
-                <td colspan="2">
-                  <div class="spinner"></div>
-                </td>
-              </tr>
-            {{/if}}
-          {{/if}}
-          </tbody>
-        </table>
-      </div>
-    </div>
-    <div class="span8 jobs-container">
-      {{view App.MainDatasetJobsView controllerBinding="App.router.mainDatasetJobsController"}}
-    </div>
-  </div>
-</div>

+ 0 - 134
ambari-web/app/templates/main/mirroring/edit_dataset.hbs

@@ -1,134 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-{{#unless view.isLoaded}}
-  <div class="spinner spinner-centered"></div>
-{{/unless}}
-<div {{bindAttr class=":row-fluid view.isLoaded::content-loading"}}>
-  <form class="form-horizontal">
-    <div class="add-data-set">
-      <table>
-        <tr {{bindAttr class="errors.isNameError:error"}}>
-          <td class="percent25" colspan="1">
-            {{t mirroring.dataset.name}}
-          </td>
-          <td colspan="2" style="text-align: left">
-            {{view Ember.TextField valueBinding="formFields.datasetName" class="span4" disabledBinding="controller.isEdit"}}
-            <span class="help-inline">{{errorMessages.name}}</span>
-          </td>
-        </tr>
-        <tr>
-          <td class="spacer" colspan="3"></td>
-        </tr>
-
-        <tr>
-          <td class="percent25" colspan="1">
-            {{t mirroring.dataset.type}}
-          </td>
-          <td colspan="2" style="text-align: left">
-            {{t mirroring.dataset.type.HDFS}}
-          </td>
-        </tr>
-        <tr>
-          <td class="spacer" colspan="3"></td>
-        </tr>
-
-        <tr>
-          <td class="percent25" colspan="1">
-            {{t mirroring.dataset.sourceCluster}}
-          </td>
-          <td colspan="2" style="text-align: left">
-            {{App.clusterName}}
-          </td>
-        </tr>
-        <tr>
-          <td class="spacer" colspan="3"></td>
-        </tr>
-
-        <tr {{bindAttr class="errors.isSourceDirError:error"}}>
-          <td colspan="1">
-            {{t mirroring.dataset.sourceDir}}
-          </td>
-          <td colspan="2" style="text-align: left">
-            {{view Ember.TextField valueBinding="formFields.datasetSourceDir" class="span4"}}
-            <span class="help-inline">{{errorMessages.sourceDir}}</span>
-          </td>
-        </tr>
-        <tr>
-          <td class="spacer" colspan="3"></td>
-        </tr>
-        <tr {{bindAttr class="errors.isTargetClusterNameError:error"}}>
-          <td colspan="1">
-            {{t mirroring.dataset.targetCluster}}
-          </td>
-          <td colspan="2" style="text-align: left">
-            {{#if view.hasTargetClusters}}
-              {{view view.targetClusterSelect selectionBinding="formFields.datasetTargetClusterName"}}
-            {{else}}
-              <button class="btn" {{action manageClusters target="view"}}>{{t mirroring.dataset.addTargetCluster}}</button>
-            {{/if}}
-            <span class="help-inline">{{errorMessages.targetClusterName}}</span>
-          </td>
-        </tr>
-        <tr>
-          <td class="spacer" colspan="3"></td>
-        </tr>
-        <tr {{bindAttr class="errors.isTargetDirError:error"}}>
-          <td class="spacer" colspan="1">
-            {{t mirroring.dataset.targetDir}}
-          </td>
-          <td colspan="2" style="text-align: left">
-            {{view Ember.TextField valueBinding="formFields.datasetTargetDir" class="span4"}}
-            <span class="help-inline">{{errorMessages.targetDir}}</span>
-          </td>
-        </tr>
-        <tr>
-          <td class="spacer" colspan="3"></td>
-        </tr>
-        <tr>
-          <td colspan="1"> {{t mirroring.dataset.schedule}} </td>
-          <td colspan="2" style="text-align: left">
-            <div {{bindAttr class="errors.isStartDateError:error"}}>
-              {{view Ember.TextField valueBinding="formFields.datasetStartDate" class="input-small datepicker" disabledBinding="controller.isEdit"}}
-              {{view view.select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForStart" class="input-mini" disabledBinding="controller.isEdit"}}
-              {{view view.select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForStart" class="input-mini" disabledBinding="controller.isEdit"}}
-              {{view view.select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForStart" class="input-mini" disabledBinding="controller.isEdit"}}
-              <span class="help-inline">{{errorMessages.startDate}}</span>
-            </div>
-            <div>
-              {{t mirroring.dataset.schedule.to}}
-            </div>
-            <div {{bindAttr class="errors.isEndDateError:error"}}>
-              {{view Ember.TextField valueBinding="formFields.datasetEndDate" class="input-small datepicker"}}
-              {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForEnd" class="input-mini"}}
-              {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForEnd" class="input-mini"}}
-              {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForEnd" class="input-mini"}}
-              <span class="help-inline">{{errorMessages.endDate}}</span>
-            </div>
-
-            <div {{bindAttr class=" :each-row errors.isFrequencyError:error"}}>
-              {{t mirroring.dataset.schedule.repeatEvery}}
-              {{view Ember.TextField valueBinding="formFields.datasetFrequency" class="input-mini"}}
-              {{view Ember.Select contentBinding="view.repeatOptions" selectionBinding="formFields.repeatOptionSelected" class="input-small"}}
-              <span class="help-inline">{{errorMessages.frequency}}</span>
-            </div>
-          </td>
-        </tr>
-      </table>
-    </div>
-  </form>
-</div>

+ 0 - 181
ambari-web/app/templates/main/mirroring/jobs.hbs

@@ -1,181 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-{{#if view.showActions}}
-<div class="dataset-details">
-  <div class="top-left">
-    <h4>{{view.dataset.name}}</h4>
-  </div>
-  <div class="bottom-left">
-    <table>
-      <tr>
-        <td>{{t mirroring.dataset.source}}:</td>
-        <td>{{view.dataset.sourceClusterName}}</td>
-        <td>{{view.dataset.sourceDir}}</td>
-      </tr>
-      <tr>
-        <td>{{t mirroring.dataset.target}}:</td>
-        <td>{{view.dataset.targetClusterName}}</td>
-        <td>{{view.dataset.targetDir}}</td>
-      </tr>
-    </table>
-  </div>
-  {{#isAccessible ADMIN}}
-    <div class="top-right">
-      <div class="btn-group pull-right">
-        <button class="btn">{{t common.actions}}</button>
-        <button class="btn dropdown-toggle" data-toggle="dropdown">
-          <span class="caret"></span>
-        </button>
-        <ul class="dropdown-menu pull-right">
-          {{#if view.dataset.isSuspended}}
-            <li>
-              <a href="javascript:void(null);" {{action resume target="controller"}}>
-                {{t mirroring.dataset.resume}}
-              </a>
-            </li>
-          {{/if}}
-          {{#if view.dataset.isRunning}}
-            <li>
-              <a href="javascript:void(null);" {{action suspend target="controller"}}>
-                {{t mirroring.dataset.suspend}}
-              </a>
-            </li>
-          {{/if}}
-          {{#if view.dataset.isSubmitted}}
-            <li>
-              <a href="javascript:void(null);" {{action schedule target="controller"}}>
-                {{t mirroring.dataset.schedule}}
-              </a>
-            </li>
-          {{/if}}
-          <li>
-            <a {{action editDataset}} href="javascript:void(null);">
-              {{t common.edit}}
-            </a>
-          </li>
-          <li>
-            <a href="javascript:void(null);" {{action delete target="controller"}}>
-              {{t common.delete}}
-            </a>
-          </li>
-        </ul>
-      </div>
-      <span {{bindAttr class=":label view.dataset.isRunning:label-info  view.dataset.isSuspended:label-warning  view.dataset.isSubmitted:label-success :pull-right :dataset-status"}}>
-        {{view.dataset.statusFormatted}}</span>
-    </div>
-  {{/isAccessible}}
-  <div class="bottom-right">{{t common.download}}: <a href="javascript:void(null);" {{action downloadEntity target="controller"}}>{{t mirroring.dataset.entity}}.xml</a></div>
-</div>
-{{/if}}
-<div class="dataset-instances">
-  <table class="table table-bordered table-striped">
-    <thead>
-      {{#view view.sortView contentBinding="view.filteredContent" class="label-row"}}
-        <th class="first"></th>
-        {{view view.parentView.idSort}}
-        {{view view.parentView.startSort}}
-        {{view view.parentView.endSort}}
-        {{view view.parentView.statusSort}}
-      {{/view}}
-    <tr class="filter-row">
-      <th class="first"></th>
-      <th>{{view view.idFilterView}}</th>
-      <th>{{view view.startFilterView}}</th>
-      <th>{{view view.endFilterView}}</th>
-      <th>{{view view.statusFilterView}}</th>
-    </tr>
-    </thead>
-    <tbody>
-    {{#if view.parentView.controller.isDatasetLoadingError}}
-      <td class="first"></td>
-      <td colspan="4">
-        {{t mirroring.dataset.dataset.loading.instances}}
-      </td>
-    {{else}}
-      {{#if view.isLoaded}}
-        {{#if view.pageContent}}
-          {{#each job in view.pageContent}}
-            {{#view view.JobView contentBinding="job"}}
-            <td class="first">
-              <span {{ bindAttr class="job.healthClass"}}></span>
-            </td>
-
-            <td>{{unbound job.name}}</td>
-            <td>{{unbound job.startFormatted}}</td>
-            <td>{{unbound job.endFormatted}}</td>
-            <td>
-              {{#if view.showActions}}
-                <div class="btn-group display-inline-block">
-                  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
-                    {{job.statusFormatted}}
-                    <span class="caret"></span>
-                  </a>
-                  <ul class="dropdown-menu">
-                    {{#if job.isSuspended}}
-                      <li>
-                        <a href="javascript:void(null)" {{action resumeInstance job target="controller"}}>{{t mirroring.dataset.resumeInstance}}</a>
-                      </li>
-                    {{else}}
-                      <li>
-                        <a href="javascript:void(null)" {{action suspendInstance job target="controller"}}>{{t mirroring.dataset.suspendInstance}}</a>
-                      </li>
-                    {{/if}}
-                    <li>
-                      <a href="javascript:void(null)" {{action killInstance job target="controller"}}>{{t mirroring.dataset.killInstance}}</a>
-                    </li>
-                  </ul>
-                </div>
-              {{else}}
-                {{job.statusFormatted}}
-              {{/if}}
-            </td>
-            {{/view}}
-          {{/each}}
-        {{else}}
-          <tr>
-            <td class="first"></td>
-            <td colspan="4">
-              {{t mirroring.table.noJobs}}
-            </td>
-          </tr>
-        {{/if}}
-      {{else}}
-        <tr>
-          <td class="first"></td>
-          <td colspan="4">
-            <div class="spinner"></div>
-          </td>
-        </tr>
-      {{/if}}
-    {{/if}}
-    </tbody>
-  </table>
-  {{#if view.isLoaded}}
-    <div class="page-bar">
-      <div class="items-on-page">
-        <label>{{t common.show}}
-          : {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
-      </div>
-      <div class="info">{{view.paginationInfo}}</div>
-      <div class="paging_two_button">
-        {{view view.paginationLeft}}
-        {{view view.paginationRight}}
-      </div>
-    </div>
-  {{/if}}
-</div>

+ 0 - 83
ambari-web/app/templates/main/mirroring/manage_clusters.hbs

@@ -1,83 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-<div class="mirroring-manage-clusters">
-  {{#unless controller.isLoaded}}
-    <div class="spinner spinner-centered"></div>
-  {{/unless}}
-  <div {{bindAttr class=":row-fluid controller.isLoaded::content-loading"}}>
-    <div class="span4">
-      {{view view.clusterSelect}}
-      <div class="btn-toolbar pull-right">
-        <button class="btn" {{action addCluster target="controller"}}><i class="icon-plus"></i></button>
-        <button class="btn" {{action removeCluster target="controller"}} {{bindAttr disabled="view.removeDisabled"}}><i class="icon-minus"></i></button>
-      </div>
-    </div>
-    <div class="span8 target-cluster-form">
-      <form class="form-horizontal">
-        <div class="control-group form-category">
-          <div class="category-title">{{t mirroring.manageClusters.interfaces}}</div>
-          {{#view App.InputContainer titleBinding="controller.executeTooltip"}}
-            <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.execute}}</div>
-            <div class="span10">
-              {{view Ember.TextField class="input-fluid" valueBinding="controller.selectedCluster.execute" disabled="disabled"}}
-            </div>
-          {{/view}}
-          {{#view App.InputContainer titleBinding="controller.readonlyTooltip"}}
-            <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.readonly}}</div>
-            <div class="span10">
-              {{view Ember.TextField class="input-fluid" valueBinding="controller.selectedCluster.readonly" disabled="disabled"}}
-            </div>
-          {{/view}}
-          {{#view App.InputContainer titleBinding="controller.workflowTooltip"}}
-            <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.workflow}}</div>
-            <div class="span10">
-              {{view Ember.TextField class="input-fluid" valueBinding="controller.selectedCluster.workflow" disabled="disabled"}}
-            </div>
-          {{/view}}
-          {{#view App.InputContainer titleBinding="controller.writeTooltip"}}
-            <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.write}}</div>
-            <div class="span10">
-              {{view Ember.TextField class="input-fluid" valueBinding="controller.selectedCluster.write" disabled="disabled"}}
-            </div>
-          {{/view}}
-        </div>
-        <div class="control-group form-category">
-          <div class="category-title">{{t mirroring.manageClusters.locations}}</div>
-          <div class="control-group row-fluid">
-            <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.staging}}</div>
-            <div class="span10">
-              {{view Ember.TextField class="input-fluid" valueBinding="controller.selectedCluster.staging" disabled="disabled"}}
-            </div>
-          </div>
-          <div class="control-group row-fluid">
-            <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.working}}</div>
-            <div class="span10">
-              {{view Ember.TextField class="input-fluid" valueBinding="controller.selectedCluster.working" disabled="disabled"}}
-            </div>
-          </div>
-          <div class="control-group row-fluid">
-            <div class="control-label-manage-clusters span2">{{t mirroring.manageClusters.temp}}</div>
-            <div class="span10">
-              {{view Ember.TextField class="input-fluid" valueBinding="controller.selectedCluster.temp" disabled="disabled"}}
-            </div>
-          </div>
-        </div>
-      </form>
-    </div>
-  </div>
-</div>

+ 0 - 150
ambari-web/app/utils/ajax/ajax.js

@@ -1776,156 +1776,6 @@ var urls = {
     }
   },
 
-  'mirroring.get_all_entities': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/list/{type}?fields=status&user.name=ambari-qa',
-    'mock': '/data/mirroring/{type}s.xml',
-    'apiPrefix': '',
-    'format': function () {
-      return {
-        dataType: 'xml'
-      }
-    }
-  },
-
-  'mirroring.get_definition': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/definition/{type}/{name}?user.name=ambari-qa',
-    'mock': '/data/mirroring/{name}_definition.xml',
-    'apiPrefix': '',
-    'format': function () {
-      return {
-        cache: true,
-        dataType: 'xml'
-      }
-    }
-  },
-
-  'mirroring.dataset.get_all_instances': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/instance/status/feed/{dataset}?start={start}&end={end}&user.name=ambari-qa',
-    'mock': '/data/mirroring/{dataset}_instances.json',
-    'apiPrefix': ''
-  },
-
-  'mirroring.create_new_dataset': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/submitAndSchedule/feed?user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST',
-    'format': function (data) {
-      return {
-        contentType: 'text/xml',
-        dataType: 'xml',
-        data: data.entity,
-        headers: {
-          'AmbariProxy-Content-Type': 'text/xml'
-        }
-      }
-    }
-  },
-
-  'mirroring.submit_entity': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/submit/{type}?user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST',
-    'format': function (data) {
-      return {
-        contentType: 'text/xml',
-        dataType: 'xml',
-        data: data.entity,
-        headers: {
-          'AmbariProxy-Content-Type': 'text/xml'
-        }
-      }
-    }
-  },
-
-  'mirroring.update_entity': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/update/{type}/{name}?user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST',
-    'format': function (data) {
-      return {
-        contentType: 'text/xml',
-        dataType: 'xml',
-        data: data.entity,
-        headers: {
-          'AmbariProxy-Content-Type': 'text/xml'
-        }
-      }
-    }
-  },
-
-  'mirroring.delete_entity': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/delete/{type}/{name}?user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'DELETE',
-    'format': function () {
-      return {
-        dataType: 'xml'
-      }
-    }
-  },
-
-  'mirroring.suspend_entity': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/suspend/{type}/{name}?user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST',
-    'format': function (data) {
-      return {
-        dataType: 'xml',
-        data: data.entity
-      }
-    }
-  },
-
-  'mirroring.resume_entity': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/resume/{type}/{name}?user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST',
-    'format': function () {
-      return {
-        dataType: 'xml'
-      }
-    }
-  },
-
-  'mirroring.schedule_entity': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/entities/schedule/{type}/{name}?user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST',
-    'format': function () {
-      return {
-        dataType: 'xml'
-      }
-    }
-  },
-
-  'mirroring.suspend_instance': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/instance/suspend/feed/{feed}?start={name}&user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST'
-  },
-
-  'mirroring.resume_instance': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/instance/resume/feed/{feed}?start={name}&user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST'
-  },
-
-  'mirroring.kill_instance': {
-    'real': '/proxy?url=http://{falconServer}:15000/api/instance/kill/feed/{feed}?start={name}&user.name=ambari-qa',
-    'mock': '/data/mirroring/succeeded.json',
-    'apiPrefix': '',
-    'type': 'POST'
-  },
-
   'bulk_request.decommission': {
     'real': '/clusters/{clusterName}/requests',
     'mock': '',

+ 0 - 184
ambari-web/app/utils/graph.js

@@ -1,184 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-module.exports = {
-  durationFormatter:function(d) {
-      if (d==0) { return "0" }
-      var seconds = Math.floor(parseInt(d) / 1000);
-      if ( seconds < 60 )
-        return seconds + "s";
-      var minutes = Math.floor(seconds / 60);
-      if ( minutes < 60 ) {
-        var x = seconds - 60*minutes;
-        return minutes + "m" + (x==0 ? "" : " " + x + "s");
-      }
-      var hours = Math.floor(minutes / 60);
-      if ( hours < 24 ) {
-        var x = minutes - 60*hours;
-        return hours + "h" + (x==0 ? "" : " " + x + "m");
-      }
-      var days = Math.floor(hours / 24);
-      if ( days < 7 ) {
-        var x = hours - 24*days;
-        return days + "d " + (x==0 ? "" : " " + x + "h");
-      }
-      var weeks = Math.floor(days / 7);
-      var x = days - 7*weeks;
-      return weeks + "w " + (x==0 ? "" : " " + x + "d");
-  },
-  bytesFormatter:function(y) {
-    if (y >= 1125899906842624)  { return Math.floor(10 * y / 1125899906842624)/10 + " PB" }
-    else if (y >= 1099511627776){ return Math.floor(10 * y / 1099511627776)/10 + " TB" }
-    else if (y >= 1073741824)   { return Math.floor(10 * y / 1073741824)/10 + " GB" }
-    else if (y >= 1048576)      { return Math.floor(10 * y / 1048576)/10 + " MB" }
-    else if (y >= 1024)         { return Math.floor(10 * y / 1024)/10 + " KB" }
-    else                        { return y + " B"}
-  },
-  addSeries:function(svgg,series,color,xscale,yscale,margin,startTime,dotInfo) {
-    if (series.length==0) return;
-    var self = this;
-    var g = svgg.append("svg:g").selectAll("g")
-      .data(series)
-      .enter().append("svg:g")
-      .attr("transform", "translate(0,"+margin+")");
-    g.append("svg:circle")
-      .attr("r",function(d) {return d.r;})
-      .attr("cx",function(d) {return xscale(d.x);})
-      .attr("cy",function(d) {return yscale(d.y);})
-      .style("fill",color)
-      .style("fill-opacity",0.8)
-      .style("stroke",d3.interpolateRgb(color, 'black')(0.125))
-      .append("title")
-      .text(function(d) { return dotInfo[Math.round(xscale(d.x))][Math.round(yscale(d.y))]; });
-    g.append("svg:line")
-      .attr("x1", function(d) { return xscale(d.x)+d.r; } )
-      .attr("x2", function(d) { return xscale(d.x+d.y); } )
-      .attr("y1", function(d) { return yscale(d.y); } )
-      .attr("y2", function(d) { return yscale(d.y); } )
-      .style("stroke",d3.interpolateRgb(color, 'black')(0.125))
-      .style("stroke-width",2)
-      .append("title")
-      .text(function(d) { return dotInfo[Math.round(xscale(d.x))][Math.round(yscale(d.y))]; });
-  },
-  /**
-   *
-   * @param mapNodeLocal
-   * @param mapRackLocal
-   * @param mapOffSwitch
-   * @param reduceOffSwitch
-   * @param startTime
-   * @param endTime
-   * @param svgw
-   * @param svgh
-   * @param element
-   */
-  drawJobTasks:function (mapNodeLocal, mapRackLocal, mapOffSwitch, reduceOffSwitch, startTime, endTime, svgw, svgh, element) {
-    var rmax = 24; // default value
-    var axisHeight = 24;
-    var margin = {"vertical":10, "horizontal":50};
-    var w = svgw - 2*margin.horizontal;
-    var h = svgh - 2*margin.vertical;
-    var x = d3.time.scale.utc()
-      .domain([startTime, endTime])
-      .range([0, w]);
-    var xrel = d3.time.scale()
-      .domain([0, endTime-startTime])
-      .range([0, w]);
-    // create axes
-    var topAxis = d3.svg.axis()
-      .scale(x)
-      .orient("bottom");
-    var self = this;
-    var bottomAxis = d3.svg.axis()
-      .scale(xrel)
-      .orient("bottom")
-      .tickFormat(function(d) {return self.durationFormatter(d.getTime())});
-
-    var svg = d3.select("div#" + element).append("svg:svg")
-      .attr("width", svgw+"px")
-      .attr("height", svgh+"px");
-    var svgg = svg.append("g")
-      .attr("transform", "translate("+margin.horizontal+","+margin.vertical+")");
-
-    svgg.append("g")
-      .attr("class", "x axis top")
-      .call(topAxis);
-    svgg.append("g")
-      .attr("class", "x axis bottom")
-      .call(bottomAxis)
-      .attr("transform", "translate(0,"+(h-axisHeight)+")");
-
-    var ymax = 0;
-    if (mapNodeLocal.length > 0)
-      ymax = Math.max(ymax, d3.max(mapNodeLocal, function(d) { return d.y; } ));
-    if (mapRackLocal.length > 0)
-      ymax = Math.max(ymax, d3.max(mapRackLocal, function(d) { return d.y; } ));
-    if (mapOffSwitch.length > 0)
-      ymax = Math.max(ymax, d3.max(mapOffSwitch, function(d) { return d.y; } ));
-    if (reduceOffSwitch.length > 0)
-      ymax = Math.max(ymax, d3.max(reduceOffSwitch, function(d) { return d.y; } ));
-
-    var y = d3.scale.linear()
-      .domain([0, ymax])
-      .range([h-2*axisHeight-rmax, 0]);
-
-    var yAxis = d3.svg.axis()
-      .scale(y)
-      .orient("left")
-      .tickFormat(self.durationFormatter);
- 
-    svgg.append("svg:g")
-      .attr("class", "y axis")
-      .call(yAxis)
-      .attr("transform", "translate(0,"+(axisHeight+rmax)+")")
-      .append("text")
-      .attr("transform", "rotate(-90)")
-      .attr("x", -(h-2*axisHeight-rmax)/2)
-      .attr("y", -margin.horizontal + 11)
-      .attr("class", "axislabel")
-      .text("Task Attempt Duration");
-
-
-    var dotInfo = [];
-    var mapDotInfo = function(d) {
-      var thisx = Math.round(x(d.x));
-      var thisy = Math.round(y(d.y));
-      if (!(thisx in dotInfo))
-        dotInfo[thisx] = [];
-      var existing = dotInfo[thisx][thisy];
-      var newInfo = d.label + "  \n" +
-          'Run-time: ' + self.durationFormatter(d.y) + '  \nWait-time: ' + self.durationFormatter(d.x-startTime) +
-          '  \nI/O: ' + self.bytesFormatter(d.io) + '  \nStatus: ' + d.status;
-      if (existing)
-        dotInfo[thisx][thisy] = existing + "  \n" + newInfo;
-      else
-        dotInfo[thisx][thisy] = newInfo;
-    };
-
-    mapNodeLocal.forEach(mapDotInfo);
-    mapRackLocal.forEach(mapDotInfo);
-    mapOffSwitch.forEach(mapDotInfo);
-    reduceOffSwitch.forEach(mapDotInfo);
-
-    this.addSeries(svgg, mapNodeLocal, "green", x, y, axisHeight+rmax, startTime, dotInfo);
-    this.addSeries(svgg, mapRackLocal,'#66B366', x, y, axisHeight+rmax, startTime, dotInfo);
-    this.addSeries(svgg, mapOffSwitch, 'brown', x, y, axisHeight+rmax, startTime, dotInfo);
-    this.addSeries(svgg, reduceOffSwitch, 'steelblue', x, y, axisHeight+rmax, startTime, dotInfo);
-  }
-};

+ 0 - 38
ambari-web/app/utils/misc.js

@@ -64,42 +64,4 @@ module.exports = {
       }
     return sorted;
   },
-
-  /**
-   * Convert XML document to Object
-   * @param xml
-   * @return {Object}
-   */
-  xmlToObject: function (xml) {
-    var obj = {};
-    if (xml.nodeType == 1) {
-      if (xml.attributes.length > 0) {
-        obj["@attributes"] = {};
-        for (var j = 0; j < xml.attributes.length; j++) {
-          var attribute = xml.attributes.item(j);
-          obj["@attributes"][attribute.nodeName] = attribute.nodeValue;
-        }
-      }
-    } else if (xml.nodeType == 3) {
-      obj = xml.nodeValue;
-    }
-    if (xml.hasChildNodes()) {
-      for (var i = 0; i < xml.childNodes.length; i++) {
-        var item = xml.childNodes.item(i);
-        var nodeName = item.nodeName;
-        if (typeof (obj[nodeName]) == "undefined") {
-          obj[nodeName] = this.xmlToObject(item);
-        } else {
-          if (typeof (obj[nodeName].push) == "undefined") {
-            var old = obj[nodeName];
-            obj[nodeName] = [];
-            obj[nodeName].push(old);
-          }
-          obj[nodeName].push(this.xmlToObject(item));
-        }
-      }
-    }
-    return obj;
-  }
-
 };

+ 0 - 131
ambari-web/app/views/main/mirroring/datasets_view.js

@@ -1,131 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-var filters = require('views/common/filter_view');
-var sort = require('views/common/sort_view');
-
-App.MainDatasetsView = App.TableView.extend({
-  name: 'mainDatasetsView',
-  templateName: require('templates/main/mirroring/datasets'),
-  pagination: false,
-  content: function () {
-    return this.get('controller.datasets');
-  }.property('controller.datasets.length'),
-
-  didInsertElement: function () {
-    this.filter();
-  },
-
-  sortView: sort.wrapperView,
-  nameSort: sort.fieldView.extend({
-    column: '1',
-    name: 'name',
-    displayName: Em.I18n.t('common.name')
-  }),
-
-  statusSort: sort.fieldView.extend({
-    column: '2',
-    name: 'status',
-    displayName: Em.I18n.t('mirroring.table.datasetStatus')
-  }),
-
-  /**
-   * Filter view for name column
-   * Based on <code>filters</code> library
-   */
-  nameFilterView: filters.createTextView({
-    fieldType: 'input-small',
-    column: 1,
-    onChangeValue: function () {
-      this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
-    }
-  }),
-
-  statusFilterView: filters.createSelectView({
-    fieldType: 'input-small',
-    column: 2,
-    content: [
-      {
-        value: '',
-        label: Em.I18n.t('any')
-      },
-      {
-        value: 'Scheduled',
-        label: 'Scheduled'
-      },
-      {
-        value: 'Suspended',
-        label: 'Suspended'
-      },
-      {
-        value: 'Running',
-        label: 'Running'
-      }
-    ],
-    onChangeValue: function () {
-      this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
-    }
-  }),
-
-  DatasetView: Em.View.extend({
-    content: null,
-    tagName: 'tr',
-
-    click: function () {
-      App.router.send('gotoShowJobs', this.get('content'));
-    },
-
-    classNameBindings: ['selectedClass', ':dataset-item'],
-
-    selectedClass: function () {
-      return this.get('controller.selectedDataset.id') === this.get('content.id') ? 'dataset-selected' : '';
-    }.property('controller.selectedDataset'),
-
-    lastDurationFormatted: function () {
-      var milliseconds = this.get('content.lastDuration');
-      var h = Math.floor(milliseconds / 3600000);
-      var m = Math.floor((milliseconds % 3600000) / 60000);
-      var s = Math.floor(((milliseconds % 360000) % 60000) / 1000);
-      return (h == 0 ? '' : h + 'hr ') + (m == 0 ? '' : m + 'mins ') + (s == 0 ? '' : s + 'secs ');
-    }.property('content.lastDuration'),
-
-    lastSucceededDateFormatted: function () {
-      if (this.get('content.lastSucceededDate')) {
-        return $.timeago(this.get('content.lastSucceededDate'));
-      }
-    }.property('content.lastSucceededDate'),
-
-    lastFailedDateFormatted: function () {
-      if (this.get('content.lastFailedDate')) {
-        return $.timeago(this.get('content.lastFailedDate'));
-      }
-    }.property('content.lastFailedDate')
-  }),
-
-  /**
-   * associations between dataset property and column index
-   */
-  colPropAssoc: function () {
-    var associations = [];
-    associations[1] = 'name';
-    associations[2] = 'status';
-    return associations;
-  }.property()
-
-});

+ 0 - 141
ambari-web/app/views/main/mirroring/edit_dataset_view.js

@@ -1,141 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.MainMirroringEditDataSetView = Em.View.extend({
-
-  name: 'mainMirroringEditDataSetView',
-
-  templateName: require('templates/main/mirroring/edit_dataset'),
-
-  /**
-   * Defines if there are some target clusters defined
-   * @type {Boolean}
-   */
-  hasTargetClusters: false,
-
-  targetClusters: App.TargetCluster.find(),
-
-  targetClusterSelect: Em.Select.extend({
-    classNames: ['target-cluster-select'],
-
-    content: function () {
-      if (!this.get('parentView.isLoaded')) return [];
-      return this.get('parentView.targetClusters').mapProperty('name').without(App.get('clusterName')).concat(Em.I18n.t('mirroring.dataset.addTargetCluster'));
-    }.property('parentView.isLoaded', 'parentView.targetClusters.length'),
-
-    change: function () {
-      if (this.get('selection') === Em.I18n.t('mirroring.dataset.addTargetCluster')) {
-        this.set('selection', this.get('content')[0]);
-        this.get('parentView').manageClusters();
-      }
-      this.set('parentView.controller.formFields.datasetTargetClusterName', this.get('selection'))
-    }
-  }),
-
-  /**
-   * Set <code>hasTargetClusters</code> after clustes load
-   */
-  onTargetClustersChange: function () {
-    if (this.get('isLoaded') && this.get('targetClusters.length') > 1) {
-      this.set('hasTargetClusters', true);
-    } else {
-      this.set('hasTargetClusters', false);
-      this.set('controller.formFields.datasetTargetClusterName', null);
-    }
-  }.observes('isLoaded', 'targetClusters.length'),
-
-  repeatOptions: [Em.I18n.t('mirroring.dataset.repeat.minutes'), Em.I18n.t('mirroring.dataset.repeat.hours'), Em.I18n.t('mirroring.dataset.repeat.days'), Em.I18n.t('mirroring.dataset.repeat.months')],
-
-  middayPeriodOptions: [Em.I18n.t('mirroring.dataset.middayPeriod.am'), Em.I18n.t('mirroring.dataset.middayPeriod.pm')],
-
-  hourOptions: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
-
-  minuteOptions: ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55'],
-
-  isLoaded: function () {
-    return App.router.get('mainMirroringController.isLoaded');
-  }.property('App.router.mainMirroringController.isLoaded'),
-
-  manageClusters: function () {
-    App.router.get('mainMirroringController').manageClusters();
-  },
-
-  /**
-   * Fill form input fields for selected dataset to edit
-   */
-  fillForm: function () {
-    var isEdit = this.get('controller.isEdit');
-    if (this.get('isLoaded') && isEdit) {
-      var controller = this.get('controller');
-      var dataset = App.Dataset.find().findProperty('id', controller.get('datasetIdToEdit'));
-      var scheduleStartDate = new Date(dataset.get('scheduleStartDate'));
-      var scheduleEndDate = new Date(dataset.get('scheduleEndDate'));
-      var formFields = controller.get('formFields');
-      formFields.set('datasetName', dataset.get('name'));
-      formFields.set('datasetSourceDir', dataset.get('sourceDir'));
-      formFields.set('datasetTargetDir', dataset.get('targetDir'));
-      formFields.set('datasetTargetClusterName', dataset.get('targetClusterName'));
-      formFields.set('datasetFrequency', dataset.get('frequency'));
-      formFields.set('repeatOptionSelected', dataset.get('frequencyUnit'));
-      formFields.set('datasetStartDate', controller.addZero(scheduleStartDate.getMonth() + 1) + '/' + controller.addZero(scheduleStartDate.getDate()) + '/' + controller.addZero(scheduleStartDate.getFullYear()));
-      formFields.set('datasetEndDate', controller.addZero(scheduleEndDate.getMonth() + 1) + '/' + controller.addZero(scheduleEndDate.getDate()) + '/' + controller.addZero(scheduleEndDate.getFullYear()));
-      var startHours = scheduleStartDate.getHours();
-      var endHours = scheduleEndDate.getHours();
-      formFields.set('hoursForStart', controller.toAMPMHours(startHours));
-      formFields.set('hoursForEnd', controller.toAMPMHours(endHours));
-      formFields.set('minutesForStart', controller.addZero(scheduleStartDate.getMinutes()));
-      formFields.set('minutesForEnd', controller.addZero(scheduleEndDate.getMinutes()));
-      formFields.set('middayPeriodForStart', startHours > 11 ? 'PM' : 'AM');
-      formFields.set('middayPeriodForEnd', endHours > 11 ? 'PM' : 'AM');
-    }
-  }.observes('isLoaded', 'App.router.mainMirroringController.selectedDataset', 'controller.isEdit'),
-
-  select: Em.Select.extend({
-    attributeBindings: ['disabled']
-  }),
-
-  didInsertElement: function () {
-    // Initialize datepicker
-    $('.datepicker').datepicker({
-      format: 'mm/dd/yyyy'
-    }).on('changeDate', function (ev) {
-          $(this).datepicker('hide');
-        });
-
-    // Set default value for Repeat every combo box
-    this.set('controller.formFields.repeatOptionSelected', this.get('repeatOptions')[2]);
-
-    this.fillForm();
-    this.onTargetClustersChange();
-  },
-
-  willDestroyElement: function () {
-    var controller = this.get('controller');
-    Em.keys(this.get('controller.formFields')).forEach(function (key) {
-      controller.removeObserver('formFields.' + key, controller, 'validate');
-    }, this);
-    this._super();
-  },
-
-  init: function () {
-    this.get('controller').clearStep();
-    this._super();
-  }
-});

+ 0 - 220
ambari-web/app/views/main/mirroring/jobs_view.js

@@ -1,220 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-var filters = require('views/common/filter_view');
-var sort = require('views/common/sort_view');
-
-App.MainDatasetJobsView = App.TableView.extend({
-  templateName: require('templates/main/mirroring/jobs'),
-
-  isLoaded: function () {
-    return App.router.get('mainMirroringController.isLoaded');
-  }.property('App.router.mainMirroringController.isLoaded'),
-
-  content: function () {
-    var datasetName = this.get('controller.content.name');
-    return (this.get('isLoaded') && datasetName) ?
-        App.Dataset.find().findProperty('name', datasetName).get('datasetJobs') : [];
-  }.property('controller.content', 'isLoaded'),
-
-  dataset: function () {
-    return this.get('controller.content');
-  }.property('controller.content'),
-
-  showActions: function () {
-    return this.get('isLoaded') && this.get('dataset.status') && !this.get('parentView.controller.isDatasetLoadingError');
-  }.property('isLoaded', 'dataset.status', 'parentView.controller.isDatasetLoadingError'),
-
-  sortView: sort.wrapperView.extend({
-    loadSortStatuses: function(){
-      this._super();
-      var statuses = App.db.getSortingStatuses(this.get('controller.name'));
-      if (!statuses || statuses.everyProperty('status', 'sorting')) {
-        var sorting = this.get('childViews').findProperty('name', 'startDate');
-        this.sort(sorting, true);
-        sorting.set('status', 'sorting_desc');
-      }
-    }.observes('parentView.filteringComplete')
-  }),
-  idSort: sort.fieldView.extend({
-    column: 1,
-    name: 'name',
-    displayName: Em.I18n.t('mirroring.table.jobId'),
-    type: 'string'
-  }),
-  startSort: sort.fieldView.extend({
-    column: 2,
-    name: 'startDate',
-    displayName: Em.I18n.t('mirroring.table.start'),
-    type: 'number'
-  }),
-  endSort: sort.fieldView.extend({
-    column: 3,
-    name: 'endDate',
-    displayName: Em.I18n.t('mirroring.table.end'),
-    type: 'number'
-  }),
-  statusSort: sort.fieldView.extend({
-    column: 4,
-    name: 'statusFormatted',
-    displayName: Em.I18n.t('mirroring.table.status'),
-    type: 'string'
-  }),
-
-  /**
-   * Filter view for name column
-   * Based on <code>filters</code> library
-   */
-  idFilterView: filters.createTextView({
-    fieldType: 'input-small',
-    column: 1,
-    onChangeValue: function () {
-      this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
-    }
-  }),
-
-  startFilterView: filters.createSelectView({
-    fieldType: 'input-small',
-    column: 2,
-    content: [
-      {
-        value: 'Any',
-        label: Em.I18n.t('any')
-      },
-      {
-        value: 'Past 1 Day',
-        label: 'Past 1 Day'
-      },
-      {
-        value: 'Past 2 Days',
-        label: 'Past 2 Days'
-      },
-      {
-        value: 'Past 7 Days',
-        label: 'Past 7 Days'
-      },
-      {
-        value: 'Past 14 Days',
-        label: 'Past 14 Days'
-      },
-      {
-        value: 'Past 30 Days',
-        label: 'Past 30 Days'
-      }
-    ],
-    emptyValue: 'Any',
-    onChangeValue: function () {
-      this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'date');
-    }
-  }),
-
-  endFilterView: filters.createSelectView({
-    fieldType: 'input-small',
-    column: 3,
-    content: [
-      {
-        value: 'Any',
-        label: Em.I18n.t('any')
-      },
-      {
-        value: 'Past 1 Day',
-        label: 'Past 1 Day'
-      },
-      {
-        value: 'Past 2 Days',
-        label: 'Past 2 Days'
-      },
-      {
-        value: 'Past 7 Days',
-        label: 'Past 7 Days'
-      },
-      {
-        value: 'Past 14 Days',
-        label: 'Past 14 Days'
-      },
-      {
-        value: 'Past 30 Days',
-        label: 'Past 30 Days'
-      }
-    ],
-    emptyValue: 'Any',
-    onChangeValue: function () {
-      this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'date');
-    }
-  }),
-
-  statusFilterView: filters.createSelectView({
-    fieldType: 'input-small',
-    column: 4,
-    content: [
-      {
-        value: '',
-        label: Em.I18n.t('any')
-      },
-      {
-        value: 'Waiting',
-        label: 'Waiting'
-      },
-      {
-        value: 'Running',
-        label: 'Running'
-      },
-      {
-        value: 'Suspended',
-        label: 'Suspended'
-      },
-      {
-        value: 'Killed',
-        label: 'Killed'
-      },
-      {
-        value: 'Succeeded',
-        label: 'Succeeded'
-      },
-      {
-        value: 'Error',
-        label: 'Error'
-      }
-    ],
-    onChangeValue: function () {
-      this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
-    }
-  }),
-
-  JobView: Em.View.extend({
-    content: null,
-    tagName: 'tr',
-
-    showActions: function () {
-      return ['RUNNING', 'SUSPENDED'].contains(this.get('content.status')) && App.isAccessible('ADMIN');
-    }.property('content.status')
-  }),
-
-  /**
-   * associations between dataset property and column index
-   */
-  colPropAssoc: function () {
-    var associations = [];
-    associations[1] = 'name';
-    associations[2] = 'startDate';
-    associations[3] = 'endDate';
-    associations[4] = 'statusFormatted';
-    return associations;
-  }.property()
-});

+ 0 - 78
ambari-web/app/views/main/mirroring/manage_clusters_view.js

@@ -1,78 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.MainMirroringManageClusterstView = Em.View.extend({
-  name: 'mainMirroringManageClustersView',
-  templateName: require('templates/main/mirroring/manage_clusters'),
-
-  clusterSelect: Ember.Select.extend({
-    classNames: ['cluster-select'],
-    multiple: true,
-    content: function () {
-      return this.get('controller.clusters');
-    }.property('controller.clusters.@each'),
-
-    optionLabelPath: 'content.name',
-
-    onSelect: function () {
-      if (this.get('selection.length')) {
-        if (this.get('selection').length === 1) {
-          this.set('controller.selectedCluster', this.get('selection')[0]);
-        } else {
-          this.set('selection', [this.get('controller.selectedCluster')]);
-        }
-      } else {
-        this.set('selection', [this.get('content')[0]]);
-      }
-    }.observes('selection'),
-
-    // set selected option in Cluster Select after adding or removing an option
-    onContentChange: function () {
-      if (this.get('controller.isLoaded')) {
-        var content = this.get('content');
-        if (content.length < this.get('element.options.length')) {
-          this.set('selection', [content[0]]);
-        } else {
-          this.set('selection', [content[content.length - 1]]);
-        }
-      }
-    }.observes('content.length', 'controller.isLoaded')
-  }),
-
-  removeDisabled: function () {
-    var selectedCluster = this.get('controller.selectedCluster');
-    return !selectedCluster || selectedCluster.get('name') === App.get('clusterName');
-  }.property('controller.selectedCluster', 'App.clusterName'),
-
-  didInsertElement: function () {
-    this.get('controller').onLoad();
-  }
-});
-
-App.InputContainer = Em.View.extend({
-  tagName: 'div',
-  classNames: ['control-group', 'row-fluid'],
-  attributeBindings: ['title'],
-  didInsertElement: function () {
-    $(this.get('element')).tooltip({placement: 'right'});
-  }
-});
-
-

+ 0 - 42
ambari-web/app/views/main/mirroring_view.js

@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.MainMirroringView = Em.View.extend({
-
-  templateName: require('templates/main/mirroring'),
-
-  didInsertElement: function () {
-    var controller = this.get('controller');
-    controller.set('isDatasetsLoaded', false);
-    controller.set('isTargetClustersLoaded', false);
-    this.loadDataPeriodically();
-  },
-
-  // updata datasets data, when Mirroring page is opened
-  loadDataPeriodically: function () {
-    if (this.get('isVisible')) {
-      var self = this;
-      this.get('controller').loadData();
-      setTimeout(function () {
-        self.loadDataPeriodically();
-      }, App.contentUpdateInterval);
-    }
-  }
-});

+ 0 - 416
ambari-web/test/controllers/main/mirroring/edit_dataset_controller_test.js

@@ -1,416 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-require('controllers/main/mirroring/edit_dataset_controller');
-require('models/target_cluster');
-require('views/main/mirroring/edit_dataset_view');
-
-describe('App.MainMirroringEditDataSetController', function () {
-
-  describe('#clearStep', function () {
-    it('should clear all fields, error flags and messages', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      var errors = mainMirroringEditDataSetController.get('errors');
-      var errorMessages = mainMirroringEditDataSetController.get('errorMessages');
-      var formFeilds = mainMirroringEditDataSetController.get('formFields');
-      formFeilds.set('datasetName', 'test');
-      sinon.spy(mainMirroringEditDataSetController, 'clearErrors');
-      mainMirroringEditDataSetController.clearStep();
-      expect(mainMirroringEditDataSetController.clearErrors.calledOnce).to.be.true;
-      Em.keys(formFeilds).forEach(function (field) {
-        expect(formFeilds[field]).to.be.null;
-      });
-      mainMirroringEditDataSetController.clearErrors.restore();
-    });
-  });
-
-  describe('#clearErrors', function () {
-    it('should clear all error messages and flags', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      var errors = mainMirroringEditDataSetController.get('errors');
-      var errorMessages = mainMirroringEditDataSetController.get('errorMessages');
-      Em.keys(errors).forEach(function (error) {
-        errors[error] = true;
-      }, this);
-      Em.keys(errorMessages).forEach(function (errorMessage) {
-        errorMessages[errorMessage] = 'test';
-      }, this);
-      mainMirroringEditDataSetController.clearErrors();
-      Em.keys(errors).forEach(function (error) {
-        expect(errors[error]).to.be.false;
-      });
-      Em.keys(errorMessages).forEach(function (errorMessage) {
-        expect(errorMessages[errorMessage]).to.be.empty;
-      });
-    });
-  });
-
-  describe('#showAddPopup', function () {
-    it('should show popup and set isEdit as false', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      sinon.spy(App.ModalPopup, 'show');
-      mainMirroringEditDataSetController.showAddPopup();
-      expect(App.ModalPopup.show.calledOnce).to.be.true;
-      expect(mainMirroringEditDataSetController.get('isEdit')).to.be.false;
-      App.ModalPopup.show.restore();
-    });
-  });
-
-  describe('#showEditPopup', function () {
-    it('should show popup,set isEdit as true and set dataset id', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      var dataset = Ember.Object.create({
-        id: 'test'
-      });
-      sinon.spy(App.ModalPopup, 'show');
-      mainMirroringEditDataSetController.showEditPopup(dataset);
-      expect(App.ModalPopup.show.calledOnce).to.equal(true);
-      expect(mainMirroringEditDataSetController.get('isEdit')).to.be.true;
-      expect(mainMirroringEditDataSetController.get('datasetIdToEdit')).to.equal('test');
-      App.ModalPopup.show.restore();
-    });
-  });
-
-  describe('#showPopup', function () {
-    it('should show dataset popup and save its view', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      sinon.spy(App.ModalPopup, 'show');
-      mainMirroringEditDataSetController.showPopup();
-      expect(App.ModalPopup.show.calledOnce).to.equal(true);
-      expect(mainMirroringEditDataSetController.get('popup')).to.not.be.empty;
-      App.ModalPopup.show.restore();
-    });
-  });
-
-  describe('#applyValidation', function () {
-    it('should add observers to all fields to validate form', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      sinon.spy(mainMirroringEditDataSetController, 'validate');
-      mainMirroringEditDataSetController.applyValidation();
-      expect(mainMirroringEditDataSetController.validate.calledOnce).to.be.true;
-      Em.keys(mainMirroringEditDataSetController.get('formFields')).forEach(function (field) {
-        expect(mainMirroringEditDataSetController.hasObserverFor('formFields.' + field)).to.be.true;
-      });
-      mainMirroringEditDataSetController.validate.restore();
-    });
-  });
-
-  var testCases = [
-    {
-      day: '01/01/2001',
-      hours: '00',
-      minutes: '00',
-      middayPeriod: 'AM',
-      result: new Date('01/01/2001 00:00 AM'),
-      message: 'should return date object'
-    },
-    {
-      day: '06/05/2014',
-      hours: '12',
-      minutes: '59',
-      middayPeriod: 'PM',
-      result: new Date('06/05/2014 12:59 PM'),
-      message: 'should return date object'
-    },
-    {
-      day: '',
-      hours: '00',
-      minutes: '00',
-      middayPeriod: 'AM',
-      result: null,
-      message: 'should return null if there are empty fields'
-    }
-  ];
-
-  describe('#scheduleStartDate', function () {
-    testCases.forEach(function (test) {
-      it(test.message, function () {
-        var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-          formFields: Ember.Object.create({
-            datasetStartDate: test.day,
-            hoursForStart: test.hours,
-            minutesForStart: test.minutes,
-            middayPeriodForStart: test.middayPeriod
-          })
-        });
-        expect(mainMirroringEditDataSetController.get('scheduleStartDate')).to.deep.equal(test.result);
-      });
-    });
-  });
-
-  describe('#scheduleEndDate', function () {
-    testCases.forEach(function (test) {
-      it(test.message, function () {
-        var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-          formFields: Ember.Object.create({
-            datasetEndDate: test.day,
-            hoursForEnd: test.hours,
-            minutesForEnd: test.minutes,
-            middayPeriodForEnd: test.middayPeriod
-          })
-        });
-        expect(mainMirroringEditDataSetController.get('scheduleEndDate')).to.deep.equal(test.result);
-      });
-    });
-  });
-
-  var formFields = Ember.Object.create({
-    datasetName: 'test',
-    datasetTargetClusterName: 'test',
-    datasetSourceDir: '/test',
-    datasetTargetDir: '/test',
-    datasetStartDate: '01/19/2038',
-    hoursForStart: '03',
-    minutesForStart: '15',
-    middayPeriodForStart: 'AM',
-    datasetEndDate: '01/19/2039',
-    hoursForEnd: '03',
-    minutesForEnd: '15',
-    middayPeriodForEnd: 'AM',
-    datasetFrequency: '1',
-    repeatOptionSelected: 'days'
-  })
-
-  describe('#validate', function () {
-    it('should set an error for empty fields', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      mainMirroringEditDataSetController.validate();
-      var errors = mainMirroringEditDataSetController.get('errors');
-      var errorMessages = mainMirroringEditDataSetController.get('errorMessages');
-      Em.keys(errors).forEach(function (error) {
-        expect(errors[error]).to.be.true;
-      });
-      Em.keys(errorMessages).forEach(function (errorMessage) {
-        expect(errorMessages[errorMessage]).to.equal(Em.I18n.t('mirroring.required.error'));
-      });
-    });
-    it('should set an error if start date is after end date', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      var formFields = mainMirroringEditDataSetController.get('formFields');
-      formFields.set('datasetStartDate', '04/07/2014');
-      formFields.set('hoursForStart', '11');
-      formFields.set('minutesForStart', '00');
-      formFields.set('middayPeriodForStart', 'PM');
-      formFields.set('datasetEndDate', '04/07/2014');
-      formFields.set('hoursForEnd', '11');
-      formFields.set('minutesForEnd', '00');
-      formFields.set('middayPeriodForEnd', 'AM');
-      mainMirroringEditDataSetController.validate();
-      expect(mainMirroringEditDataSetController.get('errors.isEndDateError')).to.be.true;
-      expect(mainMirroringEditDataSetController.get('errorMessages.endDate')).to.equal(Em.I18n.t('mirroring.dateOrder.error'));
-    });
-    it('should set an error if start date is in the past', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      var formFields = mainMirroringEditDataSetController.get('formFields');
-      formFields.set('datasetStartDate', '04/07/2014');
-      formFields.set('hoursForStart', '11');
-      formFields.set('minutesForStart', '00');
-      formFields.set('middayPeriodForStart', 'AM');
-      mainMirroringEditDataSetController.validate();
-      expect(mainMirroringEditDataSetController.get('errors.isStartDateError')).to.be.true;
-      expect(mainMirroringEditDataSetController.get('errorMessages.startDate')).to.equal(Em.I18n.t('mirroring.startDate.error'));
-    });
-    it('should set an error if repeat field value consist not only form digits', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      var formFields = mainMirroringEditDataSetController.get('formFields');
-      formFields.set('datasetFrequency', 'test');
-      mainMirroringEditDataSetController.validate();
-      expect(mainMirroringEditDataSetController.get('errors.isFrequencyError')).to.be.true;
-      expect(mainMirroringEditDataSetController.get('errorMessages.frequency')).to.equal(Em.I18n.t('mirroring.required.invalidNumberError'));
-      formFields.set('datasetFrequency', '100test');
-      mainMirroringEditDataSetController.validate();
-      expect(mainMirroringEditDataSetController.get('errors.isFrequencyError')).to.be.true;
-      expect(mainMirroringEditDataSetController.get('errorMessages.frequency')).to.equal(Em.I18n.t('mirroring.required.invalidNumberError'));
-    });
-    it('should not set errors if all fields are filled correctly', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-        formFields: formFields
-      });
-      mainMirroringEditDataSetController.validate();
-      var errors = mainMirroringEditDataSetController.get('errors');
-      var errorMessages = mainMirroringEditDataSetController.get('errorMessages');
-      Em.keys(errors).forEach(function (error) {
-        expect(errors[error]).to.be.false;
-      });
-      Em.keys(errorMessages).forEach(function (errorMessage) {
-        expect(errorMessages[errorMessage]).to.be.empty;
-      });
-    });
-  });
-
-  describe('#addZero', function () {
-    it('should add 0 for numbers less than 10', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      expect(mainMirroringEditDataSetController.addZero(1)).to.equal('01');
-      expect(mainMirroringEditDataSetController.addZero(9)).to.equal('09');
-      expect(mainMirroringEditDataSetController.addZero(0)).to.equal('00');
-    });
-    it('should not add 0 for numbers greater than 9', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      expect(mainMirroringEditDataSetController.addZero(10)).to.equal('10');
-      expect(mainMirroringEditDataSetController.addZero(99)).to.equal('99');
-    });
-  });
-
-  describe('#toTZFormat', function () {
-    it('should convert date to TZ format', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      expect(mainMirroringEditDataSetController.toTZFormat(new Date(Date.UTC(2014, 0, 1, 1, 1)))).to.equal('2014-01-01T01:01Z');
-      expect(mainMirroringEditDataSetController.toTZFormat(new Date(Date.UTC(2014, 11, 31, 23, 59)))).to.equal('2014-12-31T23:59Z');
-    });
-  });
-
-  describe('#toAMPMHours', function () {
-    it('should convert time to 12-hours format', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      expect(mainMirroringEditDataSetController.toAMPMHours(13)).to.equal('01');
-      expect(mainMirroringEditDataSetController.toAMPMHours(20)).to.equal('08');
-      expect(mainMirroringEditDataSetController.toAMPMHours(24)).to.equal('12');
-      expect(mainMirroringEditDataSetController.toAMPMHours(0)).to.equal('12');
-    });
-    it('should not convert time if argument is less than 12', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      expect(mainMirroringEditDataSetController.toAMPMHours(1)).to.equal('01');
-      expect(mainMirroringEditDataSetController.toAMPMHours(8)).to.equal('08');
-      expect(mainMirroringEditDataSetController.toAMPMHours(11)).to.equal('11');
-    });
-  });
-
-  describe('#save', function () {
-    it('should create XML and send it to server', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-        popup: Ember.Object.create({
-          isSaving: false
-        })
-      });
-      sinon.spy(mainMirroringEditDataSetController, 'createDatasetXML');
-      sinon.spy(mainMirroringEditDataSetController, 'sendDatasetToServer');
-      mainMirroringEditDataSetController.save();
-      expect(mainMirroringEditDataSetController.createDatasetXML.calledOnce).to.be.true;
-      expect(mainMirroringEditDataSetController.sendDatasetToServer.calledOnce).to.be.true;
-      expect(mainMirroringEditDataSetController.get('popup.isSaving')).to.be.true;
-      mainMirroringEditDataSetController.createDatasetXML.restore();
-      mainMirroringEditDataSetController.sendDatasetToServer.restore();
-    });
-  });
-
-  describe('#createDatasetXML', function () {
-    it('should create XML-fromatted data', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-        formFields: formFields
-      });
-      var startDate = new Date('01/19/2038 03:15 AM').toISOString().replace(/\:\d{2}\.\d{3}/, '');
-      var endDate = new Date('01/19/2039 03:15 AM').toISOString().replace(/\:\d{2}\.\d{3}/, '');
-      var expectedResult = '<?xml version="1.0"?><feed description="" name="' + App.mirroringDatasetNamePrefix + 'test" xmlns="uri:falcon:feed:0.1"><frequency>days(1)' +
-        '</frequency><clusters><cluster name="' + App.get('clusterName') + '" type="source"><validity start="' + startDate + '" end="' + endDate +
-        '"/><retention limit="days(7)" action="delete"/></cluster><cluster name="test" type="target"><validity start="' + startDate + '" end="' + endDate +
-        '"/><retention limit="months(1)" action="delete"/><locations><location type="data" path="/test" /></locations></cluster></clusters><locations><location type="data" path="' +
-        '/test" /></locations><ACL owner="hue" group="users" permission="0755" /><schema location="/none" provider="none"/></feed>';
-      var result = mainMirroringEditDataSetController.createDatasetXML();
-      expect(result).to.equal(expectedResult);
-    });
-  });
-
-  describe('#sendDatasetToServer', function () {
-    var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-      formFields: formFields
-    });
-    beforeEach(function () {
-      sinon.stub(App.ajax, 'send', Em.K);
-    });
-    afterEach(function () {
-      App.ajax.send.restore();
-    });
-    it('should send data with correct dataset name', function () {
-      mainMirroringEditDataSetController.sendDatasetToServer('test');
-      expect(App.ajax.send.args[0][0].data.name).to.equal(App.mirroringDatasetNamePrefix + formFields.datasetName);
-    });
-    it('should send data from param', function () {
-      mainMirroringEditDataSetController.sendDatasetToServer('test');
-      expect(App.ajax.send.args[0][0].data.entity).to.equal('test');
-    });
-    it('should use edit request if isEdit is true', function () {
-      mainMirroringEditDataSetController.set('isEdit', true);
-      mainMirroringEditDataSetController.sendDatasetToServer('test');
-      expect(App.ajax.send.args[0][0].name).to.equal('mirroring.update_entity');
-    });
-    it('should use create request if isEdit is false', function () {
-      mainMirroringEditDataSetController.set('isEdit', false);
-      mainMirroringEditDataSetController.sendDatasetToServer('test');
-      expect(App.ajax.send.args[0][0].name).to.equal('mirroring.create_new_dataset');
-    });
-  });
-
-  describe('#onSaveSuccess', function () {
-    it('should hide popup and load data', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-        popup: Ember.Object.create({
-          isSaving: true,
-          hide: function () {
-          }
-        })
-      });
-      App.router.set('mainMirroringController', Ember.Object.create({
-        loadData: function () {
-        }
-      }));
-      sinon.spy(mainMirroringEditDataSetController.get('popup'), 'hide');
-      sinon.spy(App.router.get('mainMirroringController'), 'loadData');
-      mainMirroringEditDataSetController.onSaveSuccess();
-      expect(mainMirroringEditDataSetController.get('popup.isSaving')).to.be.false;
-      expect(App.router.get('mainMirroringController').loadData.calledOnce).to.be.true;
-      expect(mainMirroringEditDataSetController.get('popup').hide.calledOnce).to.be.true;
-      mainMirroringEditDataSetController.get('popup').hide.restore();
-      App.router.get('mainMirroringController').loadData.restore();
-    });
-  });
-
-  describe('#onSaveError', function () {
-    var mainMirroringEditDataSetController;
-    beforeEach(function () {
-      mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create({
-        popup: Ember.Object.create({
-          isSaving: true
-        })
-      });
-      sinon.stub(App, 'showAlertPopup', Em.K);
-    });
-    afterEach(function () {
-      App.showAlertPopup.restore();
-    });
-    it('shouldn\'t show error popup and enable button', function () {
-      mainMirroringEditDataSetController.onSaveError(null);
-      expect(App.showAlertPopup.calledOnce).to.be.false;
-      expect(mainMirroringEditDataSetController.get('popup.isSaving')).to.be.false;
-    });
-    it('should show error popup and enable button', function () {
-      mainMirroringEditDataSetController.onSaveError({responseText: '<message>test</message>'});
-      expect(App.showAlertPopup.args[0][1]).to.be.equal(Em.I18n.t('mirroring.manageClusters.error') + ': test');
-      expect(mainMirroringEditDataSetController.get('popup.isSaving')).to.be.false;
-    });
-  });
-
-  describe('#saveDisabled', function () {
-    it('should return true if there are some errors', function () {
-      var mainMirroringEditDataSetController = App.MainMirroringEditDataSetController.create();
-      mainMirroringEditDataSetController.set('errors.isNameError', true);
-      expect(mainMirroringEditDataSetController.get('saveDisabled')).to.be.true;
-    });
-  });
-});

+ 0 - 111
ambari-web/test/mappers/jobs_mapper_test.js

@@ -1,111 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var Ember = require('ember');
-var App = require('app');
-
-require('views/main/apps/item/dag_view');
-require('mappers/server_data_mapper');
-require('mappers/jobs_mapper');
-
-describe('App.jobTimeLineMapper', function () {
-
-  var test_input = {
-    "map": [
-      {
-        "x": 1369394950,
-        "y": 0
-      },
-      {
-        "x": 1369394951,
-        "y": 1
-      },
-      {
-        "x": 1369394952,
-        "y": 1
-      },
-      {
-        "x": 1369394953,
-        "y": 0
-      }
-    ],
-    "shuffle": [
-      {
-        "x": 1369394950,
-        "y": 0
-      },
-      {
-        "x": 1369394951,
-        "y": 0
-      },
-      {
-        "x": 1369394952,
-        "y": 1
-      },
-      {
-        "x": 1369394953,
-        "y": 1
-      }
-    ],
-    "reduce": [
-      {
-        "x": 1369394950,
-        "y": 0
-      },
-      {
-        "x": 1369394951,
-        "y": 0
-      },
-      {
-        "x": 1369394952,
-        "y": 0
-      },
-      {
-        "x": 1369394953,
-        "y": 0
-      }
-    ]
-  };
-
-  describe('#coordinatesModify()', function () {
-    it('map', function() {
-      var new_map = App.jobTimeLineMapper.coordinatesModify(test_input.map);
-      expect(new_map.length).to.equal(6);
-
-      expect(new_map[1].y).to.equal(new_map[0].y);
-      expect(new_map[2].x).to.equal(new_map[1].x);
-
-      expect(new_map[4].y).to.equal(new_map[5].y);
-      expect(new_map[3].x).to.equal(new_map[4].x);
-    });
-    it('shuffle', function() {
-      var new_shuffle = App.jobTimeLineMapper.coordinatesModify(test_input.shuffle);
-      expect(new_shuffle.length).to.equal(6);
-
-      expect(new_shuffle[2].y).to.equal(new_shuffle[1].y);
-      expect(new_shuffle[3].x).to.equal(new_shuffle[2].x);
-
-      expect(new_shuffle[3].y).to.equal(new_shuffle[4].y);
-      expect(new_shuffle[4].x).to.equal(new_shuffle[5].x);
-    });
-    it('reduce', function() {
-      var new_reduce = App.jobTimeLineMapper.coordinatesModify(test_input.reduce);
-      expect(new_reduce.length).to.equal(4);
-    });
-  });
-});

+ 0 - 138
ambari-web/test/models/dataset_job_test.js

@@ -1,138 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-var modelSetup = require('test/init_model_test');
-require('models/dataset_job');
-
-var dataSetJob,
-  dataSetJobData = {
-    id: 'job',
-    name: 'job'
-  },
-  timeCases = [
-    {
-      property: 'startFormatted',
-      dateProperty: 'startDate'
-    },
-    {
-      property: 'endFormatted',
-      dateProperty: 'endDate'
-    }
-  ],
-  timeTestData = [
-    {
-      title: 'should calculate time period',
-      time: function () {
-        return App.dateTime();
-      },
-      result: 'a moment ago'
-    },
-    {
-      title: 'should be empty',
-      time: function () {
-        return 0;
-      },
-      result: ''
-    }
-  ],
-  healthCases = [
-    {
-      status: 'SUCCEEDED',
-      className: 'icon-ok'
-    },
-    {
-      status: 'SUSPENDED',
-      className: 'icon-cog'
-    },
-    {
-      status: 'WAITING',
-      className: 'icon-time'
-    },
-    {
-      status: 'RUNNING',
-      className: 'icon-play'
-    },
-    {
-      status: 'KILLED',
-      className: 'icon-exclamation-sign'
-    },
-    {
-      status: 'FAILED',
-      className: 'icon-warning-sign'
-    },
-    {
-      status: 'ERROR',
-      className: 'icon-remove'
-    },
-    {
-      status: '',
-      className: 'icon-question-sign'
-    }
-  ];
-
-describe('App.DataSetJob', function () {
-
-  beforeEach(function () {
-    dataSetJob = App.DataSetJob.createRecord(dataSetJobData);
-  });
-
-  afterEach(function () {
-    modelSetup.deleteRecord(dataSetJob);
-  });
-
-  describe('#statusFormatted', function () {
-    it('should be in lower case and capitalized', function () {
-      dataSetJob.set('status', 'RUNNING');
-      expect(dataSetJob.get('statusFormatted')).to.equal('Running');
-    });
-  });
-
-  describe('#isSuspended', function () {
-    it('should be false', function () {
-      dataSetJob.set('status', 'RUNNING');
-      expect(dataSetJob.get('isSuspended')).to.be.false;
-    });
-    it('should be true', function () {
-      dataSetJob.set('status', 'SUSPENDED');
-      expect(dataSetJob.get('isSuspended')).to.be.true;
-    });
-  });
-
-  timeCases.forEach(function (item) {
-    describe('#' + item.property, function () {
-      timeTestData.forEach(function (test) {
-        it(test.title, function () {
-          dataSetJob.set(item.dateProperty, test.time());
-          expect(dataSetJob.get(item.property)).to.equal(test.result);
-        });
-      });
-    });
-  });
-
-  describe('#healthClass', function () {
-    healthCases.forEach(function (item) {
-      it('should be ' + item.className, function () {
-        dataSetJob.set('status', item.status);
-        expect(dataSetJob.get('healthClass')).to.equal(item.className);
-      });
-    });
-  });
-
-});

+ 0 - 148
ambari-web/test/models/dataset_test.js

@@ -1,148 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-var modelSetup = require('test/init_model_test');
-require('models/dataset');
-
-var dataset,
-  datasetData = {
-    id: 'dataset',
-    name: 'dataset'
-  },
-  statusCases = [
-    {
-      status: 'RUNNING',
-      property: 'isRunning'
-    },
-    {
-      status: 'SUSPENDED',
-      property: 'isSuspended'
-    },
-    {
-      status: 'SUBMITTED',
-      property: 'isSubmitted'
-    }
-  ],
-  healthCases = [
-    {
-      title: 'should be live',
-      data: {
-        datasetJobs: [
-          Em.Object.create({
-            status: 'SUCCESSFUL'
-          })
-        ]
-      },
-      className: 'health-status-LIVE',
-      icon: App.healthIconClassGreen
-    },
-    {
-      title: 'should be dead for failed first job',
-      data: {
-        datasetJobs: [
-          Em.Object.create({
-            status: 'SUSPENDED',
-            endDate: 1
-          }),
-          Em.Object.create({
-            status: 'FAILED',
-            endDate: 0
-          })
-        ]
-      },
-      className: 'health-status-DEAD-RED',
-      icon: App.healthIconClassRed
-    },
-    {
-      title: 'should be for no jobs',
-      data: {
-        datasetJobs: []
-      },
-      className: 'health-status-LIVE',
-      icon: App.healthIconClassGreen
-    }
-  ];
-
-describe('App.Dataset', function () {
-
-  beforeEach(function () {
-    dataset = App.Dataset.createRecord(datasetData);
-  });
-
-  afterEach(function () {
-    modelSetup.deleteRecord(dataset);
-  });
-
-  describe('#prefixedName', function () {
-    it('should add mirroring prefix before the name', function () {
-      dataset.set('name', 'name');
-      expect(dataset.get('prefixedName')).to.equal(App.mirroringDatasetNamePrefix + 'name');
-    });
-  });
-
-  describe('#statusFormatted', function () {
-    it('should be in lower case and capitalized', function () {
-      dataset.set('status', 'RUNNING');
-      expect(dataset.get('statusFormatted')).to.equal('Running');
-    });
-  });
-
-  statusCases.forEach(function (item) {
-    describe(item.property, function () {
-
-      beforeEach(function () {
-        dataset.set('status', item.status);
-      });
-
-      it('should be true', function () {
-        expect(dataset.get(item.property)).to.be.true;
-      });
-
-      it('others should be false', function () {
-        var falseProperties = statusCases.mapProperty('property').without(item.property);
-        var falseStates = [];
-        falseProperties.forEach(function (prop) {
-          falseStates.push(dataset.get(prop));
-        });
-        expect(falseStates).to.eql([false, false]);
-      });
-
-    });
-  });
-
-  describe('#healthClass', function () {
-    healthCases.forEach(function (item) {
-      it(item.title, function () {
-        dataset.reopen(item.data);
-        expect(dataset.get('healthClass')).to.equal(item.className);
-      });
-    });
-  });
-
-  describe('#healthIconClass', function () {
-    healthCases.forEach(function (item) {
-      it(item.title, function () {
-        dataset.reopen(item.data);
-        expect(dataset.get('healthIconClass')).to.equal(item.icon);
-      });
-    });
-  });
-
-});

+ 0 - 24
ambari-web/test/utils/misc_test.js

@@ -83,28 +83,4 @@ describe('misc', function () {
       });
     });
   });
-
-  describe('#xmlToObject()', function(){
-    var xml = '<!-- Edited by XMLSpy -->'+
-      '<stacks name="HDP-2.1">'+
-      '<service>'+
-      '<name>NAGIOS</name>'+
-      '<name>OOZIE</name>'+
-      '<name>HDFS</name>'+
-      '<component>NAGIOS_SERVER</component>'+
-      '</service>'+
-      '</stacks>';
-    xml = new DOMParser().parseFromString(xml,"text/xml");
-    var converted = misc.xmlToObject(xml);
-    it('should be an object', function(){
-      expect(converted).to.a('object');
-    });
-    it('`attribute` name should be present', function(){
-      expect(converted.stacks).to.ok;
-    });
-    it('`stacks.service.name` should be an array', function() {
-      expect(converted.stacks.service.name).to.a('array');
-    });
-  });
-
 });

+ 0 - 4
ambari-web/test/views/main/menu_test.js

@@ -24,17 +24,13 @@ var mainMenuView = App.MainMenuView.create();
 describe('App.MainMenuView', function () {
 
   describe('#content', function () {
-    var supportsMirroring;
     beforeEach(function () {
-      supportsMirroring = Em.get('App.supports.mirroring');
-      Em.set('App.supports.mirroring', false);
       this.mock = sinon.stub(App, 'get');
       sinon.stub(App.router, 'get')
         .withArgs('clusterController.isLoaded').returns(true)
         .withArgs('loggedIn').returns(true);
     });
     afterEach(function () {
-      Em.set('App.supports.mirroring', supportsMirroring);
       this.mock.restore();
       App.router.get.restore();
     });

+ 0 - 243
ambari-web/test/views/main/mirroring/edit_dataset_view_test.js

@@ -1,243 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-var App = require('app');
-require('controllers/main/mirroring/edit_dataset_controller');
-require('models/target_cluster');
-require('views/main/mirroring/edit_dataset_view');
-
-var mainMirroringEditDataSetView;
-describe('App.MainMirroringEditDataSetView', function () {
-
-  beforeEach(function () {
-    mainMirroringEditDataSetView = App.MainMirroringEditDataSetView.create({
-      controller: App.MainMirroringEditDataSetController.create(),
-      isLoaded: true
-    });
-  });
-
-  describe('targetClusterSelect.content', function () {
-    var targetClusterSelect;
-    beforeEach(function () {
-      targetClusterSelect = mainMirroringEditDataSetView.get('targetClusterSelect').create({
-        parentView: mainMirroringEditDataSetView
-      });
-    });
-
-    it('should be empty if data is not loaded', function () {
-      targetClusterSelect.set('parentView.isLoaded', false);
-      expect(targetClusterSelect.get('content')).to.be.empty;
-    });
-    it('should contain list of clusters if data is loaded', function () {
-      targetClusterSelect.set('parentView.isLoaded', true);
-      targetClusterSelect.set('parentView.targetClusters', [
-        {name: 'test1'},
-        {name: 'test2'},
-        {name: App.get('clusterName')}
-      ]);
-      expect(targetClusterSelect.get('content')).to.eql([
-        'test1',
-        'test2',
-        Em.I18n.t('mirroring.dataset.addTargetCluster')
-      ]);
-    });
-  });
-
-  describe('targetClusterSelect.change', function () {
-    var targetClusterSelect;
-    beforeEach(function () {
-      targetClusterSelect = mainMirroringEditDataSetView.get('targetClusterSelect').create({
-        parentView: mainMirroringEditDataSetView,
-        content: ['test1', 'test2', 'test3']
-      });
-      sinon.stub(targetClusterSelect.parentView, 'manageClusters', Em.K);
-    });
-
-    afterEach(function () {
-      targetClusterSelect.parentView.manageClusters.restore();
-    });
-
-    it('should open manage cluster popup if appropriate option was selected', function () {
-      targetClusterSelect.set('selection', Em.I18n.t('mirroring.dataset.addTargetCluster'));
-      targetClusterSelect.change();
-      expect(targetClusterSelect.get('selection')).to.equal('test1');
-      expect(targetClusterSelect.parentView.manageClusters.calledOnce).to.be.true;
-      expect(targetClusterSelect.get('parentView.controller.formFields.datasetTargetClusterName')).to.equal('test1');
-    });
-    it('should not open manage cluster popup if appropriate option was not selected', function () {
-      targetClusterSelect.set('selection', 'test3');
-      targetClusterSelect.change();
-      expect(targetClusterSelect.get('selection')).to.equal('test3');
-      expect(targetClusterSelect.parentView.manageClusters.calledOnce).to.be.false;
-      expect(targetClusterSelect.get('parentView.controller.formFields.datasetTargetClusterName')).to.equal('test3');
-    });
-  });
-
-  describe('onTargetClustersChange', function () {
-
-    var testCases = [
-      {
-        isLoaded: true,
-        targetClusters: [1, 2, 3],
-        targetClusterName: 'test',
-        hasTargetClusters: true
-      },
-      {
-        isLoaded: false,
-        targetClusters: [1, 2, 3],
-        targetClusterName: null,
-        hasTargetClusters: false
-      },
-      {
-        isLoaded: true,
-        targetClusters: [1],
-        targetClusterName: null,
-        hasTargetClusters: false
-      }
-    ];
-
-    testCases.forEach(function (test) {
-      it('should set hasTargetClusters property depending on cluster list', function () {
-        mainMirroringEditDataSetView.set('isLoaded', test.isLoaded);
-        mainMirroringEditDataSetView.set('targetClusters', test.targetClusters);
-        mainMirroringEditDataSetView.set('controller.formFields.datasetTargetClusterName', 'test');
-        mainMirroringEditDataSetView.onTargetClustersChange();
-        expect(mainMirroringEditDataSetView.get('hasTargetClusters')).to.equal(test.hasTargetClusters);
-        expect(mainMirroringEditDataSetView.get('controller.formFields.datasetTargetClusterName')).to.equal(test.targetClusterName);
-      });
-    });
-  });
-
-  describe('fillForm', function () {
-
-    App.store.loadMany(App.Dataset, [
-      {
-        id: 'test1',
-        name: 'test1',
-        target_cluster_name: 'testCluster1',
-        source_dir: '/testDir1',
-        target_dir: '/testDir1',
-        frequency: '5',
-        frequency_unit: 'days',
-        schedule_start_date: new Date('11/29/2014 01:00 AM').toISOString().replace(/\:\d{2}\.\d{3}/, ''),
-        schedule_end_date: new Date('11/29/2014 02:00 AM').toISOString().replace(/\:\d{2}\.\d{3}/, '')
-      },
-      {
-        id: 'test2',
-        name: 'test2',
-        target_cluster_name: 'testCluster2',
-        source_dir: '/testDir2',
-        target_dir: '/testDir2',
-        frequency: '10',
-        frequency_unit: 'hours',
-        schedule_start_date: new Date('11/20/2014 01:00 AM').toISOString().replace(/\:\d{2}\.\d{3}/, ''),
-        schedule_end_date: new Date('11/21/2014 02:00 PM').toISOString().replace(/\:\d{2}\.\d{3}/, '')
-      },
-      {
-        id: 'test3',
-        name: 'test3',
-        target_cluster_name: 'testCluster3',
-        source_dir: '/testDir3',
-        target_dir: '/testDir3',
-        frequency: '1',
-        frequency_unit: 'minutes',
-        schedule_start_date: new Date('10/29/2014 01:00 AM').toISOString().replace(/\:\d{2}\.\d{3}/, ''),
-        schedule_end_date: new Date('11/29/2015 02:00 AM').toISOString().replace(/\:\d{2}\.\d{3}/, '')
-      }
-    ]);
-
-    var testCases = [
-      {
-        datasetName: 'test1',
-        datasetSourceDir: '/testDir1',
-        datasetTargetDir: '/testDir1',
-        datasetTargetClusterName: 'testCluster1',
-        datasetFrequency: '5',
-        repeatOptionSelected: 'days',
-        datasetStartDate: '11/29/14',
-        datasetEndDate: '11/29/14',
-        hoursForStart: '01',
-        hoursForEnd: '02',
-        minutesForStart: '00',
-        minutesForEnd: '00',
-        middayPeriodForStart: 'AM',
-        middayPeriodForEnd: 'AM'
-      },
-      {
-        datasetName: 'test2',
-        datasetSourceDir: '/testDir2',
-        datasetTargetDir: '/testDir2',
-        datasetTargetClusterName: 'testCluster2',
-        datasetFrequency: '10',
-        repeatOptionSelected: 'hours',
-        datasetStartDate: '11/20/14',
-        datasetEndDate: '11/21/14',
-        hoursForStart: '01',
-        hoursForEnd: '02',
-        minutesForStart: '00',
-        minutesForEnd: '00',
-        middayPeriodForStart: 'AM',
-        middayPeriodForEnd: 'PM'
-      },
-      {
-        datasetName: 'test3',
-        datasetSourceDir: '/testDir3',
-        datasetTargetDir: '/testDir3',
-        datasetTargetClusterName: 'testCluster3',
-        datasetFrequency: '1',
-        repeatOptionSelected: 'minutes',
-        datasetStartDate: '10/29/14',
-        datasetEndDate: '11/29/15',
-        hoursForStart: '01',
-        hoursForEnd: '02',
-        minutesForStart: '00',
-        minutesForEnd: '00',
-        middayPeriodForStart: 'AM',
-        middayPeriodForEnd: 'AM'
-      }
-    ];
-
-    it('should not set form fields if isLoaded is false', function () {
-      mainMirroringEditDataSetView.set('isLoaded', false);
-      mainMirroringEditDataSetView.fillForm();
-      Em.keys(mainMirroringEditDataSetView.get('controller.formFields')).forEach(function (field) {
-        expect(mainMirroringEditDataSetView.get('controller.formFields.' + field)).to.be.null;
-      });
-    });
-
-    it('should not set form fields if controller.isEdit is false', function () {
-      mainMirroringEditDataSetView.set('controller.isEdit', false);
-      mainMirroringEditDataSetView.fillForm();
-      Em.keys(mainMirroringEditDataSetView.get('controller.formFields')).forEach(function (field) {
-        expect(mainMirroringEditDataSetView.get('controller.formFields.' + field)).to.be.null;
-      });
-    });
-
-    testCases.forEach(function (test) {
-      it('set appropriate form fields from dataset model', function () {
-        mainMirroringEditDataSetView.set('controller.datasetIdToEdit', test.datasetName);
-        mainMirroringEditDataSetView.set('controller.isEdit', true);
-        mainMirroringEditDataSetView.fillForm();
-        Em.keys(mainMirroringEditDataSetView.get('controller.formFields')).forEach(function (field) {
-          expect(mainMirroringEditDataSetView.get('controller.formFields.' + field)).to.equal(test[field]);
-        });
-      });
-    });
-  });
-});

部分文件因为文件数量过多而无法显示