incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1456280 - in /incubator/ambari/trunk: ./ ambari-web/app/ ambari-web/app/assets/data/mirroring/ ambari-web/app/controllers/global/ ambari-web/app/mappers/ ambari-web/app/models/
Date Wed, 13 Mar 2013 23:50:04 GMT
Author: yusaku
Date: Wed Mar 13 23:50:03 2013
New Revision: 1456280

URL: http://svn.apache.org/r1456280
Log:
AMBARI-1618. HDFS Mirroring: Create Mapper, Model, Mock Data for Cluster. (Arun Kandregula
via yusaku)

Added:
    incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/target_clusters.json
    incubator/ambari/trunk/ambari-web/app/mappers/target_cluster_mapper.js
    incubator/ambari/trunk/ambari-web/app/models/target_cluster.js
Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/all_datasets.json
    incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js
    incubator/ambari/trunk/ambari-web/app/initialize.js
    incubator/ambari/trunk/ambari-web/app/mappers/dataset_mapper.js
    incubator/ambari/trunk/ambari-web/app/models.js
    incubator/ambari/trunk/ambari-web/app/models/dataset.js
    incubator/ambari/trunk/ambari-web/app/models/dataset_job.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Mar 13 23:50:03 2013
@@ -12,6 +12,9 @@ Trunk (unreleased changes):
 
  NEW FEATURES
 
+ AMBARI-1618. HDFS Mirroring: Create Mapper, Model, Mock Data for Cluster.
+ (Arun Kandregula via yusaku)
+
  AMBARI-1607. HDFS Mirroring: Create Mapper, Model and Mock Data.
  (Arun Kandregula via yusaku)
 

Modified: incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/all_datasets.json
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/all_datasets.json?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/all_datasets.json (original)
+++ incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/all_datasets.json Wed Mar
13 23:50:03 2013
@@ -80,9 +80,9 @@
             "id":"99",
             "cluster":"drtarget1",
             "sourceCluster":"drsource",
-            "status":"RUNNING",
-            "start":"2013-03-06T03:17Z",
-            "end":"2013-03-06T03:19Z",
+            "status":"FAILED",
+            "start":"2013-01-01T03:17Z",
+            "end":"2013-01-01T03:19Z",
             "details":"",
             "log":""
           }
@@ -93,9 +93,35 @@
             "id":"95",
             "cluster":"drtarget1",
             "sourceCluster":"drsource",
