[01/45] git commit: AMBARI-7035. Views: Jobs view support for existing ATS. (akovalenko)

2014-08-28 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-alerts-dev 76fc94ec1 - 52d1af763


AMBARI-7035. Views: Jobs view support for existing ATS. (akovalenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 61695fa43735b12a08b15af9504210ac6c9a0bf2
Parents: a826334
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Wed Aug 27 15:55:38 2014 +0300
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Wed Aug 27 15:55:38 2014 +0300

--
 .../src/main/resources/ui/app/scripts/app.js|  2 +-
 .../app/scripts/controllers/job_controller.js   |  2 +-
 .../app/scripts/controllers/jobs_controller.js  | 14 ++--
 .../resources/ui/app/scripts/helpers/ajax.js| 17 +++--
 .../resources/ui/app/scripts/helpers/jobs.js| 78 +---
 .../mappers/application_status_mapper.js| 47 
 contrib/views/jobs/src/main/resources/view.xml  | 10 +++
 7 files changed, 111 insertions(+), 59 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
--
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
index 3ab2c30..2ae6d20 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
@@ -55,7 +55,7 @@ App.initializer({
 
 });
 
-application.ApplicationStatusMapper.getClusterName();
+application.ApplicationStatusMapper.getInstanceParameters();
 
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
--
diff --git 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
index f1125d9..dbf3a4f 100644
--- 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
+++ 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
@@ -71,7 +71,7 @@ App.JobController = 
Ember.ObjectController.extend(App.RunPeriodically, {
   timeout = this.get('loadTimeout'),
   yarnService = App.HiveJob.store.getById('service', 'YARN'),
   content = this.get('content');
-if (!Em.isNone(yarnService)) {
+if (!Em.isNone(yarnService) || App.get('atsURL')) {
   if (!Em.isNone(content)) {
 App.Helpers.jobs.refreshJobDetails(
   content,

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
--
diff --git 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
index d96f598..16acb56 100644
--- 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
+++ 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
@@ -557,11 +557,11 @@ App.JobsController = 
Ember.ArrayController.extend(App.RunPeriodically, {
*/
   checkDataLoadingError: function (jqXHR) {
 var atsComponent = App.HiveJob.store.getById('component', 
'APP_TIMELINE_SERVER');
-if (atsComponent  atsComponent.get('workStatus') != STARTED) {
+if (!App.get('atsURL')  atsComponent  atsComponent.get('workStatus') 
!= STARTED) {
   this.set('jobsMessage', Em.I18n.t('jobs.error.ats.down'));
 }
 else {
-  if (jqXHR  jqXHR.status == 400) {
+  if (jqXHR  (jqXHR.status == 400 || jqXHR.status == 404)) {
 this.set('jobsMessage', Em.I18n.t('jobs.error.400'));
   }
   else {
@@ -584,15 +584,14 @@ App.JobsController = 
Ember.ArrayController.extend(App.RunPeriodically, {
   atsComponent = App.HiveJob.store.getById('component', 
'APP_TIMELINE_SERVER'),
   atsInValidState = !!atsComponent  atsComponent.get('workStatus') === 
STARTED;
 this.checkDataLoadingError();
-if (!Em.isNone(yarnService)  atsInValidState) {
+if (App.get('atsURL') || (!Em.isNone(yarnService)  atsInValidState)) {
   this.set('loading', true);
-  var historyServerHostName = atsComponent.get('hostName');
+  var atsURL = App.get('atsURL') || 'http://' + 
atsComponent.get('hostName') + ':' + 

git commit: AMBARI-7035. Views: Jobs view support for existing ATS. (akovalenko)

2014-08-27 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk a82633457 - 61695fa43


AMBARI-7035. Views: Jobs view support for existing ATS. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 61695fa43735b12a08b15af9504210ac6c9a0bf2
Parents: a826334
Author: Aleksandr Kovalenko akovale...@hortonworks.com
Authored: Wed Aug 27 15:55:38 2014 +0300
Committer: Aleksandr Kovalenko akovale...@hortonworks.com
Committed: Wed Aug 27 15:55:38 2014 +0300

--
 .../src/main/resources/ui/app/scripts/app.js|  2 +-
 .../app/scripts/controllers/job_controller.js   |  2 +-
 .../app/scripts/controllers/jobs_controller.js  | 14 ++--
 .../resources/ui/app/scripts/helpers/ajax.js| 17 +++--
 .../resources/ui/app/scripts/helpers/jobs.js| 78 +---
 .../mappers/application_status_mapper.js| 47 
 contrib/views/jobs/src/main/resources/view.xml  | 10 +++
 7 files changed, 111 insertions(+), 59 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
--
diff --git a/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
index 3ab2c30..2ae6d20 100644
--- a/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
+++ b/contrib/views/jobs/src/main/resources/ui/app/scripts/app.js
@@ -55,7 +55,7 @@ App.initializer({
 
 });
 
-application.ApplicationStatusMapper.getClusterName();
+application.ApplicationStatusMapper.getInstanceParameters();
 
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
--
diff --git 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
index f1125d9..dbf3a4f 100644
--- 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
+++ 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/job_controller.js
@@ -71,7 +71,7 @@ App.JobController = 
Ember.ObjectController.extend(App.RunPeriodically, {
   timeout = this.get('loadTimeout'),
   yarnService = App.HiveJob.store.getById('service', 'YARN'),
   content = this.get('content');
-if (!Em.isNone(yarnService)) {
+if (!Em.isNone(yarnService) || App.get('atsURL')) {
   if (!Em.isNone(content)) {
 App.Helpers.jobs.refreshJobDetails(
   content,

http://git-wip-us.apache.org/repos/asf/ambari/blob/61695fa4/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
--
diff --git 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
index d96f598..16acb56 100644
--- 
a/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
+++ 
b/contrib/views/jobs/src/main/resources/ui/app/scripts/controllers/jobs_controller.js
@@ -557,11 +557,11 @@ App.JobsController = 
Ember.ArrayController.extend(App.RunPeriodically, {
*/
   checkDataLoadingError: function (jqXHR) {
 var atsComponent = App.HiveJob.store.getById('component', 
'APP_TIMELINE_SERVER');
-if (atsComponent  atsComponent.get('workStatus') != STARTED) {
+if (!App.get('atsURL')  atsComponent  atsComponent.get('workStatus') 
!= STARTED) {
   this.set('jobsMessage', Em.I18n.t('jobs.error.ats.down'));
 }
 else {
-  if (jqXHR  jqXHR.status == 400) {
+  if (jqXHR  (jqXHR.status == 400 || jqXHR.status == 404)) {
 this.set('jobsMessage', Em.I18n.t('jobs.error.400'));
   }
   else {
@@ -584,15 +584,14 @@ App.JobsController = 
Ember.ArrayController.extend(App.RunPeriodically, {
   atsComponent = App.HiveJob.store.getById('component', 
'APP_TIMELINE_SERVER'),
   atsInValidState = !!atsComponent  atsComponent.get('workStatus') === 
STARTED;
 this.checkDataLoadingError();
-if (!Em.isNone(yarnService)  atsInValidState) {
+if (App.get('atsURL') || (!Em.isNone(yarnService)  atsInValidState)) {
   this.set('loading', true);
-  var historyServerHostName = atsComponent.get('hostName');
+  var atsURL = App.get('atsURL') || 'http://' + 
atsComponent.get('hostName') + ':' + yarnService.get('ahsWebPort');