ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-4995. Mirroring: "write" interface needs to be set appropriately on the Falcon cluster. (akovalenko)
Date Fri, 07 Mar 2014 15:46:33 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 5237cfd0b -> 719fa2184


AMBARI-4995. Mirroring: "write" interface needs to be set appropriately on the Falcon cluster.
(akovalenko)


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

Branch: refs/heads/trunk
Commit: 719fa21840e8b37ba57afa5f7a02a4c310bc08e4
Parents: 5237cfd
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Mar 7 17:44:59 2014 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Fri Mar 7 17:46:16 2014 +0200

----------------------------------------------------------------------
 .../main/mirroring/jobs_controller.js           | 10 ------
 .../mirroring/manage_clusters_controller.js     |  6 ++--
 .../controllers/main/mirroring_controller.js    | 37 +++++++++++++++++++-
 ambari-web/app/mappers/target_cluster_mapper.js |  1 +
 ambari-web/app/messages.js                      |  1 +
 ambari-web/app/models/target_cluster.js         |  1 +
 .../app/templates/main/mirroring/jobs.hbs       |  4 +--
 .../main/mirroring/manage_clusters.hbs          |  4 +++
 .../app/views/main/mirroring/jobs_view.js       | 11 ++++--
 9 files changed, 58 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/controllers/main/mirroring/jobs_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/jobs_controller.js b/ambari-web/app/controllers/main/mirroring/jobs_controller.js