-            "status":"RUNNING",
-            "start":"2013-03-06T03:17Z",
-            "end":"2013-03-06T03:19Z",
+            "status":"FAILED",
+            "start":"2012-03-06T03:17Z",
+            "end":"2012-03-06T03:19Z",
+            "details":"",
+            "log":""
+          }
+        },
+        {
+          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
+          "Instances":{
+            "id":"90",
+            "cluster":"drtarget1",
+            "sourceCluster":"drsource",
+            "status":"SUCCESSFUL",
+            "start":"2012-03-06T03:17Z",
+            "end":"2012-03-06T03:19Z",
+            "details":"",
+            "log":""
+          }
+        },
+        {
+          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
+          "Instances":{
+            "id":"91",
+            "cluster":"drtarget1",
+            "sourceCluster":"drsource",
+            "status":"SUCCESSFUL",
+            "start":"2013-03-11T03:17Z",
+            "end":"2013-03-11T03:19Z",
             "details":"",
             "log":""
           }

Added: incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/target_clusters.json
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/target_clusters.json?rev=1456280&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/target_clusters.json (added)
+++ incubator/ambari/trunk/ambari-web/app/assets/data/mirroring/target_clusters.json Wed Mar
13 23:50:03 2013
@@ -0,0 +1,194 @@
+{
+  "href": "http://ec2...com:8080/api/v1/targets",
+  "items": [
+    {
+      "href": "http://ec2...com:8080/api/v1/targets/drtarget1",
+      "Clusters": {
+        "colo": "gs1",
+        "name": "drtarget1",
+        "interfaces": {
+          "interface": [
+            {
+              "type": "readonly",
+              "endpoint": "http://ec2...com:50070",
+              "version": "1.1.2.22"
+            },
+            {
+              "type": "write",
+              "endpoint": "hdfs://ec2...com:8020",
+              "version": "1.1.2.22"
+            },
+            {
+              "type": "execute",
+              "endpoint": "ec2...com:8021",
+              "version": "0.20.2"
+            },
+            {
+              "type": "workflow",
+              "endpoint": "http://ec2...com:11000/oozie/",
+              "version": "3.1"
+            },
+            {
+              "type": "messaging",
+              "endpoint": "tcp://ec2...com:61616?daemon=true",
+              "version": "5.1.6"
+            },
+            {
+              "type": "registry",
+              "endpoint": "Hcat",
+              "version": "1"
+            }
+          ]
+        },
+        "locations": {
+          "location": [
+            {
+              "name": "temp",
+              "path": "/tmp"
+            },
+            {
+              "name": "working",
+              "path": "/projects/ivory/working"
+            },
+            {
+              "name": "staging",
+              "path": "/projects/ivory/staging"
+            }
+          ]
+        },
+        "properties": {
+          "property": {
+            "name": "separator",
+            "value": ""
+          }
+        }
+      }
+    },
+    {
+      "href": "http://ec2...com:8080/api/v1/targets/drtarget2",
+      "Clusters": {
+        "colo": "gs2",
+        "name": "drtarget2",
+        "interfaces": {
+          "interface": [
+            {
+              "type": "readonly",
+              "endpoint": "http://ec2...com:50070",
+              "version": "1.1.2.22"
+            },
+            {
+              "type": "write",
+              "endpoint": "hdfs://ec2...com:8020",
+              "version": "1.1.2.22"
+            },
+            {
+              "type": "execute",
+              "endpoint": "ec2...com:8021",
+              "version": "0.20.2"
+            },
+            {
+              "type": "workflow",
+              "endpoint": "http://ec2...com:11000/oozie/",
+              "version": "3.1"
+            },
+            {
+              "type": "messaging",
+              "endpoint": "tcp://ec2...com:61616?daemon=true",
+              "version": "5.1.6"
+            },
+            {
+              "type": "registry",
+              "endpoint": "Hcat",
+              "version": "1"
+            }
+          ]
+        },
+        "locations": {
+          "location": [
+            {
+              "name": "temp",
+              "path": "/tmp"
+            },
+            {
+              "name": "working",
+              "path": "/projects/ivory/working"
+            },
+            {
+              "name": "staging",
+              "path": "/projects/ivory/staging"
+            }
+          ]
+        },
+        "properties": {
+          "property": {
+            "name": "separator",
+            "value": ""
+          }
+        }
+      }
+    },
+    {
+      "href": "http://ec2...com:8080/api/v1/targets/drtarget3",
+      "Clusters": {
+        "colo": "gs3",
+        "name": "drtarget3",
+        "interfaces": {
+          "interface": [
+            {
+              "type": "readonly",
+              "endpoint": "http://ec2...com:50070",
+              "version": "1.1.2.22"
+            },
+            {
+              "type": "write",
+              "endpoint": "hdfs://ec2...com:8020",
+              "version": "1.1.2.22"
+            },
+            {
+              "type": "execute",
+              "endpoint": "ec2...com:8021",
+              "version": "0.20.2"
+            },
+            {
+              "type": "workflow",
+              "endpoint": "http://ec2...com:11000/oozie/",
+              "version": "3.1"
+            },
+            {
+              "type": "messaging",
+              "endpoint": "tcp://ec2...com:61616?daemon=true",
+              "version": "5.1.6"
+            },
+            {
+              "type": "registry",
+              "endpoint": "Hcat",
+              "version": "1"
+            }
+          ]
+        },
+        "locations": {
+          "location": [
+            {
+              "name": "temp",
+              "path": "/tmp"
+            },
+            {
+              "name": "working",
+              "path": "/projects/ivory/working"
+            },
+            {
+              "name": "staging",
+              "path": "/projects/ivory/staging"
+            }
+          ]
+        },
+        "properties": {
+          "property": {
+            "name": "separator",
+            "value": ""
+          }
+        }
+      }
+    }
+  ]
+}

Modified: incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/global/cluster_controller.js Wed Mar
13 23:50:03 2013
@@ -42,7 +42,7 @@ App.ClusterController = Em.Controller.ex
       }
     }
     this.set('isLoaded', loaded);