index b92b7ba..86c7dd9 100644
--- a/ambari-web/app/controllers/main/mirroring/jobs_controller.js
+++ b/ambari-web/app/controllers/main/mirroring/jobs_controller.js
@@ -21,16 +21,6 @@ var App = require('app');
 App.MainDatasetJobsController = Em.Controller.extend({
   name: 'mainDatasetJobsController',
 
-  isLoaded: function () {
-    return App.router.get('mainMirroringController.isLoaded');
-  }.property('App.router.mainMirroringController.isLoaded'),
-
-  jobs: function () {
-    var datasetName = this.get('content.name');
-    return (this.get('isLoaded') && datasetName) ?
-        App.Dataset.find().findProperty('name', datasetName).get('datasetJobs') : [];
-  }.property('content', 'isLoaded'),
-
   suspend: function () {
     App.ajax.send({
       name: 'mirroring.suspend_entity',

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js b/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
index e6c7304..8b97a6a 100644
--- a/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
+++ b/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
@@ -47,6 +47,7 @@ App.MainMirroringManageClustersController = Em.ArrayController.extend({
           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'),
@@ -80,6 +81,7 @@ App.MainMirroringManageClustersController = Em.ArrayController.extend({
             name: clusterName,
             execute: '',
             workflow: '',
+            write: '',
             readonly: '',
             staging: '',
             working: '',
@@ -172,8 +174,8 @@ App.MainMirroringManageClustersController = Em.ArrayController.extend({
         '" 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="hdfs://'+ App.get('falconServerURL') +':8020"
version="2.2.0" />' +
+        '" 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') +

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/controllers/main/mirroring_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring_controller.js b/ambari-web/app/controllers/main/mirroring_controller.js
index 238919b..340a2bf 100644
--- a/ambari-web/app/controllers/main/mirroring_controller.js
+++ b/ambari-web/app/controllers/main/mirroring_controller.js
@@ -209,11 +209,13 @@ App.MainMirroringController = Em.ArrayController.extend({
         });
       }, this);
     } else {
+      var defaultFS = this.loadDefaultFS();
       var sourceCluster = Ember.Object.create({
         name: App.get('clusterName'),
         execute: App.HostComponent.find().findProperty('componentName', 'RESOURCEMANAGER').get('host.hostName')
+ ':8050',
         readonly: 'hftp://' + App.HostComponent.find().findProperty('componentName', 'NAMENODE').get('host.hostName')
+ ':50070',
         workflow: 'http://' + App.HostComponent.find().findProperty('componentName', 'OOZIE_SERVER').get('host.hostName')
+ ':11000/oozie',
+        write: defaultFS,
         staging: '/apps/falcon/sandbox/staging',
         working: '/apps/falcon/sandbox/working',
         temp: '/tmp'
@@ -234,6 +236,37 @@ App.MainMirroringController = Em.ArrayController.extend({
     }
   },
 
+  /**
+   * Return fs.defaultFS config property loaded from server
+   * @return {String}
+   */
+  loadDefaultFS: function () {
+    App.ajax.send({
+      name: 'config.tags.sync',
+      sender: this,
+      success: 'onLoadConfigTagsSuccess',
+      error: 'onLoadConfigTagsError'
+    });
+    var configs = App.router.get('configurationController').getConfigsByTags([
+      {
+        siteName: "core-site",
+        tagName: this.get('tag')
+      }
+    ]);
+    return configs[0].properties['fs.defaultFS'];
+  },
+
+  // Loaded core-site tag version
+  tag: null,
+
+  onLoadConfigTagsSuccess: function (data) {
+    this.set('tag', data.Clusters.desired_configs['core-site'].tag);
+  },
+
+  onLoadConfigTagsError: function () {
+    console.error('Error in loading fs.defaultFS');
+  },
+
   onLoadClustersListError: function () {
     console.error('Failed to load clusters list.');
   },
@@ -261,6 +294,7 @@ App.MainMirroringController = Em.ArrayController.extend({
           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
@@ -278,7 +312,8 @@ App.MainMirroringController = Em.ArrayController.extend({
   },
 
   onDataLoad: function () {
-    if (this.get('isLoaded') && App.router.get('currentState.name') === 'index')
{
+    // Open default dataset job route if mirroring route is opened
+    if (this.get('isLoaded') && App.router.get('currentState.parentState.name') ===
'mirroring') {
       App.router.send('gotoShowJobs');
     }
   }.observes('isLoaded'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/mappers/target_cluster_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/target_cluster_mapper.js b/ambari-web/app/mappers/target_cluster_mapper.js
index 0b6052e..f774213 100644
--- a/ambari-web/app/mappers/target_cluster_mapper.js
+++ b/ambari-web/app/mappers/target_cluster_mapper.js
@@ -24,6 +24,7 @@ App.targetClusterMapper = App.QuickDataMapper.create({
     name: 'name',
     execute: 'execute',
     workflow: 'workflow',
+    write: 'write',
     readonly: 'readonly',
     staging: 'staging',
     working: 'working',

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 005fe68..70e2406 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1852,6 +1852,7 @@ Em.I18n.translations = {
   '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',

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/models/target_cluster.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/target_cluster.js b/ambari-web/app/models/target_cluster.js
index bda140b..5533065 100644
--- a/ambari-web/app/models/target_cluster.js
+++ b/ambari-web/app/models/target_cluster.js
@@ -23,6 +23,7 @@ App.TargetCluster = DS.Model.extend({
   name: DS.attr('string'),
   execute: DS.attr('string'),
   workflow: DS.attr('string'),
+  write: DS.attr('string'),
   readonly: DS.attr('string'),
   staging: DS.attr('string'),
   working: DS.attr('string'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/templates/main/mirroring/jobs.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/mirroring/jobs.hbs b/ambari-web/app/templates/main/mirroring/jobs.hbs
index 76a3320..ccb2748 100644
--- a/ambari-web/app/templates/main/mirroring/jobs.hbs
+++ b/ambari-web/app/templates/main/mirroring/jobs.hbs
@@ -96,7 +96,7 @@
     </tr>
     </thead>
     <tbody>
-    {{#if controller.isLoaded}}
+    {{#if view.isLoaded}}
       {{#if view.pageContent}}
         {{#each job in view.pageContent}}
           {{#view view.JobView contentBinding="job"}}
@@ -152,7 +152,7 @@
     {{/if}}
     </tbody>
   </table>
-  {{#if controller.isLoaded}}
+  {{#if view.isLoaded}}
     <div class="page-bar">
       <div class="items-on-page">
         <label>{{t common.show}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/templates/main/mirroring/manage_clusters.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/mirroring/manage_clusters.hbs b/ambari-web/app/templates/main/mirroring/manage_clusters.hbs
index cf13f68..3c95c84 100644
--- a/ambari-web/app/templates/main/mirroring/manage_clusters.hbs
+++ b/ambari-web/app/templates/main/mirroring/manage_clusters.hbs
@@ -40,6 +40,10 @@
             <label class="control-label-manage-clusters">{{t mirroring.manageClusters.workflow}}</label>
             {{view Ember.TextField class="span8" valueBinding="controller.selectedCluster.workflow"
disabledBinding="controller.isEditDisabled"}}
           </div>
+          <div class="control-group">
+            <label class="control-label-manage-clusters">{{t mirroring.manageClusters.write}}</label>
+            {{view Ember.TextField class="span8" valueBinding="controller.selectedCluster.write"
disabledBinding="controller.isEditDisabled"}}
+          </div>
         </div>
         <div class="accordion control-group" id="advanced-fields">
           <div class="accordion-group">

http://git-wip-us.apache.org/repos/asf/ambari/blob/719fa218/ambari-web/app/views/main/mirroring/jobs_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/mirroring/jobs_view.js b/ambari-web/app/views/main/mirroring/jobs_view.js
index 9f76b9e..b8f1bfa 100644
--- a/ambari-web/app/views/main/mirroring/jobs_view.js
+++ b/ambari-web/app/views/main/mirroring/jobs_view.js
@@ -22,9 +22,16 @@ 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 () {
-    return this.get('controller.jobs');
-  }.property('controller.jobs', 'controller.jobs.length'),
+    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');


Mime
View raw message