-    this.set('clusterDataLoadedPercent', 'width:' + (Math.floor(numLoaded/7*100)).toString()
+ '%');
+    this.set('clusterDataLoadedPercent', 'width:' + (Math.floor(numLoaded/8*100)).toString()
+ '%');
   },
 
   dataLoadList:Em.Object.create({
@@ -52,7 +52,9 @@ App.ClusterController = Em.Controller.ex
     'racks':false,
     'alerts':false,
     'users':false,
-    'datasets':false
+    'datasets':false,
+    'targetclusters':false
+
   }),
 
   /**
@@ -289,10 +291,19 @@ App.ClusterController = Em.Controller.ex
     var usersUrl = App.testMode ? '/data/users/users.json' : App.apiPrefix + '/users/?fields=*';
     var racksUrl = "/data/racks/racks.json";
     var dataSetUrl = "/data/mirroring/all_datasets.json";
+    var targetClusterUrl = "/data/mirroring/target_clusters.json";
+
+    App.HttpClient.get(targetClusterUrl, App.targetClusterMapper, {
+      complete: function (jqXHR, textStatus) {
+        self.updateLoadStatus('targetclusters');
+      }
+    }, function (jqXHR, textStatus) {
+      self.updateLoadStatus('targetclusters');
+    });
 
 
     App.HttpClient.get(dataSetUrl, App.dataSetMapper, {
-      complete:function (jqXHR, textStatus) {
+      complete: function (jqXHR, textStatus) {
         self.updateLoadStatus('datasets');
       }
     }, function (jqXHR, textStatus) {

Modified: incubator/ambari/trunk/ambari-web/app/initialize.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/initialize.js?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/initialize.js (original)
+++ incubator/ambari/trunk/ambari-web/app/initialize.js Wed Mar 13 23:50:03 2013
@@ -44,6 +44,7 @@ require('mappers/racks_mapper');
 require('mappers/alerts_mapper');
 require('mappers/users_mapper');
 require('mappers/service_mapper');
+require('mappers/target_cluster_mapper');
 require('mappers/dataset_mapper');
 require('utils/http_client');
 require('utils/host_progress_popup');

Modified: incubator/ambari/trunk/ambari-web/app/mappers/dataset_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/mappers/dataset_mapper.js?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/mappers/dataset_mapper.js (original)
+++ incubator/ambari/trunk/ambari-web/app/mappers/dataset_mapper.js Wed Mar 13 23:50:03 2013
@@ -17,24 +17,28 @@
  */
 
 App.dataSetMapper = App.QuickDataMapper.create({
-  model : App.DataSet,
-  Jobs_model : App.DataSetJob,
-  config : {
+  model: App.DataSet,
+  Jobs_model: App.DataSetJob,
+  config: {
+    id: 'id', // approach 2 : to be calculated (TBC1)
     name: 'Feeds.name', // from json
     source_cluster_name: 'Feeds.clusters.cluster[0].name', // approach1 : from json
-    target_cluster_name: 'target_cluster_name', // approach 2 : to be calculated (TBC1)
+    target_cluster_name: 'target_cluster_name', // approach 2 : to be calculated (TBC2)
     source_dir: 'Feeds.locations.location.path',
     schedule: 'Feeds.frequency',
-    dataset_jobs: 'dataset_jobs', // TBC2 ( set of ids will be added )
+    dataset_jobs: 'dataset_jobs', // TBC3 ( set of ids will be added )
 
     // all below are unknown at present and may be blank
-    last_failed_date: 'last_failed_date',
-    avg_data: 'avg_data',
-    data_creation_date: 'data_creation_date',
+    last_failed_date: 'last_failed_date', // TBC4
+    last_succeeded_date: 'last_succeeded_date', // TBC5
+    last_duration: 'last_duration', // TBC6
+    avg_data: 'avg_data', // TBC7
+    created_date: 'created_date', // TBC8
     target_dir: 'target_dir'
+
   },
-  jobs_config : {
-    // $dataset_id: 'none', // will be loaded outside parser
+  jobs_config: {
+    $dataset_id: 'none', // will be loaded outside parser
     id: 'Instances.id',
     start_date: 'start_date_str',
     end_date: 'end_date_str',
@@ -42,64 +46,112 @@ App.dataSetMapper = App.QuickDataMapper.
     //data: 'Instances.details'
   },
 
-  map:function(json){
-    if(!this.get('model')) {return;}
-    if(json && json.items && json.items.length > 0){
+  getDuration: function (startDate, endDate) {
+
+    var milliseconds = endDate - startDate;
+    var date = new Date(milliseconds);
+    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
');
+
+  },
+  map: function (json) {
+    if (!this.get('model')) {
+      return;
+    }
+    if (json && json.items && json.items.length > 0) {
       var dataset_results = [];
-      json.items.forEach(function(item){
+      json.items.forEach(function (item) {
 
-        try{
+        try {
           // TBC1
-          item.target_cluster_name = (item.Feeds.clusters.cluster.findProperty("type","target")).name;
+          var re = new RegExp(" ", "g");
+          item.id = item.Feeds.name.replace(re, "_");
 
           // TBC2
+          item.target_cluster_name = (item.Feeds.clusters.cluster.findProperty("type", "target")).name;
+
+          // TBC3
           item.dataset_jobs = [];
 
-          item.instances.forEach(function(job){
+          var last_failed_date = null;
+          var last_succeeded_date = null;
+          var last_end_date = null;
+          item.instances.forEach(function (job) {
+            var end_date = new Date(job.Instances.end);
+
+            if (!last_end_date) {
+              last_end_date = end_date;
+              item.last_job = job;
+            }
+            else if (end_date > last_end_date) {
+              last_end_date = end_date;
+              item.last_job = job;
+            }
+            if (job.Instances.status === 'FAILED') {
+              if (last_failed_date == null || last_failed_date < end_date) {
+                item.last_failed_date = end_date;
+                last_failed_date = end_date;
+              }
+            }
+            else if (job.Instances.status === 'SUCCESSFUL') {
+              if (last_succeeded_date == null || last_succeeded_date < end_date) {
+                item.last_succeeded_date = end_date;
+                last_succeeded_date = end_date;
+              }
+            }
+
             item.dataset_jobs.push(job.Instances.id);
           });
 
-          item.last_failed_date ='';
-          item.avg_data ='';
-          item.data_creation_date ='';
-          item.target_dir ='';
+          // calculate last_duration
+
+          var last_end_date = new Date(item.last_job.Instances.end);
+          var last_start_date = new Date(item.last_job.Instances.start);
+          item.last_duration = this.getDuration(last_start_date, last_end_date);
+
+
+          item.avg_data = '';
+          item.created_date = '';
+          item.target_dir = '';
 
           var newitem = this.parseIt(item, this.config);
           dataset_results.push(newitem);
-        }catch(ex){
+        } catch (ex) {
           console.debug('Exception occured : ' + ex);
         }
-      },this);
-      console.debug('Before load: App.DataSet.find().content : ' + App.DataSet.find().content
);
+      }, this);
+      console.debug('Before load: App.DataSet.find().content : ' + App.DataSet.find().content);
       App.store.loadMany(this.get('model'), dataset_results);
-      console.debug('After load: App.DataSet.find().content : ' + App.DataSet.find().content
);
+      console.debug('After load: App.DataSet.find().content : ' + App.DataSet.find().content);
 
-      try{
+      try {
         // Child records
         var dataset_job_results = [];
-        json.items.forEach(function(item){
-          item.instances.forEach(function(instance){
+        json.items.forEach(function (item) {
+          item.instances.forEach(function (instance) {
             instance.Instances.start = new Date(instance.Instances.start); // neeed to be
calulated end -start
             instance.Instances.end = new Date(instance.Instances.end); // neeed to be calulated
end -start
 
-            var milliseconds =  instance.Instances.end - instance.Instances.start;
-            var date = new Date(milliseconds);
-            var h = Math.floor(milliseconds / 3600000);
-            var m = Math.floor((milliseconds % 3600000) / 60000);
-            var s = Math.floor(((milliseconds % 360000) % 60000) / 1000);
-            instance.duration = (h==0?'':h+'hr ') + (m==0?'':m+'mins ') + (s==0?'':s+'secs
');
+
+            instance.duration = this.getDuration(instance.Instances.start, instance.Instances.end);
+
             instance.start_date_str = instance.Instances.start.toString();
             instance.end_date_str = instance.Instances.end.toString();
 
             var result = this.parseIt(instance, this.jobs_config);
+            result.dataset_id = item.id;
             dataset_job_results.push(result);
+
+
           }, this)
         }, this);
 
-        console.debug('Before load: App.DataSetJob.find().content : ' + App.DataSetJob.find().content
);
+        console.debug('Before load: App.DataSetJob.find().content : ' + App.DataSetJob.find().content);
         App.store.loadMany(this.get('Jobs_model'), dataset_job_results);
-        console.debug('After load: App.DataSetJob.find().content : ' + App.DataSetJob.find().content
);
-      }catch(ex){
+        console.debug('After load: App.DataSetJob.find().content : ' + App.DataSetJob.find().content);
+      } catch (ex) {
         console.debug('Exception occured : ' + ex);
       }
     }

Added: incubator/ambari/trunk/ambari-web/app/mappers/target_cluster_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/mappers/target_cluster_mapper.js?rev=1456280&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/mappers/target_cluster_mapper.js (added)
+++ incubator/ambari/trunk/ambari-web/app/mappers/target_cluster_mapper.js Wed Mar 13 23:50:03
2013
@@ -0,0 +1,55 @@
+/**
+ * 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.targetClusterMapper = App.QuickDataMapper.create({
+  model: App.TargetCluster,
+  config: {
+    id: 'id',
+    cluster_name: 'Clusters.name',
+    name_node_web_url: 'name_node_web_url',
+    name_node_rpc_url: 'name_node_rpc_url',
+    oozie_server_url: 'oozie_server_url'
+  },
+  map: function (json) {
+    if (!this.get('model')) {
+      return;
+    }
+    if (json && json.items && json.items.length > 0) {
+      var target_cluster_results = [];
+      json.items.forEach(function (item) {
+        try {
+          item.name_node_web_url = (item.Clusters.interfaces.interface.findProperty("type",
"readonly")).endpoint;
+          item.name_node_rpc_url = (item.Clusters.interfaces.interface.findProperty("type",
"write")).endpoint;
+          //item.oozie_server_url = (item.Clusters.interfaces.interface.findProperty("type","workflow")).endpoint;
+          item.id = item.Clusters.name;
+
+          var re = new RegExp(" ", "g");
+          item.id = item.id.replace(re, "_");
+
+
+          item = this.parseIt(item, this.config);
+          target_cluster_results.push(item);
+        } catch (ex) {
+          console.error('Exception occurred: ' + ex);
+        }
+      }, this);
+      App.store.loadMany(this.get('model'), target_cluster_results);
+    }
+  }
+});

Modified: incubator/ambari/trunk/ambari-web/app/models.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models.js?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models.js Wed Mar 13 23:50:03 2013
@@ -41,6 +41,7 @@ require('models/run');
 require('models/app');
 require('models/background_operation');
 require('models/host_component');
+require('models/target_cluster');
 require('models/dataset');
 require('models/dataset_job');
 require('classes/run_class');

Modified: incubator/ambari/trunk/ambari-web/app/models/dataset.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/dataset.js?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/dataset.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/dataset.js Wed Mar 13 23:50:03 2013
@@ -20,28 +20,30 @@
 var App = require('app');
 
 App.DataSet = DS.Model.extend({
+  id: DS.attr('string'),
   name: DS.attr('string'),
   sourceClusterName: DS.attr('string'),
   targetClusterName: DS.attr('string'),
-  sourceDir : DS.attr('string'),
-  targetDir : DS.attr('string'),
+  sourceDir: DS.attr('string'),
+  targetDir: DS.attr('string'),
   schedule: DS.attr('string'),
-  lastFailedDate : DS.attr('date'),
-  avgData : DS.attr('number'),
-  dataCreationDate : DS.attr('string'),
+  lastSucceededDate: DS.attr('string'),
+  lastFailedDate: DS.attr('date'),
+  lastDuration: DS.attr('string'),
+  avgData: DS.attr('string'),
+  createdDate: DS.attr('string'),
   datasetJobs: DS.hasMany('App.DataSetJob')
 
 });
 
 
-
 App.DataSet.FIXTURES = [/*
-  {
-    id: 1,
-    cluster_name: 'cluster1',
-    stack_name: 'HDP',
-    hosts: [1, 2, 3, 4],
-    racks: [1, 2, 3, 4, 5, 6],
-    max_hosts_per_rack: 10
-  }*/
+ {
+ id: 1,
+ cluster_name: 'cluster1',
+ stack_name: 'HDP',
+ hosts: [1, 2, 3, 4],
+ racks: [1, 2, 3, 4, 5, 6],
+ max_hosts_per_rack: 10
+ }*/
 ];
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/models/dataset_job.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/dataset_job.js?rev=1456280&r1=1456279&r2=1456280&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/dataset_job.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/dataset_job.js Wed Mar 13 23:50:03 2013
@@ -20,22 +20,21 @@
 var App = require('app');
 
 App.DataSetJob = DS.Model.extend({
- // dataSet: DS.belongsTo('App.DataSet'),
+  dataset: DS.belongsTo('App.DataSet'),
   startDate: DS.attr('string'),
   endDate: DS.attr('string'),
-  duration : DS.attr('string')
+  duration: DS.attr('string')
   //data : DS.attr('string')
 });
 
 
-
 App.DataSetJob.FIXTURES = [/*
-  {
-    id: 1,
-    cluster_name: 'cluster1',
-    stack_name: 'HDP',
-    hosts: [1, 2, 3, 4],
-    racks: [1, 2, 3, 4, 5, 6],
-    max_hosts_per_rack: 10
-  }*/
+ {
+ id: 1,
+ cluster_name: 'cluster1',
+ stack_name: 'HDP',
+ hosts: [1, 2, 3, 4],
+ racks: [1, 2, 3, 4, 5, 6],
+ max_hosts_per_rack: 10
+ }*/
 ];
\ No newline at end of file

Added: incubator/ambari/trunk/ambari-web/app/models/target_cluster.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/target_cluster.js?rev=1456280&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/target_cluster.js (added)
+++ incubator/ambari/trunk/ambari-web/app/models/target_cluster.js Wed Mar 13 23:50:03 2013
@@ -0,0 +1,39 @@
+/**
+ * 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.TargetCluster = DS.Model.extend({
+  id: DS.attr('string'),
+  clusterName: DS.attr('string'),
+  nameNodeWebUrl: DS.attr('string'),
+  nameNodeRpcUrl: DS.attr('string'),
+  oozieServerUrl: DS.hasMany('string')
+});
+
+App.TargetCluster.FIXTURES = [/*
+ {
+ id: 1,
+ cluster_name: 'cluster1',
+ stack_name: 'HDP',
+ hosts: [1, 2, 3, 4],
+ racks: [1, 2, 3, 4, 5, 6],
+ max_hosts_per_rack: 10
+ }*/
+];
\ No newline at end of file



Mime
View raw message