浏览代码

Committing frontend changes to trunk. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1465166 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父节点
当前提交
4caaa6bca1
共有 100 个文件被更改,包括 12563 次插入2783 次删除
  1. 158 1
      CHANGES.txt
  2. 2 8
      ambari-web/app/app.js
  3. 6 3
      ambari-web/app/assets/data/background_operations/list_on_start.json
  4. 39 6
      ambari-web/app/assets/data/clusters/cluster.json
  5. 5 5
      ambari-web/app/assets/data/clusters/info.json
  6. 230 0
      ambari-web/app/assets/data/configurations/cluster_level_actual_configs.json
  7. 544 0
      ambari-web/app/assets/data/configurations/cluster_level_configs.json
  8. 16 0
      ambari-web/app/assets/data/configurations/host_level_overrides_configs.json
  9. 218 4
      ambari-web/app/assets/data/dashboard/services.json
  10. 277 0
      ambari-web/app/assets/data/hosts/hosts.json
  11. 9 9
      ambari-web/app/assets/data/mirroring/all_datasets.json
  12. 60 0
      ambari-web/app/assets/data/mirroring/poll/testConnection_poll1.json
  13. 60 0
      ambari-web/app/assets/data/mirroring/poll/testConnection_poll2.json
  14. 60 0
      ambari-web/app/assets/data/mirroring/poll/testConnection_poll3.json
  15. 60 0
      ambari-web/app/assets/data/mirroring/poll/testConnection_poll4.json
  16. 1 2
      ambari-web/app/assets/data/mirroring/upcoming_jobs.json
  17. 1676 0
      ambari-web/app/assets/data/services/host_component_actual_configs.json
  18. 7 0
      ambari-web/app/assets/data/wizard/reassign/request_id.json
  19. 383 0
      ambari-web/app/assets/data/wizard/stack/hdp/version/1.3.0.json
  20. 60 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/HBASE.json
  21. 20 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/HCATALOG.json
  22. 210 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/HDFS.json
  23. 95 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/HIVE.json
  24. 230 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/MAPREDUCE.json
  25. 155 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/OOZIE.json
  26. 90 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/WEBHCAT.json
  27. 25 0
      ambari-web/app/assets/data/wizard/stack/hdp/version122/ZOOKEEPER.json
  28. 60 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/HBASE.json
  29. 20 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/HCATALOG.json
  30. 210 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/HDFS.json
  31. 95 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/HIVE.json
  32. 155 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/HUE.json
  33. 230 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/MAPREDUCE.json
  34. 155 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/OOZIE.json
  35. 90 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/WEBHCAT.json
  36. 25 0
      ambari-web/app/assets/data/wizard/stack/hdp/version130/ZOOKEEPER.json
  37. 1834 0
      ambari-web/app/assets/data/wizard/stack/stacks.json
  38. 216 0
      ambari-web/app/assets/data/wizard/stop_services/poll_1.json
  39. 216 0
      ambari-web/app/assets/data/wizard/stop_services/poll_2.json
  40. 216 0
      ambari-web/app/assets/data/wizard/stop_services/poll_3.json
  41. 216 0
      ambari-web/app/assets/data/wizard/stop_services/poll_4.json
  42. 1 1
      ambari-web/app/assets/data/wizard/upgrade/poll_2.json
  43. 1 1
      ambari-web/app/assets/data/wizard/upgrade/poll_3.json
  44. 1 1
      ambari-web/app/assets/data/wizard/upgrade/poll_4.json
  45. 8 0
      ambari-web/app/controllers.js
  46. 46 317
      ambari-web/app/controllers/global/background_operations_controller.js
  47. 12 4
      ambari-web/app/controllers/global/cluster_controller.js
  48. 0 93
      ambari-web/app/controllers/installer.js
  49. 7 0
      ambari-web/app/controllers/main.js
  50. 37 20
      ambari-web/app/controllers/main/admin/cluster.js
  51. 64 0
      ambari-web/app/controllers/main/admin/misc_controller.js
  52. 0 33
      ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js
  53. 3 3
      ambari-web/app/controllers/main/admin/security/add/step3.js
  54. 2 2
      ambari-web/app/controllers/main/admin/security/disable.js
  55. 0 27
      ambari-web/app/controllers/main/admin/stack_upgrade_controller.js
  56. 0 92
      ambari-web/app/controllers/main/host/add_controller.js
  57. 137 0
      ambari-web/app/controllers/main/host/configs_service.js
  58. 73 44
      ambari-web/app/controllers/main/host/details.js
  59. 123 0
      ambari-web/app/controllers/main/mirroring/dataset_controller.js
  60. 23 0
      ambari-web/app/controllers/main/mirroring/datasets_controller.js
  61. 26 0
      ambari-web/app/controllers/main/mirroring/jobs_controller.js
  62. 89 0
      ambari-web/app/controllers/main/mirroring/targetClusterController.js
  63. 155 0
      ambari-web/app/controllers/main/mirroring/testConnectionResults_controller.js
  64. 23 0
      ambari-web/app/controllers/main/mirroring/testConnection_controller.js
  65. 10 2
      ambari-web/app/controllers/main/mirroring_controller.js
  66. 101 1
      ambari-web/app/controllers/main/service.js
  67. 3 92
      ambari-web/app/controllers/main/service/add_controller.js
  68. 509 370
      ambari-web/app/controllers/main/service/info/configs.js
  69. 9 11
      ambari-web/app/controllers/main/service/item.js
  70. 37 30
      ambari-web/app/controllers/main/service/reassign_controller.js
  71. 101 21
      ambari-web/app/controllers/wizard.js
  72. 398 377
      ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js
  73. 544 376
      ambari-web/app/controllers/wizard/step14_controller.js
  74. 52 42
      ambari-web/app/controllers/wizard/step5_controller.js
  75. 11 1
      ambari-web/app/controllers/wizard/step6_controller.js
  76. 18 208
      ambari-web/app/controllers/wizard/step7_controller.js
  77. 257 172
      ambari-web/app/controllers/wizard/step8_controller.js
  78. 67 1
      ambari-web/app/controllers/wizard/step9_controller.js
  79. 0 147
      ambari-web/app/data/capacity-scheduler_default.js
  80. 92 38
      ambari-web/app/data/config_mapping.js
  81. 315 113
      ambari-web/app/data/config_properties.js
  82. 160 16
      ambari-web/app/data/custom_configs.js
  83. 0 44
      ambari-web/app/data/mapred-queue-acl_default.js
  84. 56 0
      ambari-web/app/data/mock/step14PolledData/tasks_poll1.js
  85. 56 0
      ambari-web/app/data/mock/step14PolledData/tasks_poll2.js
  86. 56 0
      ambari-web/app/data/mock/step14PolledData/tasks_poll3.js
  87. 56 0
      ambari-web/app/data/mock/step14PolledData/tasks_poll4.js
  88. 56 0
      ambari-web/app/data/mock/step14PolledData/tasks_poll5.js
  89. 15 5
      ambari-web/app/data/review_configs.js
  90. 8 0
      ambari-web/app/data/service_components.js
  91. 27 7
      ambari-web/app/data/service_configs.js
  92. 7 0
      ambari-web/app/data/services.js
  93. 1 0
      ambari-web/app/initialize.js
  94. 25 1
      ambari-web/app/mappers/cluster_mapper.js
  95. 78 15
      ambari-web/app/mappers/dataset_mapper.js
  96. 30 2
      ambari-web/app/mappers/service_mapper.js
  97. 1 1
      ambari-web/app/mappers/target_cluster_mapper.js
  98. 132 12
      ambari-web/app/messages.js
  99. 6 1
      ambari-web/app/models/cluster.js
  100. 4 1
      ambari-web/app/models/cluster_states.js

+ 158 - 1
CHANGES.txt

@@ -12,6 +12,45 @@ Trunk (unreleased changes):
 
 
  NEW FEATURES
  NEW FEATURES
 
 
+ AMBARI-1800. Add "Admin > Misc" section to Ambari Web to show service user
+ accounts. (yusaku)
+
+ AMBARI-1756. Add ability to install and edit HUE as a service. (srimanth via 
+ yusaku)
+
+ AMBARI-1742. HDFS Mirroring: Edit/Delete Cluster. (Arun Kandregula via yusaku)
+
+ AMBARI-1723. HDFS Mirroring: Edit/Delete Data Set. (srimanth via yusaku)
+
+ AMBARI-1717. Add ability to start and stop all services from Services
+ page. (Xi Wang via yusaku)
+
+ AMBARI-1716. HDFS Mirroring: Add a cluster. (Arun Kandregula via yusaku)
+
+ AMBARI-1710. HDFS Mirroring: Edit/Delete Data Set. (srimanth via yusaku)
+
+ AMBARI-1699. HDFS Mirroring: Side Panel of individual jobs page.
+ (yusaku)
+
+ AMBARI-1698. Host Detail page needs to allow upgrade for host components
+ that failed to upgrade. (yusaku)
+
+ AMBARI-1696. Capacity Scheduler configuration UI. (yusaku)
+
+ AMBARI-1693. HDFS Mirroring: Display Jobs table. (yusaku)
+
+ AMBARI-1691. Add filtering by host-level status on Step 9 of Installer.
+ (Xi Wang via yusaku)
+
+ AMBARI-1668. HDFS Mirroring: Add Data Set Popup. (Arun Kandregula via
+ yusaku)
+
+ AMBARI-1650. Add Oracle and MySQL option for Oozie during Ambari cluster
+ install. (Xi Wang via yusaku)
+
+ AMBARI-1610. Expose ability to customize Hive Metastore log dir.
+ (yusaku)
+
  AMBARI-1729. Creating smoke test for Hue service. (swagle)
  AMBARI-1729. Creating smoke test for Hue service. (swagle)
 
 
  AMBARI-1776. ZooKeeper Servers needs to store correct kerberos principal 
  AMBARI-1776. ZooKeeper Servers needs to store correct kerberos principal 
@@ -185,6 +224,63 @@ Trunk (unreleased changes):
 
 
  IMPROVEMENTS
  IMPROVEMENTS
 
 
+ AMBARI-1825. Minor label change for the buttons to start/stop all services
+ in the side nav. (yusaku)
+
+ AMBARI-1824. Background operations popup: progress bar styling. (yusaku)
+
+ AMBARI-1823. Add hover tooltip for the green host health status icon in
+ Hosts page and Host Detail page. (yusaku)
+
+ AMBARI-1815. After modifying custom configs, properties are shown as blank,
+ leading to corrupt core-site.xml upon save. (yusaku)
+
+ AMBARI-1814. Refactor configurations functionality. (yusaku)
+
+ AMBARI-1809. Specify request context for Smoke test. (yusaku)
+
+ AMBARI-1808. Add ability to customize the smoke test user (frontend changes).
+ (yusaku)
+
+ AMBARI-1807. Disallow $ from usernames created via Misc in Install Wizard.
+ (yusaku)
+
+ AMBARI-1805. Minor text change in the Assign Masters page. (yusaku)
+
+ AMBARI-1798. Explicitly state that FQDNs need to be used when specifying
+ hosts to add to the cluster. (yusaku)
+
+ AMBARI-1785. Provide restart service indicator to all services. (srimanth
+ via yusaku)
+
+ AMBARI-1773. Integrate MySQL/Oracle options for Hive and Oozie. (Xi Wang via
+ yusaku)
+
+ AMBARI-1758. Reassign Master Wizard: Integration and hardening. 
+ (srimanth via yusaku)
+
+ AMBARI-1743. Stack Upgade Wizard - integrate with Ambari 1.3.0 repo.
+ (srimanth via yusaku)
+
+ AMBARI-1741. Exceptions thrown when using host overrides during install.
+ (srimanth via yusaku)
+
+ AMBARI-1740. Provide restart message in service config page. (srimanth via
+ yusaku)
+
+ AMBARI-1722. Frontend support for LDAP Group to Ambari Role Mapping.
+ (srimanth via yusaku)
+
+ AMBARI-1718. If there is no HBase master in active status, show proper
+ error message. (jaimin via yusaku)
+
+ AMBARI-1701. Stack Upgrade Wizard: Integrate with API. (yusaku)
+ 
+ AMBARI-1700. HDFS Mirroring: Display Jobs table (refactor). (yusaku)
+
+ AMBARI-1697. UI changes on HBase service page for HBase Multi-master/HA.
+ (yusaku)
+
  AMBARI-1782. Security wizard navigation: Restrict user on step3 until
  AMBARI-1782. Security wizard navigation: Restrict user on step3 until
  the decision of the step is reached. (jaimin)
  the decision of the step is reached. (jaimin)
 
 
@@ -560,7 +656,68 @@ Trunk (unreleased changes):
 
 
  BUG FIXES
  BUG FIXES
 
 
- AMBARI-1828. Clear text passwords appear in log files & config files. (swagle)
+ AMBARI-1822. Hue service link points to wrong URL and no smoke test drop
+ down is shown. (yusaku)
+
+ AMBARI-1821. Upgrading component is not very clear and Upgrade action
+ is not available. (yusaku)
+
+ AMBARI-1820. Installer Step 7 - DataNode hosts, TaskTracker hosts, and
+ RegionServer hosts not displayed correctly. (yusaku)
+
+ AMBARI-1819. Ambari Installer: page refreshes upon hitting enter in text
+ fields (Step 1 and Step 7). (yusaku)
+
+ AMBARI-1813. The back button seems disabled during host registration (step 3),
+ but you can actually click it to go back. (yusaku)
+
+ AMBARI-1812. Unable to re-configure core-site. (yusaku)
+
+ AMBARI-1811. Start/Stop service doesn't work. (yusaku)
+
+ AMBARI-1810. Security Wizard - Progress popup is not filtering tasks
+ correctly. (yusaku)
+
+ AMBARI-1806. Maintenance checks issued from frontend does not have request
+ context set appropriately. (yusaku)
+
+ AMBARI-1804. Reassign master should show only the hosts that do not have
+ another instance of the master for HBase. (yusaku)
+
+ AMBARI-1803. Reassign HBase master menu displays multiple entries with no
+ distinction when there are multiple HBase masters. (yusaku)
+
+ AMBARI-1802. Install wizard and subsequent reconfig screens lose 'confirm'
+ password content and show up as red even if the use is not editing these
+ fields. (yusaku)
+
+ AMBARI-1801. After adding hosts successfully, you need to refresh the hosts
+ page manually to see the new hosts. (yusaku)
+
+ AMBARI-1799. On service reconfig, Save button can be clicked even when there
+ are validation errors. (yusaku)
+
+ AMBARI-1796. Specific custom configs do not display after reload.
+ (srimanth via yusaku)
+
+ AMBARI-1768. Cluster install wizard does not succeed at service start.
+ (yusaku)
+
+ AMBARI-1755. Provide context for background operations. (srimanth via yusaku)
+
+ AMBARI-1744. isAdmin doesn't switch after login/out. (srimanth via yusaku)
+
+ AMBARI-1709. When all hosts are assigned a master component, the last host
+ should have all slave components and clients (Step 6). (srimanth via yusaku)
+
+ AMBARI-1695. Customize Services page - validation error count is not reflect
+ in the service tab for host exceptions. (yusaku)
+
+ AMBARI-1675. ASF license header missing from
+ app/templates/main/admin/security/add/step2.hbs. (yusaku)
+
+ AMBARI-1670. Changing service user name from web UI should also change
+ configuration properties that depends on those user name. (jaimin via yusaku)
 
 
  AMBARI-1826. Use service stop and start for Nagios/Ganglia/MySQL rather than
  AMBARI-1826. Use service stop and start for Nagios/Ganglia/MySQL rather than
  puppet artifacts for starting stopping these services. (smohanty)
  puppet artifacts for starting stopping these services. (smohanty)

+ 2 - 8
ambari-web/app/app.js

@@ -28,10 +28,7 @@ module.exports = Em.Application.create({
       simulateRemoteResponse: false
       simulateRemoteResponse: false
     })
     })
   }),
   }),
-  isAdmin : function(){
-    var user = this.db && this.db.getUser();
-    return user ? user.admin : false;
-  }.property(),
+  isAdmin: false,
   /**
   /**
    * return url prefix with number value of version of HDP stack
    * return url prefix with number value of version of HDP stack
    */
    */
@@ -40,10 +37,7 @@ module.exports = Em.Application.create({
     return '/stacks/HDP/version/' + stackVersion.replace(/HDP-/g, '');
     return '/stacks/HDP/version/' + stackVersion.replace(/HDP-/g, '');
   }.property('currentStackVersion'),
   }.property('currentStackVersion'),
   clusterName: null,
   clusterName: null,
-  currentStackVersion: null,
-  ready: function(){
-    this.set('currentStackVersion', this.get('defaultStackVersion'));
-  }
+  currentStackVersion: null
 });
 });
 
 
 /**
 /**

+ 6 - 3
ambari-web/app/assets/data/background_operations/list_on_start.json

@@ -5,7 +5,8 @@
       "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/requests/3",
       "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/requests/3",
       "Requests" : {
       "Requests" : {
         "id" : 3,
         "id" : 3,
-        "cluster_name" : "mycluster"
+        "cluster_name" : "mycluster",
+        "request_context" : "Stop Services"
       },
       },
       "tasks" : [
       "tasks" : [
         {
         {
@@ -68,7 +69,8 @@
       "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/requests/2",
       "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/requests/2",
       "Requests" : {
       "Requests" : {
         "id" : 2,
         "id" : 2,
-        "cluster_name" : "mycluster"
+        "cluster_name" : "mycluster",
+        "request_context" : "Start HDFS Service"
       },
       },
       "tasks" : [
       "tasks" : [
         {
         {
@@ -203,7 +205,8 @@
       "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/requests/1",
       "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/requests/1",
       "Requests" : {
       "Requests" : {
         "id" : 1,
         "id" : 1,
-        "cluster_name" : "mycluster"
+        "cluster_name" : "mycluster",
+        "request_context" : "Install Service"
       },
       },
       "tasks" : [
       "tasks" : [
         {
         {

+ 39 - 6
ambari-web/app/assets/data/clusters/cluster.json

@@ -1,10 +1,43 @@
 {
 {
-  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster?fields=Clusters",
+  "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk?fields=Clusters",
   "Clusters" : {
   "Clusters" : {
-    "cluster_name" : "mycluster",
+    "cluster_name" : "tdk",
     "cluster_id" : 1,
     "cluster_id" : 1,
-    "version" : "HDP-0.1",
-    "stack_name" : "HDP",
-    "max_hosts_per_rack" : 10
+    "version" : "HDP-1.3.0",
+    "desired_configs" : {
+      "mapred-site" : {
+        "tag" : "version1"
+      },
+      "hbase-site" : {
+        "tag" : "version1"
+      },
+      "global" : {
+        "tag" : "version1"
+      },
+      "hdfs-site" : {
+        "tag" : "version1"
+      },
+      "mapred-queue-acls" : {
+        "tag" : "version1"
+      },
+      "webhcat-site" : {
+        "tag" : "version1"
+      },
+      "oozie-site" : {
+        "tag" : "version1"
+      },
+      "hive-site" : {
+        "tag" : "version1"
+      },
+      "hue-site" : {
+        "tag" : "version1"
+      },
+      "capacity-scheduler" : {
+        "tag" : "version1"
+      },
+      "core-site" : {
+        "tag" : "version1"
+      }
+    }
   }
   }
-}
+}

+ 5 - 5
ambari-web/app/assets/data/clusters/info.json

@@ -1,12 +1,12 @@
 {
 {
-  "href" : "http://ambari:9998/clusters",
+  "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters",
   "items" : [
   "items" : [
     {
     {
-      "href" : "http://ambari:9998/clusters/mycluster",
+      "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk",
       "Clusters" : {
       "Clusters" : {
-        "cluster_name" : "mycluster",
-        "version" : "HDP-1.2.2"
+        "cluster_name" : "tdk",
+        "version" : "HDP-1.3.0"
       }
       }
     }
     }
   ]
   ]
-}
+}

+ 230 - 0
ambari-web/app/assets/data/configurations/cluster_level_actual_configs.json

@@ -0,0 +1,230 @@
+{
+  "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?(type=hdfs-site&tag=version4)|(type=core-site&tag=version4)|(type=global&tag=version4)",
+  "items" : [
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=core-site&tag=version4",
+      "tag" : "version4",
+      "type" : "core-site",
+      "Config" : {
+        "cluster_name" : "mycluster"
+      },
+      "properties" : {
+        "io.serializations" : "org.apache.hadoop.io.serializer.WritableSerialization",
+        "hadoop.proxyuser.hive.hosts" : "dev.hortonworks.com",
+        "fs.checkpoint.size" : "0.5",
+        "io.file.buffer.size" : "131072",
+        "hadoop.proxyuser.hcat.hosts" : "dev.hortonworks.com",
+        "fs.checkpoint.period" : "21612",
+        "io.compression.codec.lzo.class" : "com.hadoop.compression.lzo.LzoCodec",
+        "ipc.client.connection.maxidletime" : "30000",
+        "hadoop.proxyuser.hive.groups" : "users",
+        "webinterface.private.actions" : "false",
+        "hadoop.proxyuser.oozie.groups" : "users",
+        "fs.checkpoint.edits.dir" : "/hadoop/hdfs/namesecondary",
+        "fs.trash.interval" : "360",
+        "fs.default.name" : "hdfs://dev.hortonworks.com:8020",
+        "hadoop.proxyuser.hcat.groups" : "users",
+        "ipc.client.idlethreshold" : "8000",
+        "fs.checkpoint.dir" : "/hadoop/hdfs/namesecondary",
+        "ipc.client.connect.max.retries" : "50",
+        "hadoop.proxyuser.oozie.hosts" : "dev.hortonworks.com"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=hdfs-site&tag=version1",
+      "tag" : "version4",
+      "type" : "hdfs-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "dfs.https.address" : "dev.hortonworks.com:50470",
+        "dfs.http.address" : "dev.hortonworks.com:50070",
+        "dfs.datanode.max.xcievers" : "4096",
+        "dfs.safemode.threshold.pct" : "1.0f",
+        "dfs.datanode.http.address" : "0.0.0.0:50075",
+        "dfs.datanode.address" : "0.0.0.0:50010",
+        "dfs.datanode.failed.volumes.tolerated" : "0",
+        "dfs.namenode.keytab.file" : "/etc/security/keytabs/nn.service.keytab",
+        "ipc.server.read.threadpool.size" : "5",
+        "dfs.datanode.data.dir.perm" : "750",
+        "dfs.datanode.du.pct" : "0.85f",
+        "ipc.server.max.response.size" : "5242880",
+        "dfs.datanode.du.reserved" : "1.05",
+        "dfs.datanode.socket.write.timeout" : "0",
+        "dfs.namenode.handler.count" : "40",
+        "dfs.web.ugi" : "gopher,gopher",
+        "dfs.datanode.keytab.file" : "/etc/security/keytabs/dn.service.keytab",
+        "dfs.name.dir" : "/hadoop/hdfs/namenode",
+        "dfs.heartbeat.interval" : "3",
+        "dfs.balance.bandwidthPerSec" : "6250000",
+        "dfs.permissions.supergroup" : "hdfs",
+        "dfs.cluster.administrators" : " hdfs",
+        "dfs.secondary.namenode.keytab.file" : "/etc/security/keytabs/nn.service.keytab",
+        "dfs.hosts.exclude" : "/etc/hadoop/dfs.exclude",
+        "dfs.permissions" : "true",
+        "dfs.namenode.kerberos.https.principal" : "host/_HOST@EXAMPLE.COM",
+        "dfs.datanode.kerberos.principal" : "dn/_HOST@EXAMPLE.COM",
+        "dfs.web.authentication.kerberos.keytab" : "/etc/security/keytabs/spnego.service.keytab",
+        "dfs.webhdfs.enabled" : "true",
+        "dfs.secondary.namenode.kerberos.https.principal" : "host/_HOST@EXAMPLE.COM",
+        "dfs.secondary.https.port" : "50490",
+        "dfs.block.size" : "134217728",
+        "dfs.datanode.ipc.address" : "0.0.0.0:8010",
+        "dfs.data.dir" : "/hadoop/hdfs/data1,/hadoop/hdfs/data2",
+        "dfs.access.time.precision" : "0",
+        "dfs.blockreport.initialDelay" : "120",
+        "dfs.https.port" : "50470",
+        "dfs.block.access.token.enable" : "true",
+        "dfs.umaskmode" : "077",
+        "dfs.replication" : "3",
+        "dfs.secondary.http.address" : "dev.hortonworks.com:50090",
+        "dfs.secondary.namenode.kerberos.principal" : "nn/_HOST@EXAMPLE.COM",
+        "dfs.replication.max" : "50",
+        "dfs.hosts" : "/etc/hadoop/dfs.include",
+        "dfs.block.local-path-access.user" : "hbase",
+        "dfs.namenode.kerberos.principal" : "nn/_HOST@EXAMPLE.COM"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=global&tag=version1",
+      "tag" : "version4",
+      "type" : "global",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "hdfs_enable_shortcircuit_skipchecksum" : "false",
+        "hadoop_heapsize" : "1024",
+        "hive_lib" : "/usr/lib/hive/lib/",
+        "hive_mysql_hostname" : "dev.hortonworks.com",
+        "hive_log_dir" : "/var/log/hive",
+        "dfs_datanode_http_address" : "50075",
+        "io_sort_mb" : "200",
+        "zk_user" : "zookeeper",
+        "dfs_data_dir" : "/hadoop/hdfs/data11,/hadoop/hdfs/data22",
+        "clientPort" : "2181",
+        "hdfs_user" : "hdfs",
+        "hive_dbroot" : "/usr/lib/hive/lib",
+        "dfs_name_dir" : "/hadoop/hdfs/namenode",
+        "hfile_blockcache_size" : "0.25",
+        "kadmin_pw" : "",
+        "gmond_user" : "nobody",
+        "hregion_majorcompaction" : "86400000",
+        "user_group" : "hadoop",
+        "dfs_datanode_failed_volume_tolerated" : "0",
+        "zk_pid_file" : "/var/run/zookeeper/zookeeper_server.pid",
+        "zookeeper_sessiontimeout" : "60000",
+        "hcat_user" : "hcat",
+        "zk_log_dir" : "/var/log/zookeeper",
+        "hbase_conf_dir" : "/etc/hbase",
+        "mapred_local_dir" : "/hadoop/mapred",
+        "oozie_data_dir" : "/hadoop/oozie/data",
+        "dfs_replication" : "3",
+        "fs_checkpoint_period" : "21600",
+        "hbase_hdfs_root_dir" : "/apps/hbase/data",
+        "run_dir" : "/var/run/hadoop",
+        "oozie_log_dir" : "/var/log/oozie",
+        "hive_user" : "hive",
+        "hbase_pid_dir" : "/var/run/hbase",
+        "security_enabled" : "false",
+        "mapred_job_red_mem_mb" : "-1",
+        "mapred_map_tasks_max" : "4",
+        "dfs_datanode_address" : "50010",
+        "mapred_hosts_exclude" : "mapred.exclude",
+        "dfs_block_local_path_access_user" : "hbase",
+        "dfs_datanode_data_dir_perm" : "750",
+        "nagios_web_password" : "n",
+        "dtnode_heapsize" : "1024m",
+        "tickTime" : "2000",
+        "mapred_cluster_max_map_mem_mb" : "-1",
+        "datanode_du_reserved" : "1",
+        "regionserver_memstore_upperlimit" : "0.4",
+        "hbase_tmp_dir" : "/var/log/hbase",
+        "jtnode_opt_newsize" : "200m",
+        "oozie_user" : "oozie",
+        "mapred_jobstatus_dir" : "file:////mapred/jobstatus",
+        "hive_metastore_port" : "9083",
+        "namenode_heapsize" : "1024m",
+        "nagios_contact" : "n@n.com",
+        "mapred_cluster_red_mem_mb" : "-1",
+        "hive_ambari_database" : "MySQL",
+        "zk_data_dir" : "/hadoop/zookeeper",
+        "hive_pid_dir" : "/var/run/hive",
+        "mysql_connector_url" : "${download_url}/mysql-connector-java-5.1.18.zip",
+        "jtnode_opt_maxnewsize" : "200m",
+        "hregion_blockmultiplier" : "2",
+        "oozie_pid_dir" : "/var/run/oozie",
+        "pig_user" : "pig",
+        "task_controller" : "org.apache.hadoop.mapred.DefaultTaskController",
+        "rca_enabled" : "true",
+        "gmetad_user" : "nobody",
+        "gpl_artifacts_download_url" : "",
+        "hive_metastore_user_passwd" : "h",
+        "hcat_log_dir" : "/var/log/webhcat",
+        "jtnode_heapsize" : "1024m",
+        "syncLimit" : "5",
+        "io_sort_spill_percent" : "0.9",
+        "mapred_user" : "mapred",
+        "fs_checkpoint_size" : "0.5",
+        "initLimit" : "10",
+        "mapred_system_dir" : "/mapred/system",
+        "hive_database" : "New MySQL Database",
+        "mapred_job_map_mem_mb" : "-1",
+        "hive_conf_dir" : "/etc/hive/conf",
+        "hdfs_log_dir_prefix" : "/var/log/hadoop",
+        "keytab_path" : "/etc/security/keytabs",
+        "lzo_enabled" : "false",
+        "proxyuser_group" : "users",
+        "hive_database_name" : "hive",
+        "hcat_pid_dir" : "/var/run/webhcat",
+        "client_scannercaching" : "100",
+        "hdfs_enable_shortcircuit_read" : "true",
+        "kerberos_domain" : "EXAMPLE.COM",
+        "hdfs_support_append" : "true",
+        "nagios_group" : "nagios",
+        "nagios_web_login" : "nagiosadmin",
+        "namenode_formatted_mark_dir" : "/var/run/hadoop/hdfs/namenode/formatted/",
+        "dfs_exclude" : "dfs.exclude",
+        "namenode_opt_maxnewsize" : "640m",
+        "regionserver_memstore_lab" : "true",
+        "namenode_opt_newsize" : "200m",
+        "mapreduce_userlog_retainhours" : "24",
+        "hcat_conf_dir" : "",
+        "nagios_user" : "nagios",
+        "mapred_child_java_opts_sz" : "768",
+        "mapred_red_tasks_max" : "2",
+        "regionserver_memstore_lowerlimit" : "0.35",
+        "apache_artifacts_download_url" : "",
+        "hive_metastore_user_name" : "hive",
+        "mapred_hosts_include" : "mapred.include",
+        "hstore_blockingstorefiles" : "7",
+        "sqoop_user" : "sqoop",
+        "hadoop_conf_dir" : "/etc/hadoop",
+        "hbase_user" : "hbase",
+        "snappy_enabled" : "true",
+        "maxtasks_per_job" : "-1",
+        "ganglia_runtime_dir" : "/var/run/ganglia/hdp",
+        "fs_checkpoint_dir" : "/hadoop/hdfs/namesecondary",
+        "zk_pid_dir" : "/var/run/zookeeper",
+        "mapred_cluster_map_mem_mb" : "-1",
+        "hfile_max_keyvalue_size" : "10485760",
+        "hive_aux_jars_path" : "/usr/lib/hcatalog/share/hcatalog/hcatalog-core.jar",
+        "hstore_compactionthreshold" : "3",
+        "hregion_memstoreflushsize" : "134217728",
+        "hadoop_pid_dir_prefix" : "/var/run/hadoop",
+        "hbase_log_dir" : "/var/log/hbase",
+        "mapred_cluster_max_red_mem_mb" : "-1",
+        "webhcat_user" : "hcat",
+        "regionserver_handlers" : "30",
+        "hbase_regionserver_heapsize" : "1024m",
+        "dfs_include" : "dfs.include",
+        "dfs_webhdfs_enabled" : "false",
+        "scheduler_name" : "org.apache.hadoop.mapred.CapacityTaskScheduler",
+        "rrdcached_base_dir" : "/var/lib/ganglia/rrds",
+        "hstorefile_maxsize" : "1073741824",
+        "hbase_master_heapsize" : "1024m"
+      }
+    }
+  ]
+}

+ 544 - 0
ambari-web/app/assets/data/configurations/cluster_level_configs.json

@@ -0,0 +1,544 @@
+{
+  "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?(type=hdfs-site&tag=version1)|(type=core-site&tag=version1)",
+  "items" : [
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=core-site&tag=version1",
+      "tag" : "version1",
+      "type" : "core-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "io.serializations" : "org.apache.hadoop.io.serializer.WritableSerialization",
+        "hadoop.proxyuser.hive.hosts" : "dev.hortonworks.com",
+        "fs.checkpoint.size" : "0.5",
+        "io.file.buffer.size" : "131072",
+        "hadoop.proxyuser.hcat.hosts" : "dev.hortonworks.com",
+        "fs.checkpoint.period" : "21600",
+        "io.compression.codec.lzo.class" : "com.hadoop.compression.lzo.LzoCodec",
+        "ipc.client.connection.maxidletime" : "30000",
+        "hadoop.proxyuser.hive.groups" : "users",
+        "webinterface.private.actions" : "false",
+        "hadoop.proxyuser.oozie.groups" : "users",
+        "fs.checkpoint.edits.dir" : "/hadoop/hdfs/namesecondary",
+        "fs.trash.interval" : "360",
+        "fs.default.name" : "hdfs://dev.hortonworks.com:8020",
+        "hadoop.proxyuser.hcat.groups" : "users",
+        "ipc.client.idlethreshold" : "8000",
+        "fs.checkpoint.dir" : "/hadoop/hdfs/namesecondary",
+        "ipc.client.connect.max.retries" : "50",
+        "hadoop.proxyuser.oozie.hosts" : "dev.hortonworks.com"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=mapred-site&tag=version1",
+      "tag" : "version1",
+      "type" : "mapred-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "mapred.reduce.tasks.speculative.execution" : "false",
+        "mapred.tasktracker.map.tasks.maximum" : "4",
+        "mapred.hosts.exclude" : "/etc/hadoop/mapred.exclude",
+        "mapred.job.reduce.input.buffer.percent" : "0.0",
+        "mapreduce.tasktracker.group" : "hadoop",
+        "mapreduce.reduce.input.limit" : "10737418240",
+        "mapreduce.fileoutputcommitter.marksuccessfuljobs" : "false",
+        "mapred.map.tasks.speculative.execution" : "false",
+        "mapreduce.jobtracker.kerberos.principal" : "jt/_HOST@EXAMPLE.COM",
+        "mapred.output.compression.type" : "BLOCK",
+        "mapred.userlog.retain.hours" : "24",
+        "mapred.task.tracker.task-controller" : "org.apache.hadoop.mapred.DefaultTaskController",
+        "mapred.job.reuse.jvm.num.tasks" : "1",
+        "mapreduce.tasktracker.keytab.file" : "/etc/security/keytabs/tt.service.keytab",
+        "mapred.system.dir" : "/mapred/system",
+        "io.sort.factor" : "100",
+        "mapreduce.history.server.http.address" : "dev.hortonworks.com:51111",
+        "mapred.jobtracker.maxtasks.per.job" : "-1",
+        "io.sort.spill.percent" : "0.9",
+        "mapred.cluster.reduce.memory.mb" : "-1",
+        "tasktracker.http.threads" : "50",
+        "mapred.reduce.parallel.copies" : "30",
+        "mapred.healthChecker.script.path" : "file:////mapred/jobstatus",
+        "mapreduce.cluster.administrators" : " hadoop",
+        "jetty.connector" : "org.mortbay.jetty.nio.SelectChannelConnector",
+        "mapred.inmem.merge.threshold" : "1000",
+        "mapred.job.reduce.memory.mb" : "-1",
+        "mapred.job.map.memory.mb" : "-1",
+        "mapreduce.jobhistory.kerberos.principal" : "jt/_HOST@EXAMPLE.COM",
+        "mapred.cluster.map.memory.mb" : "-1",
+        "mapred.jobtracker.retirejob.interval" : "0",
+        "mapred.cluster.max.map.memory.mb" : "-1",
+        "mapred.job.tracker.persist.jobstatus.hours" : "1",
+        "mapred.reduce.slowstart.completed.maps" : "0.05",
+        "hadoop.job.history.user.location" : "none",
+        "mapred.job.tracker.handler.count" : "50",
+        "mapred.healthChecker.interval" : "135000",
+        "mapred.jobtracker.blacklist.fault-bucket-width" : "15",
+        "mapred.task.timeout" : "600000",
+        "mapred.jobtracker.taskScheduler" : "org.apache.hadoop.mapred.CapacityTaskScheduler",
+        "mapred.max.tracker.blacklists" : "16",
+        "mapreduce.jobhistory.keytab.file" : "/etc/security/keytabs/jt.service.keytab",
+        "mapred.jobtracker.retirejob.check" : "10000",
+        "mapred.tasktracker.tasks.sleeptime-before-sigkill" : "250",
+        "mapreduce.jobtracker.staging.root.dir" : "/user",
+        "mapred.job.shuffle.input.buffer.percent" : "0.7",
+        "mapred.jobtracker.completeuserjobs.maximum" : "0",
+        "mapred.job.tracker.persist.jobstatus.active" : "false",
+        "mapred.tasktracker.reduce.tasks.maximum" : "2",
+        "mapreduce.history.server.embedded" : "false",
+        "mapred.job.tracker.http.address" : "dev.hortonworks.com:50030",
+        "mapred.queue.names" : "default",
+        "mapred.job.tracker.history.completed.location" : "/mapred/history/done",
+        "mapred.child.java.opts" : "-server -Xmx768m -Djava.net.preferIPv4Stack=true",
+        "mapred.jobtracker.blacklist.fault-timeout-window" : "180",
+        "mapreduce.jobtracker.split.metainfo.maxsize" : "50000000",
+        "mapred.jobtracker.restart.recover" : "false",
+        "mapred.healthChecker.script.timeout" : "60000",
+        "mapreduce.jobtracker.keytab.file" : "/etc/security/keytabs/jt.service.keytab",
+        "mapred.hosts" : "/etc/hadoop/mapred.include",
+        "mapred.local.dir" : "/hadoop/mapred",
+        "mapreduce.tasktracker.kerberos.principal" : "tt/_HOST@EXAMPLE.COM",
+        "mapred.job.tracker.persist.jobstatus.dir" : "/etc/hadoop/health_check",
+        "mapred.job.tracker" : "dev.hortonworks.com:50300",
+        "io.sort.record.percent" : ".2",
+        "io.sort.mb" : "200",
+        "mapred.cluster.max.reduce.memory.mb" : "-1",
+        "mapred.job.shuffle.merge.percent" : "0.66",
+        "mapred.child.root.logger" : "INFO,TLA"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=hive-site&tag=version1",
+      "tag" : "version1",
+      "type" : "hive-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "javax.jdo.option.ConnectionPassword" : "h",
+        "hive.metastore.uris" : "thrift://dev.hortonworks.com:9083",
+        "hadoop.clientside.fs.operations" : "true",
+        "hive.metastore.cache.pinobjtypes" : "Table,Database,Type,FieldSchema,Order",
+        "hive.metastore.execute.setugi" : "true",
+        "hive.metastore.local" : "false",
+        "fs.hdfs.impl.disable.cache" : "true",
+        "javax.jdo.option.ConnectionURL" : "jdbc:mysql://dev.hortonworks.com/hive?createDatabaseIfNotExist=true",
+        "hive.semantic.analyzer.factory.impl" : "org.apache.hivealog.cli.HCatSemanticAnalyzerFactory",
+        "hive.security.authorization.enabled" : "true",
+        "javax.jdo.option.ConnectionUserName" : "hive",
+        "hive.server2.enable.doAs" : "true",
+        "hive.metastore.client.socket.timeout" : "60",
+        "hive.metastore.warehouse.dir" : "/apps/hive/warehouse",
+        "hive.security.authorization.manager" : "org.apache.hcatalog.security.HdfsAuthorizationProvider",
+        "javax.jdo.option.ConnectionDriverName" : "com.mysql.jdbc.Driver"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=mapred-queue-acls&tag=version1",
+      "tag" : "version1",
+      "type" : "mapred-queue-acls",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "mapred.queue.default.acl-submit-job" : "* *",
+        "mapred.queue.default.acl-administer-jobs" : "* *",
+        "mapred.queue.new_qeuue.acl-administer-jobs" : "* *",
+        "mapred.queue.new_qeuue.acl-submit-job" : "* *"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=core-site&tag=version1",
+      "tag" : "version1",
+      "type" : "core-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "io.serializations" : "org.apache.hadoop.io.serializer.WritableSerialization",
+        "hadoop.proxyuser.hive.hosts" : "dev.hortonworks.com",
+        "fs.checkpoint.size" : "0.5",
+        "io.file.buffer.size" : "131072",
+        "hadoop.proxyuser.hcat.hosts" : "dev.hortonworks.com",
+        "fs.checkpoint.period" : "21600",
+        "io.compression.codec.lzo.class" : "com.hadoop.compression.lzo.LzoCodec",
+        "ipc.client.connection.maxidletime" : "30000",
+        "hadoop.proxyuser.hive.groups" : "users",
+        "webinterface.private.actions" : "false",
+        "hadoop.proxyuser.oozie.groups" : "users",
+        "fs.checkpoint.edits.dir" : "/hadoop/hdfs/namesecondary",
+        "fs.trash.interval" : "360",
+        "fs.default.name" : "hdfs://dev.hortonworks.com:8020",
+        "hadoop.proxyuser.hcat.groups" : "users",
+        "ipc.client.idlethreshold" : "8000",
+        "fs.checkpoint.dir" : "/hadoop/hdfs/namesecondary",
+        "ipc.client.connect.max.retries" : "50",
+        "hadoop.proxyuser.oozie.hosts" : "dev.hortonworks.com"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=oozie-site&tag=version1",
+      "tag" : "version1",
+      "type" : "oozie-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "oozie.service.AuthorizationService.security.enabled" : "true",
+        "oozie.service.PurgeService.purge.interval" : "3600",
+        "oozie.service.PurgeService.older.than" : "30",
+        "oozie.system.id" : "oozie-${user.name}",
+        "oozie.service.coord.normal.default.timeout" : "120",
+        "oozie.service.JPAService.pool.max.active.conn" : "10",
+        "oozie.authentication.type" : "simple",
+        "use.system.libpath.for.mapreduce.and.pig.jobs" : "false",
+        "oozie.service.CallableQueueService.callable.concurrency" : "3",
+        "oozie.service.CallableQueueService.threads" : "10",
+        "oozie.base.url" : "http://dev.hortonworks.com:11000/oozie",
+        "oozie.service.JPAService.jdbc.username" : "sa",
+        "oozie.service.CallableQueueService.queue.size" : "1000",
+        "oozie.authentication.kerberos.name.rules" : "\n        RULE:[2:$1@$0]([jt]t@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-MAPREDUSER/\n        RULE:[2:$1@$0]([nd]n@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HDFSUSER/\n        RULE:[2:$1@$0](hm@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n        RULE:[2:$1@$0](rs@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n        DEFAULT\n        ",
+        "oozie.service.HadoopAccessorService.nameNode.whitelist" : " ",
+        "oozie.service.SchemaService.wf.ext.schemas" : "shell-action-0.1.xsd,email-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd,ssh-action-0.1.xsd,distcp-action-0.1.xsd",
+        "oozie.service.WorkflowAppService.system.libpath" : "/user/${user.name}/share/lib",
+        "oozie.systemmode" : "NORMAL",
+        "oozie.service.JPAService.create.db.schema" : "false",
+        "oozie.service.JPAService.jdbc.password" : " ",
+        "oozie.service.HadoopAccessorService.jobTracker.whitelist" : " ",
+        "oozie.db.schema.name" : "oozie",
+        "oozie.service.JPAService.jdbc.url" : "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true",
+        "oozie.service.JPAService.jdbc.driver" : "org.apache.derby.jdbc.EmbeddedDriver",
+        "oozie.service.HadoopAccessorService.hadoop.configurations" : "*=/etc/hadoop/conf",
+        "oozie.service.ActionService.executor.ext.classes" : "\n            org.apache.oozie.action.email.EmailActionExecutor,\n            org.apache.oozie.action.hadoop.HiveActionExecutor,\n            org.apache.oozie.action.hadoop.ShellActionExecutor,\n            org.apache.oozie.action.hadoop.SqoopActionExecutor,\n            org.apache.oozie.action.hadoop.DistcpActionExecutor\n        "
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=capacity-scheduler&tag=version1",
+      "tag" : "version1",
+      "type" : "capacity-scheduler",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "mapred.capacity-scheduler.queue.default.user-limit-factor" : "1",
+        "mapred.capacity-scheduler.queue.new_qeuue.maximum-initialized-active-tasks" : "200000",
+        "mapred.capacity-scheduler.queue.default.maximum-initialized-active-tasks" : "200000",
+        "mapred.capacity-scheduler.queue.default.maximum-capacity" : "100",
+        "mapred.capacity-scheduler.queue.new_qeuue.init-accept-jobs-factor" : "10",
+        "property" : "10",
+        "mapred.capacity-scheduler.queue.new_qeuue.capacity" : "23",
+        "mapred.capacity-scheduler.queue.default.init-accept-jobs-factor" : "10",
+        "mapred.capacity-scheduler.queue.new_qeuue.maximum-initialized-active-tasks-per-user" : "100000",
+        "mapred.capacity-scheduler.queue.default.capacity" : "50",
+        "mapred.capacity-scheduler.queue.new_qeuue.minimum-user-limit-percent" : "100",
+        "mapred.capacity-scheduler.queue.new_qeuue.user-limit-factor" : "1",
+        "mapred.capacity-scheduler.queue.default.minimum-user-limit-percent" : "100",
+        "mapred.capacity-scheduler.queue.default.maximum-initialized-active-tasks-per-user" : "100000",
+        "mapred.capacity-scheduler.maximum-system-jobs" : "2000",
+        "mapred.capacity-scheduler.queue.new_qeuue.maximum-capacity" : "100",
+        "mapred.capacity-scheduler.queue.default.supports-priority" : "false",
+        "mapred.capacity-scheduler.queue.new_qeuue.supports-priority" : "true"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=hdfs-site&tag=version1",
+      "tag" : "version1",
+      "type" : "hdfs-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "dfs.https.address" : "dev.hortonworks.com:50470",
+        "dfs.http.address" : "dev.hortonworks.com:50070",
+        "dfs.datanode.max.xcievers" : "4096",
+        "dfs.safemode.threshold.pct" : "1.0f",
+        "dfs.datanode.http.address" : "0.0.0.0:50075",
+        "dfs.datanode.address" : "0.0.0.0:50010",
+        "dfs.datanode.failed.volumes.tolerated" : "0",
+        "dfs.namenode.keytab.file" : "/etc/security/keytabs/nn.service.keytab",
+        "ipc.server.read.threadpool.size" : "5",
+        "dfs.datanode.data.dir.perm" : "750",
+        "dfs.datanode.du.pct" : "0.85f",
+        "ipc.server.max.response.size" : "5242880",
+        "dfs.datanode.du.reserved" : "1",
+        "dfs.datanode.socket.write.timeout" : "0",
+        "dfs.namenode.handler.count" : "40",
+        "dfs.web.ugi" : "gopher,gopher",
+        "dfs.datanode.keytab.file" : "/etc/security/keytabs/dn.service.keytab",
+        "dfs.name.dir" : "/hadoop/hdfs/namenode",
+        "dfs.heartbeat.interval" : "3",
+        "dfs.balance.bandwidthPerSec" : "6250000",
+        "dfs.permissions.supergroup" : "hdfs",
+        "dfs.cluster.administrators" : " hdfs",
+        "dfs.secondary.namenode.keytab.file" : "/etc/security/keytabs/nn.service.keytab",
+        "dfs.hosts.exclude" : "/etc/hadoop/dfs.exclude",
+        "dfs.permissions" : "true",
+        "dfs.namenode.kerberos.https.principal" : "host/_HOST@EXAMPLE.COM",
+        "dfs.datanode.kerberos.principal" : "dn/_HOST@EXAMPLE.COM",
+        "dfs.web.authentication.kerberos.keytab" : "/etc/security/keytabs/spnego.service.keytab",
+        "dfs.webhdfs.enabled" : "false",
+        "dfs.secondary.namenode.kerberos.https.principal" : "host/_HOST@EXAMPLE.COM",
+        "dfs.secondary.https.port" : "50490",
+        "dfs.block.size" : "134217728",
+        "dfs.datanode.ipc.address" : "0.0.0.0:8010",
+        "dfs.data.dir" : "/hadoop/hdfs/data",
+        "dfs.access.time.precision" : "0",
+        "dfs.blockreport.initialDelay" : "120",
+        "dfs.https.port" : "50470",
+        "dfs.block.access.token.enable" : "true",
+        "dfs.umaskmode" : "077",
+        "dfs.replication" : "3",
+        "dfs.secondary.http.address" : "dev.hortonworks.com:50090",
+        "dfs.secondary.namenode.kerberos.principal" : "nn/_HOST@EXAMPLE.COM",
+        "dfs.replication.max" : "50",
+        "dfs.hosts" : "/etc/hadoop/dfs.include",
+        "dfs.block.local-path-access.user" : "hbase",
+        "dfs.namenode.kerberos.principal" : "nn/_HOST@EXAMPLE.COM"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=webhcat-site&tag=version1",
+      "tag" : "version1",
+      "type" : "webhcat-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "templeton.hcat" : "/usr/bin/hcat",
+        "templeton.storage.class" : "org.apache.hcatalog.templeton.tool.ZooKeeperStorage",
+        "templeton.jar" : "/usr/lib/hcatalog/share/webhcat/svr/webhcat.jar",
+        "templeton.streaming.jar" : "hdfs:///apps/webhcat/hadoop-streaming.jar",
+        "templeton.pig.path" : "pig.tar.gz/pig/bin/pig",
+        "templeton.exec.timeout" : "60000",
+        "templeton.override.enabled" : "false",
+        "templeton.hive.properties" : "hive.metastore.local=false,hive.metastore.uris=thrift://dev.hortonworks.com:9083,hive.metastore.sasl.enabled=yes,hive.metastore.execute.setugi=true",
+        "templeton.hive.archive" : "hdfs:///apps/webhcat/hive.tar.gz",
+        "templeton.port" : "50111",
+        "templeton.libjars" : "/usr/lib/zookeeper/zookeeper.jar",
+        "templeton.hadoop" : "/usr/bin/hadoop",
+        "templeton.pig.archive" : "hdfs:///apps/webhcat/pig.tar.gz",
+        "templeton.zookeeper.hosts" : "dev.hortonworks.com:2181",
+        "templeton.hadoop.conf.dir" : "/etc/hadoop/conf",
+        "templeton.hive.path" : "hive.tar.gz/hive/bin/hive"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=hbase-site&tag=version1",
+      "tag" : "version1",
+      "type" : "hbase-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "hbase.hregion.memstore.flush.size" : "134217728",
+        "hbase.hstore.compactionThreshold" : "3",
+        "hbase.regionserver.global.memstore.upperLimit" : "0.4",
+        "dfs.support.append" : "true",
+        "hbase.hregion.majorcompaction" : "86400000",
+        "hbase.client.keyvalue.maxsize" : "10485760",
+        "hbase.client.scanner.caching" : "100",
+        "hbase.cluster.distributed" : "true",
+        "hbase.rootdir" : "hdfs://dev.hortonworks.com:8020/apps/hbase/data",
+        "hbase.regionserver.kerberos.principal" : "rs/_HOST@EXAMPLE.COM",
+        "hbase.regionserver.global.memstore.lowerLimit" : "0.35",
+        "hbase.regionserver.handler.count" : "30",
+        "hbase.superuser" : "hbase",
+        "hbase.tmp.dir" : "/var/log/hbase",
+        "hbase.hregion.memstore.mslab.enabled" : "true",
+        "hbase.regionserver.optionalcacheflushinterval" : "10000",
+        "hbase.hstore.blockingStoreFiles" : "7",
+        "hbase.zookeeper.useMulti" : "true",
+        "hfile.block.cache.size" : "0.25",
+        "hbase.hregion.max.filesize" : "1073741824",
+        "hbase.master.lease.thread.wakefrequency" : "3000",
+        "dfs.client.read.shortcircuit.skip.checksum" : "false",
+        "hbase.hregion.memstore.block.multiplier" : "2",
+        "hbase.master.kerberos.principal" : "hm/_HOST@EXAMPLE.COM",
+        "hbase.zookeeper.property.clientPort" : "2181",
+        "zookeeper.session.timeout" : "60000",
+        "hbase.master.keytab.file" : "/etc/security/keytabs/hm.service.keytab",
+        "dfs.client.read.shortcircuit" : "true",
+        "hbase.zookeeper.quorum" : "dev.hortonworks.com"
+      }
+    },
+    {
+      "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/configurations?type=hue-site&tag=version1",
+      "tag" : "version1",
+      "type" : "hue-site",
+      "Config" : {
+        "cluster_name" : "tdk"
+      },
+      "properties" : {
+        "hadoop_mapred_home" : "/usr/lib/hadoop/lib",
+        "smtp_host" : "localhost",
+        "use_cherrypy_server" : "false",
+        "hbase_shell_command" : "/usr/bin/hbase shell",
+        "db_name" : "sandbox",
+        "db_password" : "1111",
+        "send_debug_messages" : "1",
+        "http_host" : "0.0.0.0",
+        "django_debug_mode" : "1",
+        "pig_shell_command" : "/usr/bin/pig -l /dev/null",
+        "http_port" : "8000",
+        "db_engine" : "mysql",
+        "whitelist" : "(localhost|127\\.0\\.0\\.1):(50030|50070|50060|50075|50111)",
+        "hbase_nice_name" : "HBase Shell",
+        "backend_auth_policy" : "desktop.auth.backend.AllowAllBackend",
+        "smtp_password" : "25",
+        "default_from_email" : "sandbox@hortonworks.com",
+        "tls" : "no",
+        "db_user" : "sandbox",
+        "db_host" : "localhost",
+        "database_logging" : "0",
+        "smtp_port" : "25",
+        "time_zone" : "America/Los_Angeles",
+        "bash_shell_command" : "/bin/bash",
+        "http_500_debug_mode" : "1",
+        "db_port" : "3306",
+        "jobtracker_port" : "50030"
+      }
+    },
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=global&tag=version1",
+      "tag" : "version1",
+      "type" : "global",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "hdfs_enable_shortcircuit_skipchecksum" : "false",
+        "hadoop_heapsize" : "1024",
+        "hive_lib" : "/usr/lib/hive/lib/",
+        "hive_mysql_hostname" : "dev.hortonworks.com",
+        "hive_log_dir" : "/var/log/hive",
+        "dfs_datanode_http_address" : "50075",
+        "io_sort_mb" : "200",
+        "zk_user" : "zookeeper",
+        "dfs_data_dir" : "/hadoop/hdfs/data",
+        "clientPort" : "2181",
+        "hdfs_user" : "hdfs",
+        "hive_dbroot" : "/usr/lib/hive/lib",
+        "dfs_name_dir" : "/hadoop/hdfs/namenode",
+        "hfile_blockcache_size" : "0.25",
+        "kadmin_pw" : "",
+        "gmond_user" : "nobody",
+        "hregion_majorcompaction" : "86400000",
+        "user_group" : "hadoop",
+        "dfs_datanode_failed_volume_tolerated" : "0",
+        "zk_pid_file" : "/var/run/zookeeper/zookeeper_server.pid",
+        "zookeeper_sessiontimeout" : "60000",
+        "hcat_user" : "hcat",
+        "zk_log_dir" : "/var/log/zookeeper",
+        "hbase_conf_dir" : "/etc/hbase",
+        "mapred_local_dir" : "/hadoop/mapred",
+        "oozie_data_dir" : "/hadoop/oozie/data",
+        "dfs_replication" : "3",
+        "fs_checkpoint_period" : "21600",
+        "hbase_hdfs_root_dir" : "/apps/hbase/data",
+        "run_dir" : "/var/run/hadoop",
+        "oozie_log_dir" : "/var/log/oozie",
+        "hive_user" : "hive",
+        "hbase_pid_dir" : "/var/run/hbase",
+        "security_enabled" : "false",
+        "mapred_job_red_mem_mb" : "-1",
+        "mapred_map_tasks_max" : "4",
+        "dfs_datanode_address" : "50010",
+        "mapred_hosts_exclude" : "mapred.exclude",
+        "dfs_block_local_path_access_user" : "hbase",
+        "dfs_datanode_data_dir_perm" : "750",
+        "nagios_web_password" : "n",
+        "dtnode_heapsize" : "1024m",
+        "tickTime" : "2000",
+        "mapred_cluster_max_map_mem_mb" : "-1",
+        "datanode_du_reserved" : "1",
+        "regionserver_memstore_upperlimit" : "0.4",
+        "hbase_tmp_dir" : "/var/log/hbase",
+        "jtnode_opt_newsize" : "200m",
+        "oozie_user" : "oozie",
+        "mapred_jobstatus_dir" : "file:////mapred/jobstatus",
+        "hive_metastore_port" : "9083",
+        "namenode_heapsize" : "1024m",
+        "nagios_contact" : "n@n.com",
+        "mapred_cluster_red_mem_mb" : "-1",
+        "hive_ambari_database" : "MySQL",
+        "zk_data_dir" : "/hadoop/zookeeper",
+        "hive_pid_dir" : "/var/run/hive",
+        "mysql_connector_url" : "${download_url}/mysql-connector-java-5.1.18.zip",
+        "jtnode_opt_maxnewsize" : "200m",
+        "hregion_blockmultiplier" : "2",
+        "oozie_pid_dir" : "/var/run/oozie",
+        "pig_user" : "pig",
+        "task_controller" : "org.apache.hadoop.mapred.DefaultTaskController",
+        "rca_enabled" : "true",
+        "gmetad_user" : "nobody",
+        "gpl_artifacts_download_url" : "",
+        "hive_metastore_user_passwd" : "h",
+        "hcat_log_dir" : "/var/log/webhcat",
+        "jtnode_heapsize" : "1024m",
+        "syncLimit" : "5",
+        "io_sort_spill_percent" : "0.9",
+        "mapred_user" : "mapred",
+        "fs_checkpoint_size" : "0.5",
+        "initLimit" : "10",
+        "mapred_system_dir" : "/mapred/system",
+        "hive_database" : "New MySQL Database",
+        "mapred_job_map_mem_mb" : "-1",
+        "hive_conf_dir" : "/etc/hive/conf",
+        "hdfs_log_dir_prefix" : "/var/log/hadoop",
+        "keytab_path" : "/etc/security/keytabs",
+        "lzo_enabled" : "false",
+        "proxyuser_group" : "users",
+        "hive_database_name" : "hive",
+        "hcat_pid_dir" : "/var/run/webhcat",
+        "client_scannercaching" : "100",
+        "hdfs_enable_shortcircuit_read" : "true",
+        "kerberos_domain" : "EXAMPLE.COM",
+        "hdfs_support_append" : "true",
+        "nagios_group" : "nagios",
+        "nagios_web_login" : "nagiosadmin",
+        "namenode_formatted_mark_dir" : "/var/run/hadoop/hdfs/namenode/formatted/",
+        "dfs_exclude" : "dfs.exclude",
+        "namenode_opt_maxnewsize" : "640m",
+        "regionserver_memstore_lab" : "true",
+        "namenode_opt_newsize" : "200m",
+        "mapreduce_userlog_retainhours" : "24",
+        "hcat_conf_dir" : "",
+        "nagios_user" : "nagios",
+        "mapred_child_java_opts_sz" : "768",
+        "mapred_red_tasks_max" : "2",
+        "regionserver_memstore_lowerlimit" : "0.35",
+        "apache_artifacts_download_url" : "",
+        "hive_metastore_user_name" : "hive",
+        "mapred_hosts_include" : "mapred.include",
+        "hstore_blockingstorefiles" : "7",
+        "sqoop_user" : "sqoop",
+        "hadoop_conf_dir" : "/etc/hadoop",
+        "hbase_user" : "hbase",
+        "snappy_enabled" : "true",
+        "maxtasks_per_job" : "-1",
+        "ganglia_runtime_dir" : "/var/run/ganglia/hdp",
+        "fs_checkpoint_dir" : "/hadoop/hdfs/namesecondary",
+        "zk_pid_dir" : "/var/run/zookeeper",
+        "mapred_cluster_map_mem_mb" : "-1",
+        "hfile_max_keyvalue_size" : "10485760",
+        "hive_aux_jars_path" : "/usr/lib/hcatalog/share/hcatalog/hcatalog-core.jar",
+        "hstore_compactionthreshold" : "3",
+        "hregion_memstoreflushsize" : "134217728",
+        "hadoop_pid_dir_prefix" : "/var/run/hadoop",
+        "hbase_log_dir" : "/var/log/hbase",
+        "mapred_cluster_max_red_mem_mb" : "-1",
+        "webhcat_user" : "hcat",
+        "regionserver_handlers" : "30",
+        "hbase_regionserver_heapsize" : "1024m",
+        "dfs_include" : "dfs.include",
+        "dfs_webhdfs_enabled" : "false",
+        "scheduler_name" : "org.apache.hadoop.mapred.CapacityTaskScheduler",
+        "rrdcached_base_dir" : "/var/lib/ganglia/rrds",
+        "hstorefile_maxsize" : "1073741824",
+        "hbase_master_heapsize" : "1024m"
+      }
+    }
+  ]
+}

+ 16 - 0
ambari-web/app/assets/data/configurations/host_level_overrides_configs.json

@@ -0,0 +1,16 @@
+{
+  "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=oozie-site&tag=1283557_dev.hortonworks.com",
+  "items" : [
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/vmc/configurations?type=oozie-site&tag=1283557_dev.hortonworks.com",
+      "tag" : "1283557_dev.hortonworks.com",
+      "type" : "oozie-site",
+      "Config" : {
+        "cluster_name" : "vmc"
+      },
+      "properties" : {
+        "oozie.service.PurgeService.purge.interval" : "44334"
+      }
+    }
+  ]
+}

+ 218 - 4
ambari-web/app/assets/data/dashboard/services.json

@@ -120,6 +120,7 @@
                   "hbase-site" : "version1",
                   "hbase-site" : "version1",
                   "global" : "version1"
                   "global" : "version1"
                 },
                 },
+                "ha_status" : "active",
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
                 "desired_state" : "STARTED",
                 "desired_state" : "STARTED",
@@ -417,6 +418,11 @@
                   "global" : "version1",
                   "global" : "version1",
                   "core-site" : "version1"
                   "core-site" : "version1"
                 },
                 },
+                "actual_configs" : {
+                  "hdfs-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
                 "desired_state" : "STARTED",
                 "desired_state" : "STARTED",
@@ -433,6 +439,11 @@
                   "global" : "version1",
                   "global" : "version1",
                   "core-site" : "version1"
                   "core-site" : "version1"
                 },
                 },
+                "actual_configs" : {
+                  "hdfs-site" : "version4",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
                 "desired_state" : "STARTED",
                 "desired_state" : "STARTED",
@@ -449,10 +460,15 @@
                   "global" : "version1",
                   "global" : "version1",
                   "core-site" : "version1"
                   "core-site" : "version1"
                 },
                 },
+                "actual_configs" : {
+                  "hdfs-site" : "version4",
+                  "global" : "version4",
+                  "core-site" : "version1"
+                },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
                 "desired_state" : "STARTED",
                 "desired_state" : "STARTED",
-                "state" : "STARTED",
+                "state" : "UPGRADE_FAILED",
                 "component_name" : "DATANODE",
                 "component_name" : "DATANODE",
                 "host_name" : "ip-10-191-202-42.ec2.internal"
                 "host_name" : "ip-10-191-202-42.ec2.internal"
               }
               }
@@ -465,6 +481,11 @@
                   "global" : "version1",
                   "global" : "version1",
                   "core-site" : "version1"
                   "core-site" : "version1"
                 },
                 },
+                "actual_configs" : {
+                  "hdfs-site" : "version4",
+                  "global" : "version4",
+                  "core-site" : "version4"
+                },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
                 "desired_state" : "STARTED",
                 "desired_state" : "STARTED",
@@ -477,9 +498,14 @@
               "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/DATANODE",
               "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/DATANODE",
               "HostRoles" : {
               "HostRoles" : {
                 "configs" : {
                 "configs" : {
-                  "hdfs-site" : "version1",
-                  "global" : "version1",
-                  "core-site" : "version1"
+                  "hdfs-site" : "version4",
+                  "global" : "version4",
+                  "core-site" : "version4"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : "version4",
+                  "global" : "version4",
+                  "core-site" : "version4"
                 },
                 },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
@@ -529,6 +555,11 @@
                   "global" : "version1",
                   "global" : "version1",
                   "core-site" : "version1"
                   "core-site" : "version1"
                 },
                 },
+                "actual_configs" : {
+                  "hdfs-site" : "version4",
+                  "global" : "version4",
+                  "core-site" : "version4"
+                },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
                 "desired_state" : "STARTED",
                 "desired_state" : "STARTED",
@@ -557,6 +588,11 @@
                   "global" : "version1",
                   "global" : "version1",
                   "core-site" : "version1"
                   "core-site" : "version1"
                 },
                 },
+                "actual_configs" : {
+                  "hdfs-site" : "version4",
+                  "global" : "version4",
+                  "core-site" : "version4"
+                },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
                 "desired_state" : "STARTED",
                 "desired_state" : "STARTED",
@@ -965,6 +1001,76 @@
         }
         }
       ]
       ]
     },
     },
+    {
+      "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/services/HUE",
+      "ServiceInfo" : {
+        "cluster_name" : "tdk",
+        "service_name" : "HUE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/services/HUE/components/HUE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "tdk",
+            "state" : "INSTALLED",
+            "component_name" : "HUE_SERVER",
+            "service_name" : "HUE",
+            "desired_configs" : { }
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/hosts/ip-10-147-169-187.ec2.internal/host_components/HUE_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "tdk",
+                "ha_status" : "passive",
+                "desired_state" : "INSTALLED",
+                "state" : "St",
+                "component_name" : "HUE_SERVER",
+                "service_name" : "HUE",
+                "host_name" : "ip-10-147-169-187.ec2.internal",
+                "configs" : { },
+                "desired_configs" : { }
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/services/HUE",
+      "ServiceInfo" : {
+        "cluster_name" : "tdk",
+        "service_name" : "HUE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/services/HUE/components/HUE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "tdk",
+            "state" : "INSTALLED",
+            "component_name" : "HUE_SERVER",
+            "service_name" : "HUE",
+            "desired_configs" : { }
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/hosts/ip-10-147-169-187.ec2.internal/host_components/HUE_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "tdk",
+                "ha_status" : "passive",
+                "desired_state" : "INSTALLED",
+                "state" : "St",
+                "component_name" : "HUE_SERVER",
+                "service_name" : "HUE",
+                "host_name" : "ip-10-147-169-187.ec2.internal",
+                "configs" : { },
+                "desired_configs" : { }
+              }
+            }
+          ]
+        }
+      ]
+    },
     {
     {
       "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/WEBHCAT",
       "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/WEBHCAT",
       "ServiceInfo" : {
       "ServiceInfo" : {
@@ -1001,6 +1107,114 @@
         }
         }
       ]
       ]
     },
     },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HUE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE/components/HUE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "HUE_SERVER",
+            "service_name" : "HUE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HUE_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "hue-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HUE_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HUE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE/components/HUE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "HUE_SERVER",
+            "service_name" : "HUE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HUE_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "hue-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HUE_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HUE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE/components/HUE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "HUE_SERVER",
+            "service_name" : "HUE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HUE_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "hue-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HUE_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
     {
     {
       "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/PIG",
       "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/PIG",
       "ServiceInfo" : {
       "ServiceInfo" : {

+ 277 - 0
ambari-web/app/assets/data/hosts/hosts.json

@@ -1,6 +1,275 @@
 {
 {
   "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts?fields=Hosts,host_components,metrics/cpu,metrics/disk,metrics/load,metrics/memory&_=1358264805279",
   "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts?fields=Hosts,host_components,metrics/cpu,metrics/disk,metrics/load,metrics/memory&_=1358264805279",
   "items" : [
   "items" : [
+  {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com",
+      "metrics" : {
+        "disk" : {
+          "disk_total" : 101.515,
+          "disk_free" : 91.9097861111
+        },
+        "load" : {
+          "load_one" : 0.762361111111
+        }
+      },
+      "Hosts" : {
+        "host_status" : "HEALTHY",
+        "cpu_count" : 1,
+        "public_host_name" : "dev.hortonworks.com",
+        "cluster_name" : "mycluster",
+        "total_mem" : 2055208,
+        "os_arch" : "x86_64",
+        "host_name" : "dev.hortonworks.com",
+        "disk_info" : [
+          {
+            "available" : "45116168",
+            "used" : "5965836",
+            "percent" : "12%",
+            "size" : "51606140",
+            "type" : "ext4",
+            "mountpoint" : "/"
+          },
+          {
+            "available" : "1027152",
+            "used" : "312",
+            "percent" : "1%",
+            "size" : "1027464",
+            "type" : "tmpfs",
+            "mountpoint" : "/dev/shm"
+          },
+          {
+            "available" : "432210",
+            "used" : "38034",
+            "percent" : "9%",
+            "size" : "495844",
+            "type" : "ext4",
+            "mountpoint" : "/boot"
+          },
+          {
+            "available" : "44459772",
+            "used" : "184320",
+            "percent" : "1%",
+            "size" : "47033288",
+            "type" : "ext4",
+            "mountpoint" : "/home"
+          },
+          {
+            "available" : "188478012",
+            "used" : "298907228",
+            "percent" : "62%",
+            "size" : "487385240",
+            "type" : "vboxsf",
+            "mountpoint" : "/media/sf_git"
+          }
+        ],
+        "last_heartbeat_time" : 1362778488431,
+        "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "host_components" : [
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/TASKTRACKER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "TASKTRACKER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/MYSQL_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "MYSQL_SERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/MAPREDUCE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "MAPREDUCE_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/SQOOP",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "SQOOP",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/GANGLIA_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "GANGLIA_SERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HBASE_MASTER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "ha_status" : "NA",
+            "component_name" : "HBASE_MASTER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/DATANODE",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "DATANODE",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/JOBTRACKER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "JOBTRACKER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/NAGIOS_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "NAGIOS_SERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/GANGLIA_MONITOR",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "GANGLIA_MONITOR",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/ZOOKEEPER_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "ZOOKEEPER_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/PIG",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "PIG",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/OOZIE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "OOZIE_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/SECONDARY_NAMENODE",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "SECONDARY_NAMENODE",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HIVE_METASTORE",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HIVE_METASTORE",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HIVE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HIVE_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HBASE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HBASE_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HBASE_REGIONSERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HBASE_REGIONSERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/WEBHCAT_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "WEBHCAT_SERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HCAT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HCAT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HIVE_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HIVE_SERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/ZOOKEEPER_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "ZOOKEEPER_SERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/OOZIE_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "OOZIE_SERVER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/NAMENODE",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "NAMENODE",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HDFS_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HDFS_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        }
+      ]
+    },
     {
     {
       "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal",
       "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal",
       "metrics" : {
       "metrics" : {
@@ -1055,6 +1324,14 @@
             "component_name" : "HBASE_REGIONSERVER",
             "component_name" : "HBASE_REGIONSERVER",
             "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
             "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
           }
           }
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HUE_SERVER",
+          "HostRoles" : {
+            "cluster_name" : "cl1",
+            "component_name" : "HUE_SERVER",
+            "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+          }
         }
         }
       ]
       ]
     }
     }

+ 9 - 9
ambari-web/app/assets/data/mirroring/all_datasets.json

@@ -5,7 +5,7 @@
       "href":"http://ec2...com:8080/api/v1/feeds/feed1",
       "href":"http://ec2...com:8080/api/v1/feeds/feed1",
       "Feeds":{
       "Feeds":{
         "description":"test feed 1",
         "description":"test feed 1",
-        "name":"feed 1",
+        "name":"feed_1",
         "status":"SCHEDULED",
         "status":"SCHEDULED",
         "groups":"online,bi",
         "groups":"online,bi",
         "frequency":"minutes(1)",
         "frequency":"minutes(1)",
@@ -16,7 +16,7 @@
         "clusters":{
         "clusters":{
           "cluster":[
           "cluster":[
             {
             {
-              "name":"drsource",
+              "name":"drsource3",
               "type":"source",
               "type":"source",
               "validity":{
               "validity":{
                 "start":"2010-01-01T00:00Z",
                 "start":"2010-01-01T00:00Z",
@@ -28,7 +28,7 @@
               }
               }
             },
             },
             {
             {
-              "name":"drtarget",
+              "name":"drtarget3",
               "type":"target",
               "type":"target",
               "validity":{
               "validity":{
                 "start":"2010-01-01T00:00Z",
                 "start":"2010-01-01T00:00Z",
@@ -132,7 +132,7 @@
       "href":"http://ec2...com:8080/api/v1/feeds/feed2",
       "href":"http://ec2...com:8080/api/v1/feeds/feed2",
       "Feeds":{
       "Feeds":{
         "description":"test feed 2",
         "description":"test feed 2",
-        "name":"feed 2",
+        "name":"feed_2",
         "status":"SCHEDULED",
         "status":"SCHEDULED",
         "groups":"online,bi",
         "groups":"online,bi",
         "frequency":"minutes(1)",
         "frequency":"minutes(1)",
@@ -143,7 +143,7 @@
         "clusters":{
         "clusters":{
           "cluster":[
           "cluster":[
             {
             {
-              "name":"drsource",
+              "name":"drsource1",
               "type":"source",
               "type":"source",
               "validity":{
               "validity":{
                 "start":"2010-01-01T00:00Z",
                 "start":"2010-01-01T00:00Z",
@@ -155,7 +155,7 @@
               }
               }
             },
             },
             {
             {
-              "name":"drtarget",
+              "name":"drtarget1",
               "type":"target",
               "type":"target",
               "validity":{
               "validity":{
                 "start":"2010-01-01T00:00Z",
                 "start":"2010-01-01T00:00Z",
@@ -233,7 +233,7 @@
       "href":"http://ec2...com:8080/api/v1/feeds/feed1",
       "href":"http://ec2...com:8080/api/v1/feeds/feed1",
       "Feeds":{
       "Feeds":{
         "description":"feed 3",
         "description":"feed 3",
-        "name":"feed 3",
+        "name":"feed_3",
         "status":"SCHEDULED",
         "status":"SCHEDULED",
         "groups":"online,bi",
         "groups":"online,bi",
         "frequency":"minutes(1)",
         "frequency":"minutes(1)",
@@ -244,7 +244,7 @@
         "clusters":{
         "clusters":{
           "cluster":[
           "cluster":[
             {
             {
-              "name":"drsource",
+              "name":"drsource2",
               "type":"source",
               "type":"source",
               "validity":{
               "validity":{
                 "start":"2010-01-01T00:00Z",
                 "start":"2010-01-01T00:00Z",
@@ -256,7 +256,7 @@
               }
               }
             },
             },
             {
             {
-              "name":"drtarget",
+              "name":"drtarget2",
               "type":"target",
               "type":"target",
               "validity":{
               "validity":{
                 "start":"2010-01-01T00:00Z",
                 "start":"2010-01-01T00:00Z",

+ 60 - 0
ambari-web/app/assets/data/mirroring/poll/testConnection_poll1.json

@@ -0,0 +1,60 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "readonly",
+        "endpoint": "http://ec2...com:50070",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "write",
+        "endpoint": "hdfs://ec2...com:8020",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "workflow",
+        "endpoint": "http://ec2...com:11000/oozie/",
+        "version": "3.1"
+      }
+    }
+
+  ]
+}

+ 60 - 0
ambari-web/app/assets/data/mirroring/poll/testConnection_poll2.json

@@ -0,0 +1,60 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "SUCCESS",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "readonly",
+        "endpoint": "http://ec2...com:50070",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "write",
+        "endpoint": "hdfs://ec2...com:8020",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "workflow",
+        "endpoint": "http://ec2...com:11000/oozie/",
+        "version": "3.1"
+      }
+    }
+
+  ]
+}

+ 60 - 0
ambari-web/app/assets/data/mirroring/poll/testConnection_poll3.json

@@ -0,0 +1,60 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "SUCCESS",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "readonly",
+        "endpoint": "http://ec2...com:50070",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "SUCCESS",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "write",
+        "endpoint": "hdfs://ec2...com:8020",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "workflow",
+        "endpoint": "http://ec2...com:11000/oozie/",
+        "version": "3.1"
+      }
+    }
+
+  ]
+}

+ 60 - 0
ambari-web/app/assets/data/mirroring/poll/testConnection_poll4.json

@@ -0,0 +1,60 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "SUCCESS",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "readonly",
+        "endpoint": "http://ec2...com:50070",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "SUCCESS",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "write",
+        "endpoint": "hdfs://ec2...com:8020",
+        "version": "1.1.2.22"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "SUCCESS",
+        "command" : "CONNECT",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "type": "workflow",
+        "endpoint": "http://ec2...com:11000/oozie/",
+        "version": "3.1"
+      }
+    }
+
+  ]
+}

+ 1 - 2
ambari-web/app/assets/data/mirroring/upcoming_jobs.json

@@ -17,5 +17,4 @@
       "data" : 100
       "data" : 100
     }
     }
   ]
   ]
-}
-w
+}

+ 1676 - 0
ambari-web/app/assets/data/services/host_component_actual_configs.json

@@ -0,0 +1,1676 @@
+{
+  "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles&_=1358264805285",
+  "items" : [
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HBASE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HBASE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HBASE/components/HBASE_REGIONSERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "HBASE_REGIONSERVER",
+            "service_name" : "HBASE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HBASE_REGIONSERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "hbase-site" : "version1",
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HBASE_REGIONSERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/HBASE_REGIONSERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "hbase-site" : "version1",
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HBASE_REGIONSERVER",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/HBASE_REGIONSERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "hbase-site" : "version1",
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HBASE_REGIONSERVER",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/HBASE_REGIONSERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "hbase-site" : "version1",
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HBASE_REGIONSERVER",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/HBASE_REGIONSERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "hbase-site" : "version1",
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HBASE_REGIONSERVER",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HBASE/components/HBASE_MASTER",
+          "ServiceComponentInfo" : {
+            "MasterStartTime" : 1358245370553,
+            "MasterActiveTime" : 1358245370618,
+            "RegionsInTransition" : [ ],
+            "component_name" : "HBASE_MASTER",
+            "state" : "STARTED",
+            "HeapMemoryUsed" : 14455400,
+            "Revision" : "Unknown",
+            "service_name" : "HBASE",
+            "HeapMemoryMax" : 1069416448,
+            "AverageLoad" : 1.0,
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "Version" : "0.94.2.21"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/HBASE_MASTER",
+              "HostRoles" : {
+                "configs" : {
+                  "hbase-site" : "version1",
+                  "global" : "version1"
+                },
+                "ha_status" : "active",
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HBASE_MASTER",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HBASE/components/HBASE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "HBASE_CLIENT",
+            "service_name" : "HBASE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HBASE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HBASE_CLIENT",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/HBASE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HBASE_CLIENT",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/HBASE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HBASE_CLIENT",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/HBASE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HBASE_CLIENT",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/HBASE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HBASE_CLIENT",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/NAGIOS",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "NAGIOS"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/NAGIOS/components/NAGIOS_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "NAGIOS_SERVER",
+            "service_name" : "NAGIOS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/NAGIOS_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "NAGIOS_SERVER",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/SQOOP",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "SQOOP"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/SQOOP/components/SQOOP",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "SQOOP",
+            "service_name" : "SQOOP"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/SQOOP",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "SQOOP",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/SQOOP",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "SQOOP",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/SQOOP",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "SQOOP",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/SQOOP",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "SQOOP",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/SQOOP",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "SQOOP",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HDFS",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HDFS"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HDFS/components/HDFS_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "HDFS_CLIENT",
+            "service_name" : "HDFS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/HDFS_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HDFS_CLIENT",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/HDFS_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HDFS_CLIENT",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/HDFS_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HDFS_CLIENT",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/HDFS_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HDFS_CLIENT",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HDFS_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HDFS_CLIENT",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HDFS/components/DATANODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "DATANODE",
+            "service_name" : "HDFS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/DATANODE",
+              "HostRoles" : {
+                "configs" : {
+                  "hdfs-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : {
+                    "tag": "version1" 
+                  },
+                  "global" : {
+                    "tag": "version1" 
+                  },
+                  "core-site" : {
+                    "tag": "version1"   
+                  }
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "DATANODE",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/DATANODE",
+              "HostRoles" : {
+                "configs" : {
+                  "hdfs-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : {
+                    "tag": "version4" 
+                  },
+                  "global" : {
+                    "tag": "version1" 
+                  },
+                  "core-site" : {
+                    "tag": "version1"   
+                  }
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "DATANODE",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/DATANODE",
+              "HostRoles" : {
+                "configs" : {
+                  "hdfs-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : {
+                    "tag": "version4" 
+                  },
+                  "global" : {
+                    "tag": "version4" 
+                  },
+                  "core-site" : {
+                    "tag": "version1"   
+                  }
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "UPGRADE_FAILED",
+                "component_name" : "DATANODE",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/DATANODE",
+              "HostRoles" : {
+                "configs" : {
+                  "hdfs-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : {
+                    "tag": "version4" 
+                  },
+                  "global" : {
+                    "tag": "version4" 
+                  },
+                  "core-site" : {
+                    "tag": "version4"   
+                  }
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "DATANODE",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/DATANODE",
+              "HostRoles" : {
+                "configs" : {
+                  "hdfs-site" : "version4",
+                  "global" : "version4",
+                  "core-site" : "version4"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : {
+                    "tag": "version4" 
+                  },
+                  "global" : {
+                    "tag": "version4" 
+                  },
+                  "core-site" : {
+                    "tag": "version4"   
+                  }
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "DATANODE",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HDFS/components/NAMENODE",
+          "ServiceComponentInfo" : {
+            "PercentRemaining" : 94.86242,
+            "CapacityUsed" : 482971648,
+            "state" : "STARTED",
+            "HeapMemoryUsed" : 324295392,
+            "service_name" : "HDFS",
+            "UpgradeFinalized" : true,
+            "HeapMemoryMax" : 1006632960,
+            "DecomNodes" : "{}",
+            "Safemode" : "",
+            "CapacityRemaining" : 4210552782848,
+            "StartTime" : 1358245243704,
+            "Version" : "1.1.2.21, r",
+            "BlocksTotal" : 248,
+            "LiveNodes" : "{\"ip-10-110-38-164.ec2.internal\":{\"usedSpace\":87072768,\"lastContact\":1},\"ip-10-110-79-42.ec2.internal\":{\"usedSpace\":133492736,\"lastContact\":1},\"ip-10-191-202-42.ec2.internal\":{\"usedSpace\":65101824,\"lastContact\":1},\"domU-12-31-39-0E-E6-01.compute-1.internal\":{\"usedSpace\":160288768,\"lastContact\":0},\"domU-12-31-39-16-48-4B.compute-1.internal\":{\"usedSpace\":37015552,\"lastContact\":1}}",
+            "component_name" : "NAMENODE",
+            "PercentUsed" : 0.010881199,
+            "TotalFiles" : 375,
+            "NonDfsUsedSpace" : 227552702454,
+            "MissingBlocks" : 0,
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "UnderReplicatedBlocks" : 0,
+            "CapacityTotal" : 4438588456950,
+            "CorruptBlocks" : 0,
+            "DeadNodes" : "{}"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/NAMENODE",
+              "HostRoles" : {
+                "configs" : {
+                  "hdfs-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : {
+                    "tag": "version4"
+                  },
+                  "global" : {
+                    "tag": "version4"
+                  },
+                  "core-site" : {
+                    "tag": "version4"
+                  }
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "NAMENODE",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HDFS/components/SECONDARY_NAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "SECONDARY_NAMENODE",
+            "service_name" : "HDFS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/SECONDARY_NAMENODE",
+              "HostRoles" : {
+                "configs" : {
+                  "hdfs-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "actual_configs" : {
+                  "hdfs-site" : {
+                    "tag": "version4"
+                  },
+                  "global" : {
+                    "tag": "version4"
+                  },
+                  "core-site" : {
+                    "tag": "version4"
+                  }
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "SECONDARY_NAMENODE",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/MAPREDUCE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "MAPREDUCE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "MAPREDUCE_CLIENT",
+            "service_name" : "MAPREDUCE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/MAPREDUCE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "MAPREDUCE_CLIENT",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/MAPREDUCE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "MAPREDUCE_CLIENT",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/MAPREDUCE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "MAPREDUCE_CLIENT",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/MAPREDUCE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "MAPREDUCE_CLIENT",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/MAPREDUCE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "MAPREDUCE_CLIENT",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/MAPREDUCE/components/TASKTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "TASKTRACKER",
+            "service_name" : "MAPREDUCE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/TASKTRACKER",
+              "HostRoles" : {
+                "configs" : {
+                  "mapred-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "TASKTRACKER",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/TASKTRACKER",
+              "HostRoles" : {
+                "configs" : {
+                  "mapred-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "TASKTRACKER",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/TASKTRACKER",
+              "HostRoles" : {
+                "configs" : {
+                  "mapred-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "TASKTRACKER",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/TASKTRACKER",
+              "HostRoles" : {
+                "configs" : {
+                  "mapred-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "TASKTRACKER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/TASKTRACKER",
+              "HostRoles" : {
+                "configs" : {
+                  "mapred-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "TASKTRACKER",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/MAPREDUCE/components/JOBTRACKER",
+          "ServiceComponentInfo" : {
+            "component_name" : "JOBTRACKER",
+            "state" : "STARTED",
+            "HeapMemoryUsed" : 129384032,
+            "service_name" : "MAPREDUCE",
+            "HeapMemoryMax" : 1052770304,
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "jobs_running" : 0,
+            "BlackListedNodes" : "[]",
+            "StartTime" : 1358245381436,
+            "AliveNodes" : "[{\"hostname\":\"domU-12-31-39-16-48-4B.compute-1.internal\",\"last_seen\":1358264806195,\"health\":\"OK\",\"slots\":{\"map_slots\":4,\"map_slots_used\":0,\"reduce_slots\":2,\"reduce_slots_used\":0},\"failures\":0,\"dir_failures\":0},{\"hostname\":\"ip-10-110-38-164.ec2.internal\",\"last_seen\":1358264806343,\"health\":\"OK\",\"slots\":{\"map_slots\":4,\"map_slots_used\":0,\"reduce_slots\":2,\"reduce_slots_used\":0},\"failures\":0,\"dir_failures\":0},{\"hostname\":\"domU-12-31-39-0E-E6-01.compute-1.internal\",\"last_seen\":1358264806332,\"health\":\"OK\",\"slots\":{\"map_slots\":4,\"map_slots_used\":0,\"reduce_slots\":2,\"reduce_slots_used\":0},\"failures\":0,\"dir_failures\":0},{\"hostname\":\"ip-10-191-202-42.ec2.internal\",\"last_seen\":1358264806381,\"health\":\"OK\",\"slots\":{\"map_slots\":4,\"map_slots_used\":0,\"reduce_slots\":2,\"reduce_slots_used\":0},\"failures\":0,\"dir_failures\":0},{\"hostname\":\"ip-10-110-79-42.ec2.internal\",\"last_seen\":1358264806352,\"health\":\"OK\",\"slots\":{\"map_slots\":4,\"map_slots_used\":0,\"reduce_slots\":2,\"reduce_slots_used\":0},\"failures\":0,\"dir_failures\":0}]",
+            "Version" : "1.1.2.21, r",
+            "GrayListedNodes" : "[]",
+            "Queue" : {
+              "reserved_reduce_slots" : 0,
+              "running_300" : 0,
+              "jobs_completed" : 4,
+              "reserved_map_slots" : 0,
+              "running_0" : 0,
+              "waiting_maps" : 0,
+              "running_1440" : 0,
+              "running_60" : 0,
+              "jobs_submitted" : 4,
+              "waiting_reduces" : 0
+            },
+            "jobtracker" : {
+              "reserved_reduce_slots" : 0,
+              "running_maps" : 0,
+              "jobs_running" : 0,
+              "running_reduces" : 0,
+              "occupied_map_slots" : 0,
+              "reserved_map_slots" : 0,
+              "jobs_completed" : 4,
+              "waiting_maps" : 0,
+              "jobs_submitted" : 4,
+              "occupied_reduce_slots" : 0,
+              "waiting_reduces" : 0
+            }
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/JOBTRACKER",
+              "HostRoles" : {
+                "configs" : {
+                  "mapred-site" : "version1",
+                  "global" : "version1",
+                  "core-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "JOBTRACKER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HIVE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HIVE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HIVE/components/HIVE_METASTORE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "HIVE_METASTORE",
+            "service_name" : "HIVE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HIVE_METASTORE",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "hive-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HIVE_METASTORE",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HIVE/components/HIVE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "HIVE_CLIENT",
+            "service_name" : "HIVE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/HIVE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HIVE_CLIENT",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HIVE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HIVE_CLIENT",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/HIVE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HIVE_CLIENT",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/HIVE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HIVE_CLIENT",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/HIVE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HIVE_CLIENT",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HIVE/components/MYSQL_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "MYSQL_SERVER",
+            "service_name" : "HIVE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/MYSQL_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "hive-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "MYSQL_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HIVE/components/HIVE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "HIVE_SERVER",
+            "service_name" : "HIVE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HIVE_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "hive-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HIVE_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/services/HUE",
+      "ServiceInfo" : {
+        "cluster_name" : "tdk",
+        "service_name" : "HUE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/services/HUE/components/HUE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "tdk",
+            "state" : "INSTALLED",
+            "component_name" : "HUE_SERVER",
+            "service_name" : "HUE",
+            "desired_configs" : { }
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-23-20-184-220.compute-1.amazonaws.com:8080/api/v1/clusters/tdk/hosts/ip-10-147-169-187.ec2.internal/host_components/HUE_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "tdk",
+                "ha_status" : "passive",
+                "desired_state" : "INSTALLED",
+                "state" : "St",
+                "component_name" : "HUE_SERVER",
+                "service_name" : "HUE",
+                "host_name" : "ip-10-147-169-187.ec2.internal",
+                "configs" : { },
+                "desired_configs" : { }
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/WEBHCAT",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "WEBHCAT"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/WEBHCAT/components/WEBHCAT_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "WEBHCAT_SERVER",
+            "service_name" : "WEBHCAT"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/WEBHCAT_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "webhcat-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "WEBHCAT_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HUE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HUE/components/HUE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "HUE_SERVER",
+            "service_name" : "HUE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HUE_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "hue-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "HUE_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/PIG",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "PIG"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/PIG/components/PIG",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "PIG",
+            "service_name" : "PIG"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/PIG",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "PIG",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/PIG",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "PIG",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/PIG",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "PIG",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/PIG",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "PIG",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/PIG",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "PIG",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/GANGLIA",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "GANGLIA"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/GANGLIA/components/GANGLIA_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "GANGLIA_SERVER",
+            "service_name" : "GANGLIA"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/GANGLIA_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "GANGLIA_SERVER",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/GANGLIA/components/GANGLIA_MONITOR",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "GANGLIA_MONITOR",
+            "service_name" : "GANGLIA"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/GANGLIA_MONITOR",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "GANGLIA_MONITOR",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/GANGLIA_MONITOR",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "GANGLIA_MONITOR",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/GANGLIA_MONITOR",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "GANGLIA_MONITOR",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/GANGLIA_MONITOR",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "GANGLIA_MONITOR",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/GANGLIA_MONITOR",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "GANGLIA_MONITOR",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/OOZIE",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "OOZIE"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/OOZIE/components/OOZIE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "OOZIE_SERVER",
+            "service_name" : "OOZIE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/OOZIE_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1",
+                  "oozie-site" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "OOZIE_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/OOZIE/components/OOZIE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "OOZIE_CLIENT",
+            "service_name" : "OOZIE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/OOZIE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "OOZIE_CLIENT",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/OOZIE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "OOZIE_CLIENT",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/OOZIE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "OOZIE_CLIENT",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/OOZIE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "OOZIE_CLIENT",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/OOZIE_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "OOZIE_CLIENT",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HCATALOG",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "HCATALOG"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/HCATALOG/components/HCAT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "HCAT",
+            "service_name" : "HCATALOG"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/HCAT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HCAT",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/HCAT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HCAT",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/HCAT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HCAT",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/HCAT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HCAT",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/HCAT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "HCAT",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/ZOOKEEPER",
+      "ServiceInfo" : {
+        "cluster_name" : "cl1",
+        "service_name" : "ZOOKEEPER"
+      },
+      "components" : [
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/ZOOKEEPER/components/ZOOKEEPER_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "STARTED",
+            "component_name" : "ZOOKEEPER_SERVER",
+            "service_name" : "ZOOKEEPER"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/ZOOKEEPER_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "ZOOKEEPER_SERVER",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/ZOOKEEPER_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "ZOOKEEPER_SERVER",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/ZOOKEEPER_SERVER",
+              "HostRoles" : {
+                "configs" : {
+                  "global" : "version1"
+                },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
+                "component_name" : "ZOOKEEPER_SERVER",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/services/ZOOKEEPER/components/ZOOKEEPER_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "cl1",
+            "desired_configs" : { },
+            "state" : "INSTALLED",
+            "component_name" : "ZOOKEEPER_CLIENT",
+            "service_name" : "ZOOKEEPER"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-16-48-4B.compute-1.internal/host_components/ZOOKEEPER_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "ZOOKEEPER_CLIENT",
+                "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-191-202-42.ec2.internal/host_components/ZOOKEEPER_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "ZOOKEEPER_CLIENT",
+                "host_name" : "ip-10-191-202-42.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/domU-12-31-39-0E-E6-01.compute-1.internal/host_components/ZOOKEEPER_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "ZOOKEEPER_CLIENT",
+                "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-38-164.ec2.internal/host_components/ZOOKEEPER_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "ZOOKEEPER_CLIENT",
+                "host_name" : "ip-10-110-38-164.ec2.internal"
+              }
+            },
+            {
+              "href" : "http://ec2-184-73-46-113.compute-1.amazonaws.com:8080/api/v1/clusters/cl1/hosts/ip-10-110-79-42.ec2.internal/host_components/ZOOKEEPER_CLIENT",
+              "HostRoles" : {
+                "configs" : { },
+                "cluster_name" : "cl1",
+                "desired_configs" : { },
+                "desired_state" : "INSTALLED",
+                "state" : "INSTALLED",
+                "component_name" : "ZOOKEEPER_CLIENT",
+                "host_name" : "ip-10-110-79-42.ec2.internal"
+              }
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 7 - 0
ambari-web/app/assets/data/wizard/reassign/request_id.json

@@ -0,0 +1,7 @@
+{
+  "href" : "http://localhost:8080/api/v1/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1,
+    "status" : "InProgress"
+  }
+}

+ 383 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version/1.3.0.json

@@ -0,0 +1,383 @@
+{
+  "name" : "HDP",
+  "version" : "1.3.0",
+  "minUpgradeVersion" : null,
+  "repositories" : [ {
+    "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.3.0/repos/centos6",
+    "osType" : "centos6",
+    "repoId" : "HDP-1.3.0",
+    "repoName" : "HDP",
+    "mirrorsList" : null
+  }, {
+    "baseUrl" : null,
+    "osType" : "centos6",
+    "repoId" : "HDP-epel",
+    "repoName" : "HDP-epel",
+    "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch"
+  }, {
+    "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.3.0/repos/centos5",
+    "osType" : "centos5",
+    "repoId" : "HDP-1.3.0",
+    "repoName" : "HDP",
+    "mirrorsList" : null
+  }, {
+    "baseUrl" : null,
+    "osType" : "centos5",
+    "repoId" : "HDP-epel",
+    "repoName" : "HDP-epel",
+    "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch"
+  }, {
+    "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.3.0/repos/centos6",
+    "osType" : "redhat6",
+    "repoId" : "HDP-1.3.0",
+    "repoName" : "HDP",
+    "mirrorsList" : null
+  }, {
+    "baseUrl" : null,
+    "osType" : "redhat6",
+    "repoId" : "HDP-epel",
+    "repoName" : "HDP-epel",
+    "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch"
+  }, {
+    "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.3.0/repos/centos5",
+    "osType" : "redhat5",
+    "repoId" : "HDP-1.3.0",
+    "repoName" : "HDP",
+    "mirrorsList" : null
+  }, {
+    "baseUrl" : null,
+    "osType" : "redhat5",
+    "repoId" : "HDP-epel",
+    "repoName" : "HDP-epel",
+    "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch"
+  }, {
+    "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.3.0/repos/suse11",
+    "osType" : "suse11",
+    "repoId" : "HDP-1.3.0",
+    "repoName" : "HDP",
+    "mirrorsList" : null
+  }, {
+    "baseUrl" : "http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/suse11",
+    "osType" : "suse11",
+    "repoId" : "HDP-UTILS-1.1.0.15",
+    "repoName" : "HDP-UTILS",
+    "mirrorsList" : null
+  }, {
+    "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.3.0/repos/suse11",
+    "osType" : "sles11",
+    "repoId" : "HDP-1.3.0",
+    "repoName" : "HDP",
+    "mirrorsList" : null
+  }, {
+    "baseUrl" : "http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/suse11",
+    "osType" : "sles11",
+    "repoId" : "HDP-UTILS-1.1.0.15",
+    "repoName" : "HDP-UTILS",
+    "mirrorsList" : null
+  } ],
+  "services" : [ {
+    "name" : "GANGLIA",
+    "version" : "3.2.0",
+    "user" : "root",
+    "comment" : "Ganglia Metrics Collection system",
+    "components" : [ {
+      "name" : "GANGLIA_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "GANGLIA_MONITOR",
+      "category" : "SLAVE",
+      "client" : false,
+      "master" : false
+    }, {
+      "name" : "MONITOR_WEBSERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "GANGLIA_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }
+  }, {
+    "name" : "OOZIE",
+    "version" : "3.2.0",
+    "user" : "root",
+    "comment" : "System for workflow coordination and execution of Apache Hadoop jobs",
+    "components" : [ {
+      "name" : "OOZIE_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "OOZIE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "OOZIE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "MAPREDUCE",
+    "version" : "1.1.2",
+    "user" : "mapred",
+    "comment" : "Apache Hadoop Distributed Processing Framework",
+    "components" : [ {
+      "name" : "JOBTRACKER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "TASKTRACKER",
+      "category" : "SLAVE",
+      "client" : false,
+      "master" : false
+    }, {
+      "name" : "MAPREDUCE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "MAPREDUCE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "HIVE",
+    "version" : "0.10.0",
+    "user" : "root",
+    "comment" : "Data warehouse system for ad-hoc queries & analysis of large datasets and table & storage management service",
+    "components" : [ {
+      "name" : "HIVE_METASTORE",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "HIVE_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "MYSQL_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "HIVE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "HIVE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "HDFS",
+    "version" : "1.1.2",
+    "user" : "root",
+    "comment" : "Apache Hadoop Distributed File System",
+    "components" : [ {
+      "name" : "NAMENODE",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "DATANODE",
+      "category" : "SLAVE",
+      "client" : false,
+      "master" : false
+    }, {
+      "name" : "SECONDARY_NAMENODE",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "HDFS_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "HDFS_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "NAGIOS",
+    "version" : "3.2.3",
+    "user" : "root",
+    "comment" : "Nagios Monitoring and Alerting system",
+    "components" : [ {
+      "name" : "NAGIOS_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "NAGIOS_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }
+  }, {
+    "name" : "SQOOP",
+    "version" : "1.4.2",
+    "user" : "root",
+    "comment" : "Tool for transferring bulk data between Apache Hadoop and structured data stores such as relational databases",
+    "components" : [ {
+      "name" : "SQOOP",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : true,
+    "clientComponent" : {
+      "name" : "SQOOP",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "PIG",
+    "version" : "0.10.1",
+    "user" : "root",
+    "comment" : "Scripting platform for analyzing large datasets",
+    "components" : [ {
+      "name" : "PIG",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : true,
+    "clientComponent" : {
+      "name" : "PIG",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "HBASE",
+    "version" : "0.94.5",
+    "user" : "mapred",
+    "comment" : "Non-relational distributed database and centralized service for configuration management & synchronization",
+    "components" : [ {
+      "name" : "HBASE_MASTER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "HBASE_REGIONSERVER",
+      "category" : "SLAVE",
+      "client" : false,
+      "master" : false
+    }, {
+      "name" : "HBASE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "HBASE_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "HCATALOG",
+    "version" : "0.5.0",
+    "user" : "root",
+    "comment" : "This is comment for HCATALOG service",
+    "components" : [ {
+      "name" : "HCAT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : true,
+    "clientComponent" : {
+      "name" : "HCAT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "ZOOKEEPER",
+    "version" : "3.4.5",
+    "user" : "root",
+    "comment" : "This is comment for ZOOKEEPER service",
+    "components" : [ {
+      "name" : "ZOOKEEPER_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }, {
+      "name" : "ZOOKEEPER_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "ZOOKEEPER_CLIENT",
+      "category" : "CLIENT",
+      "client" : true,
+      "master" : false
+    }
+  }, {
+    "name" : "WEBHCAT",
+    "version" : "0.5.0",
+    "user" : "root",
+    "comment" : "This is comment for WEBHCAT service",
+    "components" : [ {
+      "name" : "WEBHCAT_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "WEBHCAT_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }
+  }, {
+    "name" : "HUE",
+    "version" : "2.2.0",
+    "user" : "root",
+    "comment" : "Hue is a graphical user interface to operate and develop\n      applications for Apache Hadoop.",
+    "components" : [ {
+      "name" : "HUE_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    } ],
+    "clientOnlyService" : false,
+    "clientComponent" : {
+      "name" : "HUE_SERVER",
+      "category" : "MASTER",
+      "client" : false,
+      "master" : true
+    }
+  } ]
+}

+ 60 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/HBASE.json

@@ -0,0 +1,60 @@
+{
+  "name" : "HBASE",
+  "version" : "0.94.5",
+  "user" : "mapred",
+  "comment" : "Non-relational distributed database and centralized service for configuration management & synchronization",
+  "properties" : [ {
+    "name" : "hbase.cluster.distributed",
+    "value" : "true",
+    "description" : "The mode the cluster will be in. Possible values are\n      false for standalone mode and true for distributed mode.  If\n      false, startup will run all HBase and ZooKeeper daemons together\n      in the one JVM.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.master.lease.thread.wakefrequency",
+    "value" : "3000",
+    "description" : "The interval between checks for expired region server leases.\n    This value has been reduced due to the other reduced values above so that\n    the master will notice a dead region server sooner. The default is 15 seconds.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.superuser",
+    "value" : "hbase",
+    "description" : "List of users or groups (comma-separated), who are allowed\n    full privileges, regardless of stored ACLs, across the cluster.\n    Only used when HBase security is enabled.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.zookeeper.property.clientPort",
+    "value" : "2181",
+    "description" : "Property from ZooKeeper's config zoo.cfg.\n    The port at which the clients will connect.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.regionserver.optionalcacheflushinterval",
+    "value" : "10000",
+    "description" : "\n      Amount of time to wait since the last time a region was flushed before\n      invoking an optional cache flush. Default 60,000.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.zookeeper.useMulti",
+    "value" : "true",
+    "description" : "Instructs HBase to make use of ZooKeeper's multi-update functionality.\n    This allows certain ZooKeeper operations to complete more quickly and prevents some issues\n    with rare Replication failure scenarios (see the release note of HBASE-2611 for an example).åá\n    IMPORTANT: only set this to true if all ZooKeeper servers in the cluster are on version 3.4+\n    and will not be downgraded.  ZooKeeper versions before 3.4 do not support multi-update and will\n    not fail gracefully if multi-update is invoked (see ZOOKEEPER-1495).\n    ",
+    "filename" : "hbase-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "HBASE_MASTER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HBASE_REGIONSERVER",
+    "category" : "SLAVE",
+    "client" : false,
+    "master" : false
+  }, {
+    "name" : "HBASE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "HBASE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 20 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/HCATALOG.json

@@ -0,0 +1,20 @@
+{
+  "name" : "HCATALOG",
+  "version" : "0.5.0",
+  "user" : "root",
+  "comment" : "This is comment for HCATALOG service",
+  "properties" : [ ],
+  "components" : [ {
+    "name" : "HCAT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : true,
+  "clientComponent" : {
+    "name" : "HCAT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 210 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/HDFS.json

@@ -0,0 +1,210 @@
+{
+  "name" : "HDFS",
+  "version" : "1.1.2",
+  "user" : "root",
+  "comment" : "Apache Hadoop Distributed File System",
+  "properties" : [ {
+    "name" : "dfs.datanode.socket.write.timeout",
+    "value" : "0",
+    "description" : "DFS Client write socket timeout",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.replication.max",
+    "value" : "50",
+    "description" : "Maximal block replication.\n  ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.heartbeat.interval",
+    "value" : "3",
+    "description" : "Determines datanode heartbeat interval in seconds.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.safemode.threshold.pct",
+    "value" : "1.0f",
+    "description" : "\n        Specifies the percentage of blocks that should satisfy\n        the minimal replication requirement defined by dfs.replication.min.\n        Values less than or equal to 0 mean not to start in safe mode.\n        Values greater than 1 will make safe mode permanent.\n        ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.balance.bandwidthPerSec",
+    "value" : "6250000",
+    "description" : "\n        Specifies the maximum amount of bandwidth that each datanode\n        can utilize for the balancing purpose in term of\n        the number of bytes per second.\n  ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.block.size",
+    "value" : "134217728",
+    "description" : "The default block size for new files.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.ipc.address",
+    "value" : "0.0.0.0:8010",
+    "description" : "\nThe datanode ipc server address and port.\nIf the port is 0 then the server will start on a free port.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.blockreport.initialDelay",
+    "value" : "120",
+    "description" : "Delay for first block report in seconds.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.du.pct",
+    "value" : "0.85f",
+    "description" : "When calculating remaining space, only use this percentage of the real available space\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.namenode.handler.count",
+    "value" : "40",
+    "description" : "The number of server threads for the namenode.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.max.xcievers",
+    "value" : "4096",
+    "description" : "PRIVATE CONFIG VARIABLE",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.umaskmode",
+    "value" : "077",
+    "description" : "\nThe octal umask used when creating files and directories.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.web.ugi",
+    "value" : "gopher,gopher",
+    "description" : "The user account used by the web interface.\nSyntax: USERNAME,GROUP1,GROUP2, ...\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.permissions",
+    "value" : "true",
+    "description" : "\nIf \"true\", enable permission checking in HDFS.\nIf \"false\", permission checking is turned off,\nbut all other behavior is unchanged.\nSwitching from one parameter value to the other does not change the mode,\nowner or group of files or directories.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.permissions.supergroup",
+    "value" : "hdfs",
+    "description" : "The name of the group of super-users.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.namenode.handler.count",
+    "value" : "100",
+    "description" : "Added to grow Queue size so that more client connections are allowed",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "ipc.server.max.response.size",
+    "value" : "5242880",
+    "description" : null,
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.block.access.token.enable",
+    "value" : "true",
+    "description" : "\nIf \"true\", access tokens are used as capabilities for accessing datanodes.\nIf \"false\", no access tokens are checked on accessing datanodes.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.secondary.https.port",
+    "value" : "50490",
+    "description" : "The https port where secondary-namenode binds",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.https.port",
+    "value" : "50470",
+    "description" : "The https port where namenode binds",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.access.time.precision",
+    "value" : "0",
+    "description" : "The access time for HDFS file is precise upto this value.\n               The default value is 1 hour. Setting a value of 0 disables\n               access times for HDFS.\n  ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.cluster.administrators",
+    "value" : " hdfs",
+    "description" : "ACL for who all can view the default servlets in the HDFS",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "ipc.server.read.threadpool.size",
+    "value" : "5",
+    "description" : null,
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.failed.volumes.tolerated",
+    "value" : "0",
+    "description" : "Number of failed disks datanode would tolerate",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "io.file.buffer.size",
+    "value" : "131072",
+    "description" : "The size of buffer for use in sequence files.\n  The size of this buffer should probably be a multiple of hardware\n  page size (4096 on Intel x86), and it determines how much data is\n  buffered during read and write operations.",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "io.serializations",
+    "value" : "org.apache.hadoop.io.serializer.WritableSerialization",
+    "description" : null,
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "io.compression.codec.lzo.class",
+    "value" : "com.hadoop.compression.lzo.LzoCodec",
+    "description" : "The implementation for lzo codec.",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.trash.interval",
+    "value" : "360",
+    "description" : "Number of minutes between trash checkpoints.\n  If zero, the trash feature is disabled.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.checkpoint.edits.dir",
+    "value" : "${fs.checkpoint.dir}",
+    "description" : "Determines where on the local filesystem the DFS secondary\n        name node should store the temporary edits to merge.\n        If this is a comma-delimited list of directoires then teh edits is\n        replicated in all of the directoires for redundancy.\n        Default value is same as fs.checkpoint.dir\n    ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.checkpoint.period",
+    "value" : "21600",
+    "description" : "The number of seconds between two periodic checkpoints.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.checkpoint.size",
+    "value" : "536870912",
+    "description" : "The size of the current edit log (in bytes) that triggers\n       a periodic checkpoint even if the fs.checkpoint.period hasn't expired.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "ipc.client.idlethreshold",
+    "value" : "8000",
+    "description" : "Defines the threshold number of connections after which\n               connections will be inspected for idleness.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "ipc.client.connection.maxidletime",
+    "value" : "30000",
+    "description" : "The maximum time after which a client will bring down the\n               connection to the server.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "ipc.client.connect.max.retries",
+    "value" : "50",
+    "description" : "Defines the maximum number of retries for IPC connections.",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "webinterface.private.actions",
+    "value" : "false",
+    "description" : " If set to true, the web interfaces of JT and NN may contain\n                actions, such as kill job, delete file, etc., that should\n                not be exposed to public. Enable this option if the interfaces\n                are only reachable by those who have the right authorization.\n  ",
+    "filename" : "core-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "NAMENODE",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "DATANODE",
+    "category" : "SLAVE",
+    "client" : false,
+    "master" : false
+  }, {
+    "name" : "SECONDARY_NAMENODE",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HDFS_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "HDFS_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 95 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/HIVE.json

@@ -0,0 +1,95 @@
+{
+  "name" : "HIVE",
+  "version" : "0.10.0",
+  "user" : "root",
+  "comment" : "Data warehouse system for ad-hoc queries & analysis of large datasets and table & storage management service",
+  "properties" : [ {
+    "name" : "hive.metastore.local",
+    "value" : "false",
+    "description" : "controls whether to connect to remove metastore server or\n    open a new metastore server in Hive Client JVM",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "javax.jdo.option.ConnectionDriverName",
+    "value" : "com.mysql.jdbc.Driver",
+    "description" : "Driver class name for a JDBC metastore",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.warehouse.dir",
+    "value" : "/apps/hive/warehouse",
+    "description" : "location of default database for the warehouse",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.cache.pinobjtypes",
+    "value" : "Table,Database,Type,FieldSchema,Order",
+    "description" : "List of comma separated metastore object types that should be pinned in the cache",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.semantic.analyzer.factory.impl",
+    "value" : "org.apache.hivealog.cli.HCatSemanticAnalyzerFactory",
+    "description" : "controls which SemanticAnalyzerFactory implemenation class is used by CLI",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hadoop.clientside.fs.operations",
+    "value" : "true",
+    "description" : "FS operations are owned by client",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.client.socket.timeout",
+    "value" : "60",
+    "description" : "MetaStore Client socket timeout in seconds",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.execute.setugi",
+    "value" : "true",
+    "description" : "In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and     server sides. Further note that its best effort. If client sets its to true and server sets it to false, client setting will be ignored.",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.security.authorization.enabled",
+    "value" : "true",
+    "description" : "enable or disable the hive client authorization",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.security.authorization.manager",
+    "value" : "org.apache.hcatalog.security.HdfsAuthorizationProvider",
+    "description" : "the hive client authorization manager class name.\n    The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.  ",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.server2.enable.doAs",
+    "value" : "true",
+    "description" : null,
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "fs.hdfs.impl.disable.cache",
+    "value" : "true",
+    "description" : null,
+    "filename" : "hive-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "HIVE_METASTORE",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HIVE_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "MYSQL_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HIVE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "HIVE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 230 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/MAPREDUCE.json

@@ -0,0 +1,230 @@
+{
+  "name" : "MAPREDUCE",
+  "version" : "1.1.2",
+  "user" : "mapred",
+  "comment" : "Apache Hadoop Distributed Processing Framework",
+  "properties" : [ {
+    "name" : "io.sort.record.percent",
+    "value" : ".2",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "io.sort.factor",
+    "value" : "100",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.tasktracker.tasks.sleeptime-before-sigkill",
+    "value" : "250",
+    "description" : "Normally, this is the amount of time before killing\n  processes, and the recommended-default is 5.000 seconds - a value of\n  5000 here.  In this case, we are using it solely to blast tasks before\n  killing them, and killing them very quickly (1/4 second) to guarantee\n  that we do not leave VMs around for later jobs.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.handler.count",
+    "value" : "50",
+    "description" : "\n    The number of server threads for the JobTracker. This should be roughly\n    4% of the number of tasktracker nodes.\n    ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.system.dir",
+    "value" : "/mapred/system",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.cluster.administrators",
+    "value" : " hadoop",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.reduce.parallel.copies",
+    "value" : "30",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "tasktracker.http.threads",
+    "value" : "50",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.map.tasks.speculative.execution",
+    "value" : "false",
+    "description" : "If true, then multiple instances of some map tasks\n               may be executed in parallel.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.reduce.tasks.speculative.execution",
+    "value" : "false",
+    "description" : "If true, then multiple instances of some reduce tasks\n               may be executed in parallel.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.reduce.slowstart.completed.maps",
+    "value" : "0.05",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.inmem.merge.threshold",
+    "value" : "1000",
+    "description" : "The threshold, in terms of the number of files\n  for the in-memory merge process. When we accumulate threshold number of files\n  we initiate the in-memory merge and spill to disk. A value of 0 or less than\n  0 indicates we want to DON'T have any threshold and instead depend only on\n  the ramfs's memory consumption to trigger the merge.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.shuffle.merge.percent",
+    "value" : "0.66",
+    "description" : "The usage threshold at which an in-memory merge will be\n  initiated, expressed as a percentage of the total memory allocated to\n  storing in-memory map outputs, as defined by\n  mapred.job.shuffle.input.buffer.percent.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.shuffle.input.buffer.percent",
+    "value" : "0.7",
+    "description" : "The percentage of memory to be allocated from the maximum heap\n  size to storing map outputs during the shuffle.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.output.compression.type",
+    "value" : "BLOCK",
+    "description" : "If the job outputs are to compressed as SequenceFiles, how should\n               they be compressed? Should be one of NONE, RECORD or BLOCK.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.completeuserjobs.maximum",
+    "value" : "0",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.restart.recover",
+    "value" : "false",
+    "description" : "\"true\" to enable (job) recovery upon restart,\n               \"false\" to start afresh\n    ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.reduce.input.buffer.percent",
+    "value" : "0.0",
+    "description" : "The percentage of memory- relative to the maximum heap size- to\n  retain map outputs during the reduce. When the shuffle is concluded, any\n  remaining map outputs in memory must consume less than this threshold before\n  the reduce can begin.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.reduce.input.limit",
+    "value" : "10737418240",
+    "description" : "The limit on the input size of the reduce. (This value\n  is 10 Gb.)  If the estimated input size of the reduce is greater than\n  this value, job is failed. A value of -1 means that there is no limit\n  set. ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.task.timeout",
+    "value" : "600000",
+    "description" : "The number of milliseconds before a task will be\n  terminated if it neither reads an input, writes an output, nor\n  updates its status string.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "jetty.connector",
+    "value" : "org.mortbay.jetty.nio.SelectChannelConnector",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.child.root.logger",
+    "value" : "INFO,TLA",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.max.tracker.blacklists",
+    "value" : "16",
+    "description" : "\n    if node is reported blacklisted by 16 successful jobs within timeout-window, it will be graylisted\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.healthChecker.interval",
+    "value" : "135000",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.healthChecker.script.timeout",
+    "value" : "60000",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.persist.jobstatus.active",
+    "value" : "false",
+    "description" : "Indicates if persistency of job status information is\n  active or not.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.persist.jobstatus.hours",
+    "value" : "1",
+    "description" : "The number of hours job status information is persisted in DFS.\n    The job status information will be available after it drops of the memory\n    queue and between jobtracker restarts. With a zero value the job status\n    information is not persisted at all in DFS.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.retirejob.check",
+    "value" : "10000",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.retirejob.interval",
+    "value" : "0",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.history.completed.location",
+    "value" : "/mapred/history/done",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.fileoutputcommitter.marksuccessfuljobs",
+    "value" : "false",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.reuse.jvm.num.tasks",
+    "value" : "1",
+    "description" : "\n    How many tasks to run per jvm. If set to -1, there is no limit\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "hadoop.job.history.user.location",
+    "value" : "none",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.jobtracker.staging.root.dir",
+    "value" : "/user",
+    "description" : "The Path prefix for where the staging directories should be placed. The next level is always the user's\n   name. It is a path in the default file system.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.tasktracker.group",
+    "value" : "hadoop",
+    "description" : "The group that the task controller uses for accessing the task controller. The mapred user must be a member and users should *not* be members.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.jobtracker.split.metainfo.maxsize",
+    "value" : "50000000",
+    "description" : "If the size of the split metainfo file is larger than this, the JobTracker will fail the job during\n    initialize.\n   ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.history.server.embedded",
+    "value" : "false",
+    "description" : "Should job history server be embedded within Job tracker\nprocess",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.blacklist.fault-timeout-window",
+    "value" : "180",
+    "description" : "\n    3-hour sliding window (value is in minutes)\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.blacklist.fault-bucket-width",
+    "value" : "15",
+    "description" : "\n    15-minute bucket size (value is in minutes)\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.queue.names",
+    "value" : "default",
+    "description" : " Comma separated list of queues configured for this jobtracker.",
+    "filename" : "mapred-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "JOBTRACKER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "TASKTRACKER",
+    "category" : "SLAVE",
+    "client" : false,
+    "master" : false
+  }, {
+    "name" : "MAPREDUCE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "MAPREDUCE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 155 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/OOZIE.json

@@ -0,0 +1,155 @@
+{
+  "name" : "OOZIE",
+  "version" : "3.2.0",
+  "user" : "root",
+  "comment" : "System for workflow coordination and execution of Apache Hadoop jobs",
+  "properties" : [ {
+    "name" : "oozie.base.url",
+    "value" : "http://localhost:11000/oozie",
+    "description" : "Base Oozie URL.",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.system.id",
+    "value" : "oozie-${user.name}",
+    "description" : "\n    The Oozie system ID.\n    ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.systemmode",
+    "value" : "NORMAL",
+    "description" : "\n     System mode for  Oozie at startup.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.AuthorizationService.security.enabled",
+    "value" : "true",
+    "description" : "\n     Specifies whether security (user name/admin role) is enabled or not.\n     If disabled any user can manage Oozie system and manage any job.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.PurgeService.older.than",
+    "value" : "30",
+    "description" : "\n     Jobs older than this value, in days, will be purged by the PurgeService.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.PurgeService.purge.interval",
+    "value" : "3600",
+    "description" : "\n     Interval at which the purge service will run, in seconds.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.CallableQueueService.queue.size",
+    "value" : "1000",
+    "description" : "Max callable queue size",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.CallableQueueService.threads",
+    "value" : "10",
+    "description" : "Number of threads used for executing callables",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.CallableQueueService.callable.concurrency",
+    "value" : "3",
+    "description" : "\n     Maximum concurrency for a given callable type.\n     Each command is a callable type (submit, start, run, signal, job, jobs, suspend,resume, etc).\n     Each action type is a callable type (Map-Reduce, Pig, SSH, FS, sub-workflow, etc).\n     All commands that use action executors (action-start, action-end, action-kill and action-check) use\n     the action type as the callable type.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.coord.normal.default.timeout",
+    "value" : "120",
+    "description" : "Default timeout for a coordinator action input check (in minutes) for normal job.\n      -1 means infinite timeout",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.db.schema.name",
+    "value" : "oozie",
+    "description" : "\n      Oozie DataBase Name\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.HadoopAccessorService.jobTracker.whitelist",
+    "value" : " ",
+    "description" : "\n      Whitelisted job tracker for Oozie service.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.authentication.type",
+    "value" : "simple",
+    "description" : "\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.HadoopAccessorService.nameNode.whitelist",
+    "value" : " ",
+    "description" : "\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.WorkflowAppService.system.libpath",
+    "value" : "/user/${user.name}/share/lib",
+    "description" : "\n      System library path to use for workflow applications.\n      This path is added to workflow application if their job properties sets\n      the property 'oozie.use.system.libpath' to true.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "use.system.libpath.for.mapreduce.and.pig.jobs",
+    "value" : "false",
+    "description" : "\n      If set to true, submissions of MapReduce and Pig jobs will include\n      automatically the system library path, thus not requiring users to\n      specify where the Pig JAR files are. Instead, the ones from the system\n      library path are used.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.authentication.kerberos.name.rules",
+    "value" : "\n        RULE:[2:$1@$0]([jt]t@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-MAPREDUSER/\n        RULE:[2:$1@$0]([nd]n@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HDFSUSER/\n        RULE:[2:$1@$0](hm@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n        RULE:[2:$1@$0](rs@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n        DEFAULT\n        ",
+    "description" : "The mapping from kerberos principal names to local OS user names.",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.HadoopAccessorService.hadoop.configurations",
+    "value" : "*=/etc/hadoop/conf",
+    "description" : "\n          Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of\n          the Hadoop service (JobTracker, HDFS). The wildcard '*' configuration is\n          used when there is no exact match for an authority. The HADOOP_CONF_DIR contains\n          the relevant Hadoop *-site.xml files. If the path is relative is looked within\n          the Oozie configuration directory; though the path can be absolute (i.e. to point\n          to Hadoop client conf/ directories in the local filesystem.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.ActionService.executor.ext.classes",
+    "value" : "\n            org.apache.oozie.action.email.EmailActionExecutor,\n            org.apache.oozie.action.hadoop.HiveActionExecutor,\n            org.apache.oozie.action.hadoop.ShellActionExecutor,\n            org.apache.oozie.action.hadoop.SqoopActionExecutor,\n            org.apache.oozie.action.hadoop.DistcpActionExecutor\n        ",
+    "description" : null,
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.SchemaService.wf.ext.schemas",
+    "value" : "shell-action-0.1.xsd,email-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd,ssh-action-0.1.xsd,distcp-action-0.1.xsd",
+    "description" : null,
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.create.db.schema",
+    "value" : "false",
+    "description" : "\n            Creates Oozie DB.\n\n            If set to true, it creates the DB schema if it does not exist. If the DB schema exists is a NOP.\n            If set to false, it does not create the DB schema. If the DB schema does not exist it fails start up.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.driver",
+    "value" : "org.apache.derby.jdbc.EmbeddedDriver",
+    "description" : "\n            JDBC driver class.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.url",
+    "value" : "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true",
+    "description" : "\n            JDBC URL.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.username",
+    "value" : "sa",
+    "description" : "\n            DB user name.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.password",
+    "value" : " ",
+    "description" : "\n            DB user password.\n\n            IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value,\n                       if empty Configuration assumes it is NULL.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.pool.max.active.conn",
+    "value" : "10",
+    "description" : "\n             Max number of connections.\n        ",
+    "filename" : "oozie-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "OOZIE_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "OOZIE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "OOZIE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 90 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/WEBHCAT.json

@@ -0,0 +1,90 @@
+{
+  "name" : "WEBHCAT",
+  "version" : "0.5.0",
+  "user" : "root",
+  "comment" : "This is comment for WEBHCAT service",
+  "properties" : [ {
+    "name" : "templeton.port",
+    "value" : "50111",
+    "description" : "The HTTP port for the main server.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hadoop.conf.dir",
+    "value" : "/etc/hadoop/conf",
+    "description" : "The path to the Hadoop configuration.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.jar",
+    "value" : "/usr/lib/hcatalog/share/webhcat/svr/webhcat.jar",
+    "description" : "The path to the Templeton jar file.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.libjars",
+    "value" : "/usr/lib/zookeeper/zookeeper.jar",
+    "description" : "Jars to add the the classpath.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hadoop",
+    "value" : "/usr/bin/hadoop",
+    "description" : "The path to the Hadoop executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.pig.archive",
+    "value" : "hdfs:///apps/webhcat/pig.tar.gz",
+    "description" : "The path to the Pig archive.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.pig.path",
+    "value" : "pig.tar.gz/pig/bin/pig",
+    "description" : "The path to the Pig executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hcat",
+    "value" : "/usr/bin/hcat",
+    "description" : "The path to the hcatalog executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hive.archive",
+    "value" : "hdfs:///apps/webhcat/hive.tar.gz",
+    "description" : "The path to the Hive archive.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hive.path",
+    "value" : "hive.tar.gz/hive/bin/hive",
+    "description" : "The path to the Hive executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.storage.class",
+    "value" : "org.apache.hcatalog.templeton.tool.ZooKeeperStorage",
+    "description" : "The class to use as storage",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.override.enabled",
+    "value" : "false",
+    "description" : "\n     Enable the override path in templeton.override.jars\n   ",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.streaming.jar",
+    "value" : "hdfs:///apps/webhcat/hadoop-streaming.jar",
+    "description" : "The hdfs path to the Hadoop streaming jar file.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.exec.timeout",
+    "value" : "60000",
+    "description" : "Time out for templeton api",
+    "filename" : "webhcat-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "WEBHCAT_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "WEBHCAT_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }
+}

+ 25 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version122/ZOOKEEPER.json

@@ -0,0 +1,25 @@
+{
+  "name" : "ZOOKEEPER",
+  "version" : "3.4.5",
+  "user" : "root",
+  "comment" : "This is comment for ZOOKEEPER service",
+  "properties" : [ ],
+  "components" : [ {
+    "name" : "ZOOKEEPER_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "ZOOKEEPER_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "ZOOKEEPER_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 60 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/HBASE.json

@@ -0,0 +1,60 @@
+{
+  "name" : "HBASE",
+  "version" : "0.94.5",
+  "user" : "mapred",
+  "comment" : "Non-relational distributed database and centralized service for configuration management & synchronization",
+  "properties" : [ {
+    "name" : "hbase.cluster.distributed",
+    "value" : "true",
+    "description" : "The mode the cluster will be in. Possible values are\n      false for standalone mode and true for distributed mode.  If\n      false, startup will run all HBase and ZooKeeper daemons together\n      in the one JVM.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.master.lease.thread.wakefrequency",
+    "value" : "3000",
+    "description" : "The interval between checks for expired region server leases.\n    This value has been reduced due to the other reduced values above so that\n    the master will notice a dead region server sooner. The default is 15 seconds.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.superuser",
+    "value" : "hbase",
+    "description" : "List of users or groups (comma-separated), who are allowed\n    full privileges, regardless of stored ACLs, across the cluster.\n    Only used when HBase security is enabled.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.zookeeper.property.clientPort",
+    "value" : "2181",
+    "description" : "Property from ZooKeeper's config zoo.cfg.\n    The port at which the clients will connect.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.regionserver.optionalcacheflushinterval",
+    "value" : "10000",
+    "description" : "\n      Amount of time to wait since the last time a region was flushed before\n      invoking an optional cache flush. Default 60,000.\n    ",
+    "filename" : "hbase-site.xml"
+  }, {
+    "name" : "hbase.zookeeper.useMulti",
+    "value" : "true",
+    "description" : "Instructs HBase to make use of ZooKeeper's multi-update functionality.\n    This allows certain ZooKeeper operations to complete more quickly and prevents some issues\n    with rare Replication failure scenarios (see the release note of HBASE-2611 for an example).В·\n    IMPORTANT: only set this to true if all ZooKeeper servers in the cluster are on version 3.4+\n    and will not be downgraded.  ZooKeeper versions before 3.4 do not support multi-update and will\n    not fail gracefully if multi-update is invoked (see ZOOKEEPER-1495).\n    ",
+    "filename" : "hbase-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "HBASE_MASTER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HBASE_REGIONSERVER",
+    "category" : "SLAVE",
+    "client" : false,
+    "master" : false
+  }, {
+    "name" : "HBASE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "HBASE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 20 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/HCATALOG.json

@@ -0,0 +1,20 @@
+{
+  "name" : "HCATALOG",
+  "version" : "0.5.0",
+  "user" : "root",
+  "comment" : "This is comment for HCATALOG service",
+  "properties" : [ ],
+  "components" : [ {
+    "name" : "HCAT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : true,
+  "clientComponent" : {
+    "name" : "HCAT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 210 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/HDFS.json

@@ -0,0 +1,210 @@
+{
+  "name" : "HDFS",
+  "version" : "1.1.2",
+  "user" : "root",
+  "comment" : "Apache Hadoop Distributed File System",
+  "properties" : [ {
+    "name" : "dfs.datanode.socket.write.timeout",
+    "value" : "0",
+    "description" : "DFS Client write socket timeout",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.replication.max",
+    "value" : "50",
+    "description" : "Maximal block replication.\n  ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.heartbeat.interval",
+    "value" : "3",
+    "description" : "Determines datanode heartbeat interval in seconds.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.safemode.threshold.pct",
+    "value" : "1.0f",
+    "description" : "\n        Specifies the percentage of blocks that should satisfy\n        the minimal replication requirement defined by dfs.replication.min.\n        Values less than or equal to 0 mean not to start in safe mode.\n        Values greater than 1 will make safe mode permanent.\n        ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.balance.bandwidthPerSec",
+    "value" : "6250000",
+    "description" : "\n        Specifies the maximum amount of bandwidth that each datanode\n        can utilize for the balancing purpose in term of\n        the number of bytes per second.\n  ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.block.size",
+    "value" : "134217728",
+    "description" : "The default block size for new files.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.ipc.address",
+    "value" : "0.0.0.0:8010",
+    "description" : "\nThe datanode ipc server address and port.\nIf the port is 0 then the server will start on a free port.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.blockreport.initialDelay",
+    "value" : "120",
+    "description" : "Delay for first block report in seconds.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.du.pct",
+    "value" : "0.85f",
+    "description" : "When calculating remaining space, only use this percentage of the real available space\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.namenode.handler.count",
+    "value" : "40",
+    "description" : "The number of server threads for the namenode.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.max.xcievers",
+    "value" : "4096",
+    "description" : "PRIVATE CONFIG VARIABLE",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.umaskmode",
+    "value" : "077",
+    "description" : "\nThe octal umask used when creating files and directories.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.web.ugi",
+    "value" : "gopher,gopher",
+    "description" : "The user account used by the web interface.\nSyntax: USERNAME,GROUP1,GROUP2, ...\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.permissions",
+    "value" : "true",
+    "description" : "\nIf \"true\", enable permission checking in HDFS.\nIf \"false\", permission checking is turned off,\nbut all other behavior is unchanged.\nSwitching from one parameter value to the other does not change the mode,\nowner or group of files or directories.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.permissions.supergroup",
+    "value" : "hdfs",
+    "description" : "The name of the group of super-users.",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.namenode.handler.count",
+    "value" : "100",
+    "description" : "Added to grow Queue size so that more client connections are allowed",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "ipc.server.max.response.size",
+    "value" : "5242880",
+    "description" : null,
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.block.access.token.enable",
+    "value" : "true",
+    "description" : "\nIf \"true\", access tokens are used as capabilities for accessing datanodes.\nIf \"false\", no access tokens are checked on accessing datanodes.\n",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.secondary.https.port",
+    "value" : "50490",
+    "description" : "The https port where secondary-namenode binds",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.https.port",
+    "value" : "50470",
+    "description" : "The https port where namenode binds",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.access.time.precision",
+    "value" : "0",
+    "description" : "The access time for HDFS file is precise upto this value.\n               The default value is 1 hour. Setting a value of 0 disables\n               access times for HDFS.\n  ",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.cluster.administrators",
+    "value" : " hdfs",
+    "description" : "ACL for who all can view the default servlets in the HDFS",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "ipc.server.read.threadpool.size",
+    "value" : "5",
+    "description" : null,
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "dfs.datanode.failed.volumes.tolerated",
+    "value" : "0",
+    "description" : "Number of failed disks datanode would tolerate",
+    "filename" : "hdfs-site.xml"
+  }, {
+    "name" : "io.file.buffer.size",
+    "value" : "131072",
+    "description" : "The size of buffer for use in sequence files.\n  The size of this buffer should probably be a multiple of hardware\n  page size (4096 on Intel x86), and it determines how much data is\n  buffered during read and write operations.",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "io.serializations",
+    "value" : "org.apache.hadoop.io.serializer.WritableSerialization",
+    "description" : null,
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "io.compression.codec.lzo.class",
+    "value" : "com.hadoop.compression.lzo.LzoCodec",
+    "description" : "The implementation for lzo codec.",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.trash.interval",
+    "value" : "360",
+    "description" : "Number of minutes between trash checkpoints.\n  If zero, the trash feature is disabled.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.checkpoint.edits.dir",
+    "value" : "${fs.checkpoint.dir}",
+    "description" : "Determines where on the local filesystem the DFS secondary\n        name node should store the temporary edits to merge.\n        If this is a comma-delimited list of directoires then teh edits is\n        replicated in all of the directoires for redundancy.\n        Default value is same as fs.checkpoint.dir\n    ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.checkpoint.period",
+    "value" : "21600",
+    "description" : "The number of seconds between two periodic checkpoints.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "fs.checkpoint.size",
+    "value" : "536870912",
+    "description" : "The size of the current edit log (in bytes) that triggers\n       a periodic checkpoint even if the fs.checkpoint.period hasn't expired.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "ipc.client.idlethreshold",
+    "value" : "8000",
+    "description" : "Defines the threshold number of connections after which\n               connections will be inspected for idleness.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "ipc.client.connection.maxidletime",
+    "value" : "30000",
+    "description" : "The maximum time after which a client will bring down the\n               connection to the server.\n  ",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "ipc.client.connect.max.retries",
+    "value" : "50",
+    "description" : "Defines the maximum number of retries for IPC connections.",
+    "filename" : "core-site.xml"
+  }, {
+    "name" : "webinterface.private.actions",
+    "value" : "false",
+    "description" : " If set to true, the web interfaces of JT and NN may contain\n                actions, such as kill job, delete file, etc., that should\n                not be exposed to public. Enable this option if the interfaces\n                are only reachable by those who have the right authorization.\n  ",
+    "filename" : "core-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "NAMENODE",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "DATANODE",
+    "category" : "SLAVE",
+    "client" : false,
+    "master" : false
+  }, {
+    "name" : "SECONDARY_NAMENODE",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HDFS_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "HDFS_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 95 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/HIVE.json

@@ -0,0 +1,95 @@
+{
+  "name" : "HIVE",
+  "version" : "0.10.0",
+  "user" : "root",
+  "comment" : "Data warehouse system for ad-hoc queries & analysis of large datasets and table & storage management service",
+  "properties" : [ {
+    "name" : "hive.metastore.local",
+    "value" : "false",
+    "description" : "controls whether to connect to remove metastore server or\n    open a new metastore server in Hive Client JVM",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "javax.jdo.option.ConnectionDriverName",
+    "value" : "com.mysql.jdbc.Driver",
+    "description" : "Driver class name for a JDBC metastore",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.warehouse.dir",
+    "value" : "/apps/hive/warehouse",
+    "description" : "location of default database for the warehouse",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.cache.pinobjtypes",
+    "value" : "Table,Database,Type,FieldSchema,Order",
+    "description" : "List of comma separated metastore object types that should be pinned in the cache",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.semantic.analyzer.factory.impl",
+    "value" : "org.apache.hivealog.cli.HCatSemanticAnalyzerFactory",
+    "description" : "controls which SemanticAnalyzerFactory implemenation class is used by CLI",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hadoop.clientside.fs.operations",
+    "value" : "true",
+    "description" : "FS operations are owned by client",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.client.socket.timeout",
+    "value" : "60",
+    "description" : "MetaStore Client socket timeout in seconds",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.metastore.execute.setugi",
+    "value" : "true",
+    "description" : "In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and     server sides. Further note that its best effort. If client sets its to true and server sets it to false, client setting will be ignored.",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.security.authorization.enabled",
+    "value" : "true",
+    "description" : "enable or disable the hive client authorization",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.security.authorization.manager",
+    "value" : "org.apache.hcatalog.security.HdfsAuthorizationProvider",
+    "description" : "the hive client authorization manager class name.\n    The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.  ",
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "hive.server2.enable.doAs",
+    "value" : "true",
+    "description" : null,
+    "filename" : "hive-site.xml"
+  }, {
+    "name" : "fs.hdfs.impl.disable.cache",
+    "value" : "true",
+    "description" : null,
+    "filename" : "hive-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "HIVE_METASTORE",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HIVE_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "MYSQL_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "HIVE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "HIVE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 155 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/HUE.json

@@ -0,0 +1,155 @@
+{
+  "name" : "HUE",
+  "version" : "2.2.0",
+  "user" : "root",
+  "comment" : "Hue is a graphical user interface to operate and develop\n      applications for Apache Hadoop.",
+  "properties" : [ {
+    "name" : "send_debug_messages",
+    "value" : "1",
+    "description" : null,
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "database_logging",
+    "value" : "0",
+    "description" : "To show database transactions, set database_logging to 1.\n      default, database_logging=0",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "http_host",
+    "value" : "0.0.0.0",
+    "description" : "Webserver listens on this address and port",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "http_port",
+    "value" : "8000",
+    "description" : "Webserver listens on this address and port",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "time_zone",
+    "value" : "America/Los_Angeles",
+    "description" : "Time zone name",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "django_debug_mode",
+    "value" : "1",
+    "description" : "Turn off debug",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "use_cherrypy_server",
+    "value" : "false",
+    "description" : "Set to true to use CherryPy as the webserver, set to false\n      to use Spawning as the webserver. Defaults to Spawning if\n      key is not specified.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "http_500_debug_mode",
+    "value" : "1",
+    "description" : "Turn off backtrace for server error",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "backend_auth_policy",
+    "value" : "desktop.auth.backend.AllowAllBackend",
+    "description" : "Authentication backend.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "db_engine",
+    "value" : "mysql",
+    "description" : "Configuration options for specifying the Desktop Database.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "db_host",
+    "value" : "localhost",
+    "description" : "Configuration options for specifying the Desktop Database.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "db_port",
+    "value" : "3306",
+    "description" : "Configuration options for specifying the Desktop Database.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "db_user",
+    "value" : "sandbox",
+    "description" : "Configuration options for specifying the Desktop Database.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "db_password",
+    "value" : "1111",
+    "description" : "Configuration options for specifying the Desktop Database.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "db_name",
+    "value" : "sandbox",
+    "description" : "Configuration options for specifying the Desktop Database.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "smtp_host",
+    "value" : "localhost",
+    "description" : "The SMTP server information for email notification delivery.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "smtp_port",
+    "value" : "25",
+    "description" : "The SMTP server information for email notification delivery.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "smtp_password",
+    "value" : "25",
+    "description" : "The SMTP server information for email notification delivery.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "tls",
+    "value" : "no",
+    "description" : "Whether to use a TLS (secure) connection when talking to the SMTP server.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "default_from_email",
+    "value" : "sandbox@hortonworks.com",
+    "description" : "The SMTP server information for email notification delivery.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "jobtracker_port",
+    "value" : "50030",
+    "description" : "The port where the JobTracker IPC listens on.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "hadoop_mapred_home",
+    "value" : "/usr/lib/hadoop/lib",
+    "description" : "The SMTP server information for email notification delivery.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "pig_shell_command",
+    "value" : "/usr/bin/pig -l /dev/null",
+    "description" : "Define and configure a new shell type pig.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "hbase_nice_name",
+    "value" : "HBase Shell",
+    "description" : "Define and configure a new shell type hbase",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "hbase_shell_command",
+    "value" : "/usr/bin/hbase shell",
+    "description" : "Define and configure a new shell type hbase.",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "bash_shell_command",
+    "value" : "/bin/bash",
+    "description" : "Define and configure a new shell type bash for testing only\n      .",
+    "filename" : "hue-site.xml"
+  }, {
+    "name" : "whitelist",
+    "value" : "(localhost|127\\.0\\.0\\.1):(50030|50070|50060|50075|50111)",
+    "description" : "proxy settings",
+    "filename" : "hue-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "HUE_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "HUE_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }
+}

+ 230 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/MAPREDUCE.json

@@ -0,0 +1,230 @@
+{
+  "name" : "MAPREDUCE",
+  "version" : "1.1.2",
+  "user" : "mapred",
+  "comment" : "Apache Hadoop Distributed Processing Framework",
+  "properties" : [ {
+    "name" : "io.sort.record.percent",
+    "value" : ".2",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "io.sort.factor",
+    "value" : "100",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.tasktracker.tasks.sleeptime-before-sigkill",
+    "value" : "250",
+    "description" : "Normally, this is the amount of time before killing\n  processes, and the recommended-default is 5.000 seconds - a value of\n  5000 here.  In this case, we are using it solely to blast tasks before\n  killing them, and killing them very quickly (1/4 second) to guarantee\n  that we do not leave VMs around for later jobs.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.handler.count",
+    "value" : "50",
+    "description" : "\n    The number of server threads for the JobTracker. This should be roughly\n    4% of the number of tasktracker nodes.\n    ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.system.dir",
+    "value" : "/mapred/system",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.cluster.administrators",
+    "value" : " hadoop",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.reduce.parallel.copies",
+    "value" : "30",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "tasktracker.http.threads",
+    "value" : "50",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.map.tasks.speculative.execution",
+    "value" : "false",
+    "description" : "If true, then multiple instances of some map tasks\n               may be executed in parallel.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.reduce.tasks.speculative.execution",
+    "value" : "false",
+    "description" : "If true, then multiple instances of some reduce tasks\n               may be executed in parallel.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.reduce.slowstart.completed.maps",
+    "value" : "0.05",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.inmem.merge.threshold",
+    "value" : "1000",
+    "description" : "The threshold, in terms of the number of files\n  for the in-memory merge process. When we accumulate threshold number of files\n  we initiate the in-memory merge and spill to disk. A value of 0 or less than\n  0 indicates we want to DON'T have any threshold and instead depend only on\n  the ramfs's memory consumption to trigger the merge.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.shuffle.merge.percent",
+    "value" : "0.66",
+    "description" : "The usage threshold at which an in-memory merge will be\n  initiated, expressed as a percentage of the total memory allocated to\n  storing in-memory map outputs, as defined by\n  mapred.job.shuffle.input.buffer.percent.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.shuffle.input.buffer.percent",
+    "value" : "0.7",
+    "description" : "The percentage of memory to be allocated from the maximum heap\n  size to storing map outputs during the shuffle.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.output.compression.type",
+    "value" : "BLOCK",
+    "description" : "If the job outputs are to compressed as SequenceFiles, how should\n               they be compressed? Should be one of NONE, RECORD or BLOCK.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.completeuserjobs.maximum",
+    "value" : "0",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.restart.recover",
+    "value" : "false",
+    "description" : "\"true\" to enable (job) recovery upon restart,\n               \"false\" to start afresh\n    ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.reduce.input.buffer.percent",
+    "value" : "0.0",
+    "description" : "The percentage of memory- relative to the maximum heap size- to\n  retain map outputs during the reduce. When the shuffle is concluded, any\n  remaining map outputs in memory must consume less than this threshold before\n  the reduce can begin.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.reduce.input.limit",
+    "value" : "10737418240",
+    "description" : "The limit on the input size of the reduce. (This value\n  is 10 Gb.)  If the estimated input size of the reduce is greater than\n  this value, job is failed. A value of -1 means that there is no limit\n  set. ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.task.timeout",
+    "value" : "600000",
+    "description" : "The number of milliseconds before a task will be\n  terminated if it neither reads an input, writes an output, nor\n  updates its status string.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "jetty.connector",
+    "value" : "org.mortbay.jetty.nio.SelectChannelConnector",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.child.root.logger",
+    "value" : "INFO,TLA",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.max.tracker.blacklists",
+    "value" : "16",
+    "description" : "\n    if node is reported blacklisted by 16 successful jobs within timeout-window, it will be graylisted\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.healthChecker.interval",
+    "value" : "135000",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.healthChecker.script.timeout",
+    "value" : "60000",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.persist.jobstatus.active",
+    "value" : "false",
+    "description" : "Indicates if persistency of job status information is\n  active or not.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.persist.jobstatus.hours",
+    "value" : "1",
+    "description" : "The number of hours job status information is persisted in DFS.\n    The job status information will be available after it drops of the memory\n    queue and between jobtracker restarts. With a zero value the job status\n    information is not persisted at all in DFS.\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.retirejob.check",
+    "value" : "10000",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.retirejob.interval",
+    "value" : "0",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.tracker.history.completed.location",
+    "value" : "/mapred/history/done",
+    "description" : "No description",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.fileoutputcommitter.marksuccessfuljobs",
+    "value" : "false",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.job.reuse.jvm.num.tasks",
+    "value" : "1",
+    "description" : "\n    How many tasks to run per jvm. If set to -1, there is no limit\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "hadoop.job.history.user.location",
+    "value" : "none",
+    "description" : null,
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.jobtracker.staging.root.dir",
+    "value" : "/user",
+    "description" : "The Path prefix for where the staging directories should be placed. The next level is always the user's\n   name. It is a path in the default file system.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.tasktracker.group",
+    "value" : "hadoop",
+    "description" : "The group that the task controller uses for accessing the task controller. The mapred user must be a member and users should *not* be members.",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.jobtracker.split.metainfo.maxsize",
+    "value" : "50000000",
+    "description" : "If the size of the split metainfo file is larger than this, the JobTracker will fail the job during\n    initialize.\n   ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapreduce.history.server.embedded",
+    "value" : "false",
+    "description" : "Should job history server be embedded within Job tracker\nprocess",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.blacklist.fault-timeout-window",
+    "value" : "180",
+    "description" : "\n    3-hour sliding window (value is in minutes)\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.jobtracker.blacklist.fault-bucket-width",
+    "value" : "15",
+    "description" : "\n    15-minute bucket size (value is in minutes)\n  ",
+    "filename" : "mapred-site.xml"
+  }, {
+    "name" : "mapred.queue.names",
+    "value" : "default",
+    "description" : " Comma separated list of queues configured for this jobtracker.",
+    "filename" : "mapred-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "JOBTRACKER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "TASKTRACKER",
+    "category" : "SLAVE",
+    "client" : false,
+    "master" : false
+  }, {
+    "name" : "MAPREDUCE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "MAPREDUCE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 155 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/OOZIE.json

@@ -0,0 +1,155 @@
+{
+  "name" : "OOZIE",
+  "version" : "3.2.0",
+  "user" : "root",
+  "comment" : "System for workflow coordination and execution of Apache Hadoop jobs",
+  "properties" : [ {
+    "name" : "oozie.base.url",
+    "value" : "http://localhost:11000/oozie",
+    "description" : "Base Oozie URL.",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.system.id",
+    "value" : "oozie-${user.name}",
+    "description" : "\n    The Oozie system ID.\n    ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.systemmode",
+    "value" : "NORMAL",
+    "description" : "\n     System mode for  Oozie at startup.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.AuthorizationService.security.enabled",
+    "value" : "true",
+    "description" : "\n     Specifies whether security (user name/admin role) is enabled or not.\n     If disabled any user can manage Oozie system and manage any job.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.PurgeService.older.than",
+    "value" : "30",
+    "description" : "\n     Jobs older than this value, in days, will be purged by the PurgeService.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.PurgeService.purge.interval",
+    "value" : "3600",
+    "description" : "\n     Interval at which the purge service will run, in seconds.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.CallableQueueService.queue.size",
+    "value" : "1000",
+    "description" : "Max callable queue size",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.CallableQueueService.threads",
+    "value" : "10",
+    "description" : "Number of threads used for executing callables",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.CallableQueueService.callable.concurrency",
+    "value" : "3",
+    "description" : "\n     Maximum concurrency for a given callable type.\n     Each command is a callable type (submit, start, run, signal, job, jobs, suspend,resume, etc).\n     Each action type is a callable type (Map-Reduce, Pig, SSH, FS, sub-workflow, etc).\n     All commands that use action executors (action-start, action-end, action-kill and action-check) use\n     the action type as the callable type.\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.coord.normal.default.timeout",
+    "value" : "120",
+    "description" : "Default timeout for a coordinator action input check (in minutes) for normal job.\n      -1 means infinite timeout",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.db.schema.name",
+    "value" : "oozie",
+    "description" : "\n      Oozie DataBase Name\n     ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.HadoopAccessorService.jobTracker.whitelist",
+    "value" : " ",
+    "description" : "\n      Whitelisted job tracker for Oozie service.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.authentication.type",
+    "value" : "simple",
+    "description" : "\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.HadoopAccessorService.nameNode.whitelist",
+    "value" : " ",
+    "description" : "\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.WorkflowAppService.system.libpath",
+    "value" : "/user/${user.name}/share/lib",
+    "description" : "\n      System library path to use for workflow applications.\n      This path is added to workflow application if their job properties sets\n      the property 'oozie.use.system.libpath' to true.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "use.system.libpath.for.mapreduce.and.pig.jobs",
+    "value" : "false",
+    "description" : "\n      If set to true, submissions of MapReduce and Pig jobs will include\n      automatically the system library path, thus not requiring users to\n      specify where the Pig JAR files are. Instead, the ones from the system\n      library path are used.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.authentication.kerberos.name.rules",
+    "value" : "\n        RULE:[2:$1@$0]([jt]t@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-MAPREDUSER/\n        RULE:[2:$1@$0]([nd]n@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HDFSUSER/\n        RULE:[2:$1@$0](hm@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n        RULE:[2:$1@$0](rs@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n        DEFAULT\n        ",
+    "description" : "The mapping from kerberos principal names to local OS user names.",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.HadoopAccessorService.hadoop.configurations",
+    "value" : "*=/etc/hadoop/conf",
+    "description" : "\n          Comma separated AUTHORITY=HADOOP_CONF_DIR, where AUTHORITY is the HOST:PORT of\n          the Hadoop service (JobTracker, HDFS). The wildcard '*' configuration is\n          used when there is no exact match for an authority. The HADOOP_CONF_DIR contains\n          the relevant Hadoop *-site.xml files. If the path is relative is looked within\n          the Oozie configuration directory; though the path can be absolute (i.e. to point\n          to Hadoop client conf/ directories in the local filesystem.\n      ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.ActionService.executor.ext.classes",
+    "value" : "\n            org.apache.oozie.action.email.EmailActionExecutor,\n            org.apache.oozie.action.hadoop.HiveActionExecutor,\n            org.apache.oozie.action.hadoop.ShellActionExecutor,\n            org.apache.oozie.action.hadoop.SqoopActionExecutor,\n            org.apache.oozie.action.hadoop.DistcpActionExecutor\n        ",
+    "description" : null,
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.SchemaService.wf.ext.schemas",
+    "value" : "shell-action-0.1.xsd,email-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd,ssh-action-0.1.xsd,distcp-action-0.1.xsd",
+    "description" : null,
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.create.db.schema",
+    "value" : "false",
+    "description" : "\n            Creates Oozie DB.\n\n            If set to true, it creates the DB schema if it does not exist. If the DB schema exists is a NOP.\n            If set to false, it does not create the DB schema. If the DB schema does not exist it fails start up.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.driver",
+    "value" : "org.apache.derby.jdbc.EmbeddedDriver",
+    "description" : "\n            JDBC driver class.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.url",
+    "value" : "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true",
+    "description" : "\n            JDBC URL.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.username",
+    "value" : "sa",
+    "description" : "\n            DB user name.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.jdbc.password",
+    "value" : " ",
+    "description" : "\n            DB user password.\n\n            IMPORTANT: if password is emtpy leave a 1 space string, the service trims the value,\n                       if empty Configuration assumes it is NULL.\n        ",
+    "filename" : "oozie-site.xml"
+  }, {
+    "name" : "oozie.service.JPAService.pool.max.active.conn",
+    "value" : "10",
+    "description" : "\n             Max number of connections.\n        ",
+    "filename" : "oozie-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "OOZIE_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "OOZIE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "OOZIE_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

+ 90 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/WEBHCAT.json

@@ -0,0 +1,90 @@
+{
+  "name" : "WEBHCAT",
+  "version" : "0.5.0",
+  "user" : "root",
+  "comment" : "This is comment for WEBHCAT service",
+  "properties" : [ {
+    "name" : "templeton.port",
+    "value" : "50111",
+    "description" : "The HTTP port for the main server.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hadoop.conf.dir",
+    "value" : "/etc/hadoop/conf",
+    "description" : "The path to the Hadoop configuration.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.jar",
+    "value" : "/usr/lib/hcatalog/share/webhcat/svr/webhcat.jar",
+    "description" : "The path to the Templeton jar file.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.libjars",
+    "value" : "/usr/lib/zookeeper/zookeeper.jar",
+    "description" : "Jars to add the the classpath.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hadoop",
+    "value" : "/usr/bin/hadoop",
+    "description" : "The path to the Hadoop executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.pig.archive",
+    "value" : "hdfs:///apps/webhcat/pig.tar.gz",
+    "description" : "The path to the Pig archive.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.pig.path",
+    "value" : "pig.tar.gz/pig/bin/pig",
+    "description" : "The path to the Pig executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hcat",
+    "value" : "/usr/bin/hcat",
+    "description" : "The path to the hcatalog executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hive.archive",
+    "value" : "hdfs:///apps/webhcat/hive.tar.gz",
+    "description" : "The path to the Hive archive.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.hive.path",
+    "value" : "hive.tar.gz/hive/bin/hive",
+    "description" : "The path to the Hive executable.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.storage.class",
+    "value" : "org.apache.hcatalog.templeton.tool.ZooKeeperStorage",
+    "description" : "The class to use as storage",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.override.enabled",
+    "value" : "false",
+    "description" : "\n     Enable the override path in templeton.override.jars\n   ",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.streaming.jar",
+    "value" : "hdfs:///apps/webhcat/hadoop-streaming.jar",
+    "description" : "The hdfs path to the Hadoop streaming jar file.",
+    "filename" : "webhcat-site.xml"
+  }, {
+    "name" : "templeton.exec.timeout",
+    "value" : "60000",
+    "description" : "Time out for templeton api",
+    "filename" : "webhcat-site.xml"
+  } ],
+  "components" : [ {
+    "name" : "WEBHCAT_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "WEBHCAT_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }
+}

+ 25 - 0
ambari-web/app/assets/data/wizard/stack/hdp/version130/ZOOKEEPER.json

@@ -0,0 +1,25 @@
+{
+  "name" : "ZOOKEEPER",
+  "version" : "3.4.5",
+  "user" : "root",
+  "comment" : "This is comment for ZOOKEEPER service",
+  "properties" : [ ],
+  "components" : [ {
+    "name" : "ZOOKEEPER_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "ZOOKEEPER_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "ZOOKEEPER_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  }
+}

文件差异内容过多而无法显示
+ 1834 - 0
ambari-web/app/assets/data/wizard/stack/stacks.json


+ 216 - 0
ambari-web/app/assets/data/wizard/stop_services/poll_1.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 216 - 0
ambari-web/app/assets/data/wizard/stop_services/poll_2.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "IN_PROGRESS",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "UPGRADING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 216 - 0
ambari-web/app/assets/data/wizard/stop_services/poll_3.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "IN_PROGRESS",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "UPGRADING",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 216 - 0
ambari-web/app/assets/data/wizard/stop_services/poll_4.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "STOP",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 1 - 1
ambari-web/app/assets/data/wizard/upgrade/poll_2.json

@@ -123,7 +123,7 @@
         "attempt_cnt" : "0",
         "attempt_cnt" : "0",
         "exit_code" : "999",
         "exit_code" : "999",
         "stdout" : "",
         "stdout" : "",
-        "status" : "UPGRADING",
+        "status" : "IN_PROGRESS",
         "command" : "UPGRADE",
         "command" : "UPGRADE",
         "start_time" : "-1",
         "start_time" : "-1",
         "role" : "DATANODE",
         "role" : "DATANODE",

+ 1 - 1
ambari-web/app/assets/data/wizard/upgrade/poll_3.json

@@ -187,7 +187,7 @@
         "attempt_cnt" : "0",
         "attempt_cnt" : "0",
         "exit_code" : "999",
         "exit_code" : "999",
         "stdout" : "",
         "stdout" : "",
-        "status" : "UPGRADING",
+        "status" : "IN_PROGRESS",
         "command" : "UPGRADE",
         "command" : "UPGRADE",
         "start_time" : "-1",
         "start_time" : "-1",
         "role" : "NAMENODE",
         "role" : "NAMENODE",

+ 1 - 1
ambari-web/app/assets/data/wizard/upgrade/poll_4.json

@@ -91,7 +91,7 @@
         "attempt_cnt" : "0",
         "attempt_cnt" : "0",
         "exit_code" : "999",
         "exit_code" : "999",
         "stdout" : "",
         "stdout" : "",
-        "status" : "UPGRADING",
+        "status" : "IN_PROGRESS",
         "command" : "UPGRADE",
         "command" : "UPGRADE",
         "start_time" : "-1",
         "start_time" : "-1",
         "role" : "GANGLIA_MONITOR",
         "role" : "GANGLIA_MONITOR",

+ 8 - 0
ambari-web/app/controllers.js

@@ -29,6 +29,7 @@ require('controllers/main/admin');
 require('controllers/main/admin/cluster');
 require('controllers/main/admin/cluster');
 require('controllers/main/admin/stack_upgrade_controller');
 require('controllers/main/admin/stack_upgrade_controller');
 require('controllers/main/admin/user');
 require('controllers/main/admin/user');
+require('controllers/main/admin/misc_controller');
 require('controllers/main/admin/user/edit');
 require('controllers/main/admin/user/edit');
 require('controllers/main/admin/user/create');
 require('controllers/main/admin/user/create');
 require('controllers/main/admin/advanced');
 require('controllers/main/admin/advanced');
@@ -49,6 +50,7 @@ require('controllers/main/service/add_controller');
 require('controllers/main/service/reassign_controller');
 require('controllers/main/service/reassign_controller');
 require('controllers/main/host');
 require('controllers/main/host');
 require('controllers/main/host/details');
 require('controllers/main/host/details');
+require('controllers/main/host/configs_service');
 require('controllers/main/host/add_controller');
 require('controllers/main/host/add_controller');
 require('controllers/main/charts');
 require('controllers/main/charts');
 require('controllers/main/charts/heatmap_metrics/heatmap_metric');
 require('controllers/main/charts/heatmap_metrics/heatmap_metric');
@@ -76,6 +78,12 @@ require('controllers/main/charts/heatmap');
 require('controllers/main/apps_controller');
 require('controllers/main/apps_controller');
 require('controllers/main/apps/item_controller');
 require('controllers/main/apps/item_controller');
 require('controllers/main/mirroring_controller');
 require('controllers/main/mirroring_controller');
+require('controllers/main/mirroring/dataset_controller');
+require('controllers/main/mirroring/datasets_controller');
+require('controllers/main/mirroring/jobs_controller');
+require('controllers/main/mirroring/targetClusterController');
+require('controllers/main/mirroring/testConnection_controller');
+require('controllers/main/mirroring/testConnectionResults_controller');
 require('controllers/wizard/slave_component_groups_controller');
 require('controllers/wizard/slave_component_groups_controller');
 require('controllers/wizard/step1_controller');
 require('controllers/wizard/step1_controller');
 require('controllers/wizard/step2_controller');
 require('controllers/wizard/step2_controller');

+ 46 - 317
ambari-web/app/controllers/global/background_operations_controller.js

@@ -26,9 +26,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
    */
    */
   isWorking : false,
   isWorking : false,
 
 
-  allOperations: [],
   allOperationsCount : 0,
   allOperationsCount : 0,
-  executeTasks: [],
 
 
   /**
   /**
    * For host component popup
    * For host component popup
@@ -36,309 +34,75 @@ App.BackgroundOperationsController = Em.Controller.extend({
   services:[],
   services:[],
   serviceTimestamp: null,
   serviceTimestamp: null,
 
 
-  /**
-   * Task life time after finishing
-   */
-  taskLifeTime: 5*60*1000,
-
-  getOperationsForRequestId: function(requestId){
-    return this.get('allOperations').filterProperty('request_id', requestId);
-  },
-
   /**
   /**
    * Start polling, when <code>isWorking</code> become true
    * Start polling, when <code>isWorking</code> become true
    */
    */
   startPolling: function(){
   startPolling: function(){
     if(this.get('isWorking')){
     if(this.get('isWorking')){
-      App.updater.run(this, 'loadOperations', 'isWorking', App.bgOperationsUpdateInterval);
+      App.updater.run(this, 'requestMostRecent', 'isWorking', App.bgOperationsUpdateInterval);
     }
     }
   }.observes('isWorking'),
   }.observes('isWorking'),
 
 
   /**
   /**
-   * Reload operations
-   * @param callback on done Callback. Look art <code>App.updater.run</code> for more information
-   * @return jquery ajax object
+   * Get all requests from server
+   * @param callback
    */
    */
-  loadOperations : function(callback){
-
-    if(!App.get('clusterName')){
-      callback();
-      return null;
-    }
-
-    return App.ajax.send({
-      'name': 'background_operations',
+  requestMostRecent: function(callback){
+    App.ajax.send({
+      name: 'background_operations.get_most_recent',
       'sender': this,
       'sender': this,
-      'success': 'updateBackgroundOperations', //todo provide interfaces for strings and functions
+      'success': 'callBackForMostRecent',
       'callback': callback
       'callback': callback
     });
     });
   },
   },
 
 
   /**
   /**
-   * Callback for update finished task request.
-   * @param data Json answer
+   * Prepare recived from server requests for host component popup
+   * @param data
    */
    */
-  updateFinishedTask: function(data){
-    var executeTasks = this.get('executeTasks');
-    if (data) {
-      var _oldTask = executeTasks.findProperty('id', data.Tasks.id);
-      if(_oldTask){
-        data.Tasks.finishedTime = new Date().getTime();
-        $.extend(_oldTask, data.Tasks);
+  callBackForMostRecent: function(data){
+    this.get("services").clear();
+    var runningServices = 0;
+    var self = this;
+    data.items = data.items.sort(function(a,b){return b.Requests.id - a.Requests.id}).slice( 0, 10);
+    data.items.forEach(function(request){
+      var rq = Em.Object.create({
+        id:request.Requests.id,
+        name: 'Request name not specified',
+        displayName: 'Request name not specified',
+        progress:10,
+        status: "",
+        isRunning: false,
+        hosts: []
+      })
+      if(request.Requests.request_context != ""){
+        rq.name = request.Requests.request_context;
+        rq.displayName = request.Requests.request_context;
       }
       }
-    }
-  },
-
-  /**
-   * Update info about background operations
-   * Put all tasks with command 'EXECUTE' into <code>executeTasks</code>, other tasks with it they are still running put into <code>runningTasks</code>
-   * Put all task that should be shown in popup modal window into <code>this.allOperations</code>
-   * @param data json loaded from server
-   */
-  updateBackgroundOperations: function (data) {
-    var runningTasks = [];
-    var executeTasks = this.get('executeTasks');
-    data.items.forEach(function (item) {
-      item.tasks.forEach(function (task) {
-        task.Tasks.display_exit_code = (task.Tasks.exit_code !== 999);
-
-        if (task.Tasks.command == 'EXECUTE') {
-
-          var _oldTask = executeTasks.findProperty('id', task.Tasks.id);
-          if (!_oldTask) {
-            executeTasks.push(task.Tasks);
-          } else {
-            $.extend(_oldTask, task.Tasks);
-          }
-
-        } else if(['QUEUED', 'PENDING', 'IN_PROGRESS'].contains(task.Tasks.status)){
-          runningTasks.push(task.Tasks);
-        }
-      });
-    });
 
 
-    var time = new Date().getTime() - this.get('taskLifeTime');
-    var tasksToRemove = [];
-    executeTasks.forEach(function(_task, index){
-      if(['FAILED', 'COMPLETED', 'TIMEDOUT', 'ABORTED'].contains(_task.status) && _task.finishedTime && _task.finishedTime < time){
-        tasksToRemove.push(index);
+      var runningTasks = 0;
+      runningTasks = request.tasks.filterProperty('Tasks.status', 'QUEUED').length;
+      runningTasks += request.tasks.filterProperty('Tasks.status', 'IN_PROGRESS').length;
+      runningTasks += request.tasks.filterProperty('Tasks.status', 'PENDING').length;
+      if(runningTasks > 0){
+        runningServices++;
       }
       }
 
 
-      if(['QUEUED', 'PENDING', 'IN_PROGRESS'].contains(_task.status)){
-        App.ajax.send({
-          name: 'background_operations.update_task',
-          data: {
-            requestId: _task.request_id,
-            taskId: _task.id
-          },
-          'sender': this,
-          'success': 'updateFinishedTask'
+      var hostNames = request.tasks.mapProperty('Tasks.host_name').uniq();
+      hostNames.forEach(function (name) {
+        var tasks = request.tasks.filterProperty("Tasks.host_name",name);
+        rq.get("hosts").push({
+          name: name,
+          publicName: name,
+          logTasks: tasks
         });
         });
-      }
-    }, this);
-
-
-    tasksToRemove.reverse().forEach(function(index){
-      executeTasks.removeAt(index);
-    });
-
-
-    var currentTasks;
-    currentTasks = runningTasks.concat(executeTasks);
-    currentTasks = currentTasks.sort(function (a, b) {
-      return a.id - b.id;
-    });
-
-    this.get('allOperations').filterProperty('isOpen').forEach(function(task){
-      var _task = currentTasks.findProperty('id', task.id);
-      if (_task) {
-        _task.isOpen = true;
-      }
-    });
-
-    this.set('allOperations', currentTasks);
-    this.set('allOperationsCount', runningTasks.length + executeTasks.filterProperty('status', 'PENDING').length + executeTasks.filterProperty('status', 'QUEUED').length + executeTasks.filterProperty('status', 'IN_PROGRESS').length);
-
-    var eventsArray = this.get('eventsArray');
-    if (eventsArray.length) {
-
-      var itemsToRemove = [];
-      eventsArray.forEach(function(item){
-        //if when returns true
-        if(item.when(this)){
-          //fire do method
-          item.do();
-          //and remove it
-          itemsToRemove.push(item);
-        }
-      }, this);
-
-      itemsToRemove.forEach(function(item){
-        eventsArray.splice(eventsArray.indexOf(item), 1);
       });
       });
-    }
-  },
-
-  /**
-   * Start code for hostcomponent popup in test mode for now
-   */
-  POLL_INTERVAL: 10,
-  isPolling: false,
-  installedServices: App.Service.find(),
-  simulateAttempt:0,
-
-  startPolling1: function(){
-    var url = '';
-    if(!this.get('isPolling')){
-      this.set('isPolling', true);
-      if (App.testMode) {
-        this.simulatePolling();
-      } else {
-        //pass an interval "1" to start poll immediately first time
-        this.doPoll(url, 1);
-      }
-    }
-  },
-
-  simulatePolling: function(){
-    var simulateAttempt = this.get('simulateAttempt');
-    var URLs = [
-      '/data/wizard/upgrade/poll_1.json',
-      '/data/wizard/upgrade/poll_2.json',
-      '/data/wizard/upgrade/poll_3.json',
-      '/data/wizard/upgrade/poll_4.json',
-      '/data/wizard/upgrade/poll_5.json',
-    ];
-    if(simulateAttempt < 5){
-      if(this.get("simulateAttempt")==4){
-        this.set("POLL_INTERVAL",4000);
-      }
-      this.doPoll(URLs[simulateAttempt]);
-      this.set('simulateAttempt', ++simulateAttempt);
-    }
-  },
-
-  doPoll: function(url, interval){
-    var self = this;
-    var pollInterval = interval || self.POLL_INTERVAL;
-    if (self.get('isPolling')) {
-      setTimeout(function () {
-        $.ajax({
-          utype: 'GET',
-          url: url,
-          async: true,
-          timeout: App.timeout,
-          dataType: 'json',
-          success: function (data) {
-            var result = self.parseTasks(data);
-            if (App.testMode) {
-              self.simulatePolling();
-            } else {
-              self.doPoll(url);
-            }
-          },
-          error: function () {
-
-          },
-          statusCode: require('data/statusCodes')
-        }).retry({times: App.maxRetries, timeout: App.timeout}).then(null,
-            function () {
-              App.showReloadPopup();
-              console.log('Install services all retries failed');
-            }
-        );
-      }, pollInterval);
-    }
-  },
-
-  parseTasks: function(data){
-    var tasks = data.tasks || [];
-    this.get('services').forEach(function (service) {
-      var hosts = service.get('hosts');
-      var tasksPerService = [];
-      if(hosts.length){
-        hosts.forEach(function (host) {
-          var tasksPerHost = tasks.filter(function(task){
-            if(task.Tasks.host_name == host.name && host.get('components').contains(task.Tasks.role)){
-              return true;
-            }
-          });
-          if (tasksPerHost.length) {
-            this.setLogTasksStatePerHost(tasksPerHost, host);
-            tasksPerService = tasksPerService.concat(tasksPerHost);
-          }
-        }, this);
-      } else {
-        service.set('status', 'PENDING');
-        service.set('detailedMessage', Em.I18n.t('installer.stackUpgrade.step3.host.nothingToUpgrade'));
-      }
-    }, this);
-    this.set('serviceTimestamp', new Date().getTime());
-    return true;
-  },
-
-  setLogTasksStatePerHost: function (tasksPerHost, host) {
-    tasksPerHost.forEach(function (_task) {
-      var task = host.get('logTasks').findProperty('Tasks.id', _task.Tasks.id);
-      if (task) {
-        host.get('logTasks').removeObject(task);
-      }
-      host.get('logTasks').pushObject(_task);
-    }, this);
-  },
-
-  mockServices: [
-    Em.Object.create({
-      serviceName: 'GANGLIA',
-      displayName: 'Ganglia Update',
-      workStatus: 'STARTED',
-      hostComponents: []
-    }),
-    Em.Object.create({
-      serviceName: 'HDFS',
-      displayName: 'HDFS Update',
-      workStatus: 'STARTED',
-      hostComponents: []
-    })
-  ],
-
-  loadServices: function(){
-    var installedServices = App.testMode ? this.get('mockServices') : this.get('content.servicesInfo');
-    var services = [];
-    installedServices.forEach(function(_service){
-      services.push(Em.Object.create({
-        name: _service.get('serviceName'),
-        displayName: _service.get('displayName'),
-        hosts: this.loadHosts(_service),
-        progress: 0,
-        status: "PENDING",
-        detailMessage:''
-      }));
-    }, this);
-    this.set('services', services);
-  }.observes('content.servicesInfo'),
-
-  loadHosts: function(service){
-    var hostComponents = App.HostComponent.find().filterProperty('service.serviceName', service.get('serviceName'));
-    var hosts = hostComponents.mapProperty('host').uniq();
-    var result = [];
-    hosts.forEach(function(host){
-      result.push(Em.Object.create({
-        name: host.get('hostName'),
-        publicName: host.get('publicHostName'),
-        logTasks: [],
-        components: hostComponents.filterProperty('host.hostName', host.get('hostName')).mapProperty('componentName')
-      }));
+      self.get("services").push(rq);
     });
     });
-    return result;
+    self.set("allOperationsCount",runningServices);
+    self.set('serviceTimestamp', new Date().getTime());
   },
   },
 
 
-  /**
-   * End code for hostcomponent popup
-   */
-
-
-  /**
 
 
   /**
   /**
    * Onclick handler for background operations number located right to logo
    * Onclick handler for background operations number located right to logo
@@ -346,46 +110,11 @@ App.BackgroundOperationsController = Em.Controller.extend({
    */
    */
   showPopup: function(){
   showPopup: function(){
     if(App.testMode){
     if(App.testMode){
-      this.set("POLL_INTERVAL",10);
-      this.set("isPolling",false);
-      this.set("simulateAttempt",0);
-      this.loadServices();
-      this.startPolling1();
       App.HostPopup.initPopup("", this, true);
       App.HostPopup.initPopup("", this, true);
     }else{
     }else{
-      this.set('executeTasks', []);
-      App.updater.immediateRun('loadOperations');
-      return App.ModalPopup.show({
-        headerClass: Ember.View.extend({
-          controller: this,
-          template:Ember.Handlebars.compile('{{allOperationsCount}} Background Operations Running')
-        }),
-        bodyClass: Ember.View.extend({
-          controller: this,
-          templateName: require('templates/main/background_operations_popup')
-        }),
-        onPrimary: function() {
-          this.hide();
-        },
-        secondary : null
-      });
+      App.updater.immediateRun('requestMostRecent');
+      App.HostPopup.initPopup("", this, true);
     }
     }
-  },
-
-  /**
-   * Example of data inside:
-   * {
-   *   when : function(backgroundOperationsController){
-   *     return backgroundOperationsController.getOperationsForRequestId(requestId).length == 0;
-   *   },
-   *   do : function(){
-   *     component.set('status', 'cool');
-   *   }
-   * }
-   *
-   * Function <code>do</code> will be fired once, when <code>when</code> returns true.
-   * Example, how to use it, you can see in app\controllers\main\host\details.js
-   */
-  eventsArray : []
+  }
 
 
 });
 });

+ 12 - 4
ambari-web/app/controllers/global/cluster_controller.js

@@ -75,9 +75,7 @@ App.ClusterController = Em.Controller.extend({
       success:function (data) {
       success:function (data) {
         self.set('cluster', data.items[0]);
         self.set('cluster', data.items[0]);
         App.set('clusterName', data.items[0].Clusters.cluster_name);
         App.set('clusterName', data.items[0].Clusters.cluster_name);
-        if(data.items[0].Clusters.version){
-          App.set('currentStackVersion', data.items[0].Clusters.version);
-        }
+        App.set('currentStackVersion', data.items[0].Clusters.version);
       },
       },
       error:function (request, ajaxOptions, error) {
       error:function (request, ajaxOptions, error) {
         console.log('failed on loading cluster name');
         console.log('failed on loading cluster name');
@@ -85,6 +83,9 @@ App.ClusterController = Em.Controller.extend({
       },
       },
       statusCode:require('data/statusCodes')
       statusCode:require('data/statusCodes')
     });
     });
+    if(!App.get('currentStackVersion')){
+      App.set('currentStackVersion', App.defaultStackVersion);
+    }
   },
   },
 
 
   getUrl:function (testUrl, url) {
   getUrl:function (testUrl, url) {
@@ -354,5 +355,12 @@ App.ClusterController = Em.Controller.extend({
 
 
   clusterName:function () {
   clusterName:function () {
     return (this.get('cluster')) ? this.get('cluster').Clusters.cluster_name : null;
     return (this.get('cluster')) ? this.get('cluster').Clusters.cluster_name : null;
-  }.property('cluster')
+  }.property('cluster'),
+  
+  updateClusterData: function () {
+    var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
+    App.HttpClient.get(clusterUrl, App.clusterMapper, {
+      complete:function(){}
+    });
+  }
 })
 })

+ 0 - 93
ambari-web/app/controllers/installer.js

@@ -138,52 +138,6 @@ App.InstallerController = App.WizardController.extend({
     console.log("InstallerController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
     console.log("InstallerController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
   },
   },
 
 
-  /**
-   * Save config properties
-   * @param stepController Step7WizardController
-   */
-  saveServiceConfigProperties: function (stepController) {
-    var serviceConfigProperties = [];
-    stepController.get('stepConfigs').forEach(function (_content) {
-      _content.get('configs').forEach(function (_configProperties) {
-        var displayType = _configProperties.get('displayType');
-        if (displayType === 'directories' || displayType === 'directory') {
-          var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
-          _configProperties.set('value', value);
-        }
-        var overrides = _configProperties.get('overrides');
-        var overridesArray = [];
-        if(overrides!=null){
-          overrides.forEach(function(override){
-            var overrideEntry = {
-                value: override.get('value'),
-                hosts: []
-            };
-            override.get('selectedHostOptions').forEach(function(host){
-              overrideEntry.hosts.push(host);
-            });
-            overridesArray.push(overrideEntry);
-          });
-        }
-        var configProperty = {
-          id: _configProperties.get('id'),
-          name: _configProperties.get('name'),
-          value: _configProperties.get('value'),
-          defaultValue: _configProperties.get('defaultValue'),
-          service: _configProperties.get('serviceName'),
-          domain:  _configProperties.get('domain'),
-          filename: _configProperties.get('filename'),
-          overrides: overridesArray
-        };
-        serviceConfigProperties.push(configProperty);
-      }, this);
-
-    }, this);
-
-    App.db.setServiceConfigProperties(serviceConfigProperties);
-    this.set('content.serviceConfigProperties', serviceConfigProperties);
-  },
-
   /**
   /**
    * Load serviceConfigProperties to model
    * Load serviceConfigProperties to model
    */
    */
@@ -255,53 +209,6 @@ App.InstallerController = App.WizardController.extend({
         this.load('cluster');
         this.load('cluster');
     }
     }
   },
   },
-
-  loadAdvancedConfigs: function () {
-    var configs = [];
-    App.db.getSelectedServiceNames().forEach(function (_serviceName) {
-      var serviceComponents = this.loadAdvancedConfig(_serviceName);
-      configs = configs.concat(serviceComponents);
-    }, this);
-    this.set('content.advancedServiceConfig', configs);
-    App.db.setAdvancedServiceConfig(configs);
-  },
-
-  /**
-   * Generate serviceProperties save it to localdata
-   * called form stepController step6WizardController
-   */
-  loadAdvancedConfig: function (serviceName) {
-    var self = this;
-    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + App.get('stackVersionURL') + '/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
-    var method = 'GET';
-    var serviceComponents;
-    $.ajax({
-      type: method,
-      url: url,
-      async: false,
-      dataType: 'text',
-      timeout: App.timeout,
-      success: function (data) {
-        var jsonData = jQuery.parseJSON(data);
-        console.log("TRACE: Step6 submit -> In success function for the loadAdvancedConfig call");
-        console.log("TRACE: Step6 submit -> value of the url is: " + url);
-        serviceComponents = jsonData.properties;
-        serviceComponents.setEach('serviceName', serviceName);
-        console.log('TRACE: servicename: ' + serviceName);
-      },
-
-      error: function (request, ajaxOptions, error) {
-        console.log("TRACE: STep6 submit -> In error function for the loadAdvancedConfig call");
-        console.log("TRACE: STep6 submit-> value of the url is: " + url);
-        console.log("TRACE: STep6 submit-> error code status is: " + request.status);
-        console.log('Step6 submit: Error message is: ' + request.responseText);
-      },
-
-      statusCode: require('data/statusCodes')
-    });
-    return serviceComponents;
-  },
-
   /**
   /**
    * Clear all temporary data
    * Clear all temporary data
    */
    */

+ 7 - 0
ambari-web/app/controllers/main.js

@@ -44,9 +44,16 @@ App.MainController = Em.Controller.extend({
    * run all processes and cluster's data loading
    * run all processes and cluster's data loading
    */
    */
   initialize: function(){
   initialize: function(){
+    this.initAdmin();
     App.router.get('clusterController').loadClusterData();
     App.router.get('clusterController').loadClusterData();
     this.startPolling();
     this.startPolling();
   },
   },
+  initAdmin: function(){
+    if(App.db && App.db.getUser() && App.db.getUser().admin) {
+      App.set('isAdmin', true);
+      console.log('Administrator logged in');
+    }
+  },
   startPolling: function(){
   startPolling: function(){
     App.router.get('updateController').set('isWorking', true);
     App.router.get('updateController').set('isWorking', true);
     App.router.get('backgroundOperationsController').set('isWorking', true);
     App.router.get('backgroundOperationsController').set('isWorking', true);

+ 37 - 20
ambari-web/app/controllers/main/admin/cluster.js

@@ -42,11 +42,19 @@ App.MainAdminClusterController = Em.Controller.extend({
         dataType: 'json',
         dataType: 'json',
         timeout: App.timeout,
         timeout: App.timeout,
         success: function (data) {
         success: function (data) {
+          var currentVersion = App.currentStackVersion.replace(/HDP-/, '');
+          var minUpgradeVersion = currentVersion;
           upgradeVersion = upgradeVersion.replace(/HDP-/, '');
           upgradeVersion = upgradeVersion.replace(/HDP-/, '');
-          data.filterProperty('name', 'HDP').mapProperty('version').forEach(function(version){
+          data = data.filterProperty('name', 'HDP');
+          data.mapProperty('version').forEach(function(version){
             upgradeVersion = (upgradeVersion < version) ? version : upgradeVersion;
             upgradeVersion = (upgradeVersion < version) ? version : upgradeVersion;
           });
           });
-          installedServices = data.findProperty('version', App.currentStackVersion.replace(/HDP-/, ''));
+          //TODO remove hardcoded upgrade version
+          upgradeVersion = (App.testMode)?'1.3.0': upgradeVersion;
+          minUpgradeVersion = data.findProperty('version', upgradeVersion).minUpgradeVersion;
+          minUpgradeVersion = (minUpgradeVersion) ? minUpgradeVersion : currentVersion;
+          upgradeVersion = (minUpgradeVersion <= currentVersion) ? upgradeVersion : currentVersion;
+          installedServices = data.findProperty('version', currentVersion);
           newServices = data.findProperty('version', upgradeVersion);
           newServices = data.findProperty('version', upgradeVersion);
           upgradeVersion = 'HDP-' + upgradeVersion;
           upgradeVersion = 'HDP-' + upgradeVersion;
         },
         },
@@ -56,9 +64,13 @@ App.MainAdminClusterController = Em.Controller.extend({
         statusCode: require('data/statusCodes')
         statusCode: require('data/statusCodes')
       });
       });
       this.set('upgradeVersion', upgradeVersion);
       this.set('upgradeVersion', upgradeVersion);
-      this.parseServicesInfo(installedServices, newServices);
+      if(installedServices && newServices){
+        this.parseServicesInfo(installedServices, newServices);
+      } else {
+        console.log('HDP stack doesn\'t have services with defaultStackVersion');
+      }
     }
     }
-  }.observes('App.router.clusterController.isLoaded'),
+  }.observes('App.router.clusterController.isLoaded', 'App.currentStackVersion'),
   /**
   /**
    * parse services info(versions, description) by version
    * parse services info(versions, description) by version
    */
    */
@@ -70,23 +82,28 @@ App.MainAdminClusterController = Em.Controller.extend({
       // loop through all the service components
       // loop through all the service components
       for (var i = 0; i < displayOrderConfig.length; i++) {
       for (var i = 0; i < displayOrderConfig.length; i++) {
         var entry = oldServices.services.findProperty("name", displayOrderConfig[i].serviceName);
         var entry = oldServices.services.findProperty("name", displayOrderConfig[i].serviceName);
-        if (installedServices.contains(entry.name)) {
-          var myService = Em.Object.create({
-            serviceName: entry.name,
-            displayName: displayOrderConfig[i].displayName,
-            isDisabled: i === 0,
-            isSelected: true,
-            isInstalled: false,
-            isHidden: displayOrderConfig[i].isHidden,
-            description: entry.comment,
-            version: entry.version,
-            newVersion: newServices.services.findProperty("name", displayOrderConfig[i].serviceName).version
-          });
-          //From 1.3.0 for Hive we display only "Hive" (but it installes HCat and WebHCat as well)
-          if (this.get('upgradeVersion').replace(/HDP-/, '') >= '1.3.0' && displayOrderConfig[i].serviceName == 'HIVE') {
-            myService.set('displayName', 'Hive');
+        if (entry) {
+          if (installedServices.contains(entry.name)) {
+            var myService = Em.Object.create({
+              serviceName: entry.name,
+              displayName: displayOrderConfig[i].displayName,
+              isDisabled: i === 0,
+              isSelected: true,
+              isInstalled: false,
+              isHidden: displayOrderConfig[i].isHidden,
+              description: entry.comment,
+              version: entry.version,
+              newVersion: newServices.services.findProperty("name", displayOrderConfig[i].serviceName).version
+            });
+            //From 1.3.0 for Hive we display only "Hive" (but it installes HCat and WebHCat as well)
+            if (this.get('upgradeVersion').replace(/HDP-/, '') >= '1.3.0' && displayOrderConfig[i].serviceName == 'HIVE') {
+              myService.set('displayName', 'Hive');
+            }
+            result.push(myService);
           }
           }
-          result.push(myService);
+        }
+        else {
+          console.warn('Service not found - ', displayOrderConfig[i].serviceName);
         }
         }
       }
       }
     }
     }

+ 64 - 0
ambari-web/app/controllers/main/admin/misc_controller.js

@@ -0,0 +1,64 @@
+/**
+ * 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/service/info/configs');
+
+App.MainAdminMiscController = App.MainServiceInfoConfigsController.extend({
+  name:'mainAdminMiscController',
+  users: null,
+  content: {
+    serviceName: 'MISC'
+  },
+  loadUsers: function() {
+    this.set('selectedService', 'MISC');
+    this.loadServiceConfig();
+  },
+  loadServiceConfig: function() {
+    App.ajax.send({
+      name: 'config.tags',
+      sender: this,
+      data: {
+        serviceName: this.get('content.serviceName'),
+        serviceConfigsDef: this.get('serviceConfigs').findProperty('serviceName', this.get('content.serviceName'))
+      },
+      success: 'loadServiceTagSuccess'
+    });
+  },
+  loadServiceTagSuccess: function(data, opt, params) {
+    var serviceConfigsDef = params.serviceConfigsDef;
+    var serviceName = this.get('content.serviceName');
+    var loadedClusterSiteToTagMap = {};
+
+    for ( var site in data.Clusters.desired_configs) {
+      if (serviceConfigsDef.sites.indexOf(site) > -1) {
+        loadedClusterSiteToTagMap[site] = data.Clusters.desired_configs[site]['tag'];
+      }
+    }
+    this.setServiceConfigTags(loadedClusterSiteToTagMap);
+    var configGroups = App.config.loadConfigsByTags(this.get('serviceConfigTags'));
+    var configSet = App.config.mergePreDefinedWithLoaded(configGroups, [], this.get('serviceConfigTags'), serviceName);
+
+    var misc_configs = configSet.globalConfigs.filterProperty('serviceName', 'MISC').filterProperty('category', 'Users and Groups').filterProperty('isVisible', true);
+    this.set('users', misc_configs);
+    this.set('dataIsLoaded', true);
+
+  }
+
+});

+ 0 - 33
ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js

@@ -92,39 +92,6 @@ App.AddSecurityController = App.WizardController.extend({
   loadServiceConfigs: function () {
   loadServiceConfigs: function () {
     var serviceConfigProperties = App.db.getServiceConfigProperties();
     var serviceConfigProperties = App.db.getServiceConfigProperties();
     this.set('content.serviceConfigProperties', serviceConfigProperties);
     this.set('content.serviceConfigProperties', serviceConfigProperties);
-  },
-
-  /**
-   * Save config properties
-   * @param stepController Step2AddSecurityController
-   */
-  saveServiceConfigProperties: function (stepController) {
-    var serviceConfigProperties = [];
-    stepController.get('stepConfigs').forEach(function (_content) {
-      _content.get('configs').forEach(function (_configProperties) {
-        var displayType = _configProperties.get('displayType');
-        if (displayType === 'directories' || displayType === 'directory') {
-          var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
-          _configProperties.set('value', value);
-        }
-        if (_configProperties.get('value')) {
-          var configProperty = {
-            id: _configProperties.get('id'),
-            name: _configProperties.get('name'),
-            value: _configProperties.get('value'),
-            defaultValue: _configProperties.get('defaultValue'),
-            service: _configProperties.get('serviceName'),
-            filename: _configProperties.get('filename')
-          };
-          serviceConfigProperties.push(configProperty);
-        }
-      }, this);
-
-    }, this);
-
-    App.db.setServiceConfigProperties(serviceConfigProperties);
-    this.set('content.serviceConfigProperties', serviceConfigProperties);
   }
   }
-
 });
 });
 
 

+ 3 - 3
ambari-web/app/controllers/main/admin/security/add/step3.js

@@ -77,7 +77,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         newService.hosts.push({
         newService.hosts.push({
           name: name,
           name: name,
           publicName: name,
           publicName: name,
-          logTasks: stages.polledData
+          logTasks: stages.polledData.filterProperty("Tasks.host_name",name)
         });
         });
       });
       });
       services.push(newService);
       services.push(newService);
@@ -152,7 +152,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
   addInfoToStage2: function () {
   addInfoToStage2: function () {
     var stage2 = this.get('stages').findProperty('stage', 'stage2');
     var stage2 = this.get('stages').findProperty('stage', 'stage2');
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
-    var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
+    var data = '{"RequestInfo": {"context" :"' + Em.I18n.t('requestInfo.stopAllServices') + '"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
     stage2.set('url', url);
     stage2.set('url', url);
     stage2.set('data', data);
     stage2.set('data', data);
   },
   },
@@ -164,7 +164,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
   addInfoToStage4: function () {
   addInfoToStage4: function () {
     var stage4 = this.get('stages').findProperty('stage', 'stage4');
     var stage4 = this.get('stages').findProperty('stage', 'stage4');
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
-    var data = '{"ServiceInfo": {"state": "STARTED"}}';
+    var data = '{"RequestInfo": {"context": "' + Em.I18n.t('requestInfo.startAllServices') + '"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
     stage4.set('url', url);
     stage4.set('url', url);
     stage4.set('data', data);
     stage4.set('data', data);
   },
   },

+ 2 - 2
ambari-web/app/controllers/main/admin/security/disable.js

@@ -113,7 +113,7 @@ App.MainAdminSecurityDisableController = Em.Controller.extend({
   addInfoToStage2: function () {
   addInfoToStage2: function () {
     var stage2 = this.get('stages').findProperty('stage', 'stage2');
     var stage2 = this.get('stages').findProperty('stage', 'stage2');
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
-    var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
+    var data = '{"RequestInfo": {"context": "' + Em.I18n.t('requestInfo.stopAllServices') + '"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
     stage2.set('url', url);
     stage2.set('url', url);
     stage2.set('data', data);
     stage2.set('data', data);
   },
   },
@@ -125,7 +125,7 @@ App.MainAdminSecurityDisableController = Em.Controller.extend({
   addInfoToStage4: function () {
   addInfoToStage4: function () {
     var stage4 = this.get('stages').findProperty('stage', 'stage4');
     var stage4 = this.get('stages').findProperty('stage', 'stage4');
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
     var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
-    var data = '{"ServiceInfo": {"state": "STARTED"}}';
+    var data = '{"RequestInfo": {"context": "' + Em.I18n.t('requestInfo.startAllServices') + '"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
     stage4.set('url', url);
     stage4.set('url', url);
     stage4.set('data', data);
     stage4.set('data', data);
   },
   },

+ 0 - 27
ambari-web/app/controllers/main/admin/stack_upgrade_controller.js

@@ -66,33 +66,6 @@ App.StackUpgradeController = App.WizardController.extend({
   upgradeOptionsTemplate:{
   upgradeOptionsTemplate:{
     localRepo: false
     localRepo: false
   },
   },
-  /**
-   * run stop services before upgrade phase
-   */
-  stopServices: function () {
-    var clusterName = this.get('content.cluster.name');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=STARTED';
-    var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
-    var method = (App.testMode) ? 'GET' : 'PUT';
-    $.ajax({
-      type: method,
-      url: url,
-      async: false,
-      data: data,
-      dataType: 'text',
-      timeout: App.timeout,
-      success: function (data) {
-        var jsonData = jQuery.parseJSON(data);
-        console.log("TRACE: Step3 -> In success function for the stopService call");
-        console.log("TRACE: Step3 -> value of the url is: " + url);
-        console.log("TRACE: Step3 -> value of the received data is: " + jsonData);
-      },
-      error: function () {
-        console.log("Call to stop services failed");
-      },
-      statusCode: require('data/statusCodes')
-    });
-  },
   clear: function () {
   clear: function () {
     this.set('content', Ember.Object.create({
     this.set('content', Ember.Object.create({
       servicesInfo: function(){
       servicesInfo: function(){

+ 0 - 92
ambari-web/app/controllers/main/host/add_controller.js

@@ -261,46 +261,6 @@ App.AddHostController = App.WizardController.extend({
     console.log("AddHostController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
     console.log("AddHostController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
   },
   },
 
 
-  /**
-   * Save config properties
-   * @param stepController Step7WizardController
-   */
-  saveServiceConfigProperties: function (stepController) {
-    var serviceConfigProperties = [];
-    stepController.get('stepConfigs').forEach(function (_content) {
-      _content.get('configs').forEach(function (_configProperties) {
-        var displayType = _configProperties.get('displayType');
-        if (displayType === 'directories' || displayType === 'directory') {
-          var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
-          _configProperties.set('value', value);
-        }
-        var configProperty = {
-          id: _configProperties.get('id'),
-          name: _configProperties.get('name'),
-          value: _configProperties.get('value'),
-          defaultValue: _configProperties.get('defaultValue'),
-          service: _configProperties.get('serviceName'),
-          domain:  _configProperties.get('domain'),
-          filename: _configProperties.get('filename')
-        };
-        serviceConfigProperties.push(configProperty);
-      }, this);
-
-    }, this);
-
-    App.db.setServiceConfigProperties(serviceConfigProperties);
-    this.set('content.serviceConfigProperties', serviceConfigProperties);
-  },
-
-  /**
-   * Load serviceConfigProperties to model
-   */
-  loadServiceConfigProperties: function () {
-    var serviceConfigProperties = App.db.getServiceConfigProperties();
-    this.set('content.serviceConfigProperties', serviceConfigProperties);
-    console.log("AddHostController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
-  },
-
   /**
   /**
    * Load information about hosts with clients components
    * Load information about hosts with clients components
    */
    */
@@ -363,58 +323,6 @@ App.AddHostController = App.WizardController.extend({
     }
     }
   },
   },
 
 
-  /**
-   * load advanced configs for all selected services
-   */
-  loadAdvancedConfigs: function () {
-    this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName').forEach(function (_serviceName) {
-      this.loadAdvancedConfig(_serviceName);
-    }, this);
-  },
-
-  /**
-   * load advanced config for one service
-   * @param serviceName
-   */
-  loadAdvancedConfig: function (serviceName) {
-    var self = this;
-    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + App.get('stackVersionURL') + '/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
-    var method = 'GET';
-    $.ajax({
-      type: method,
-      url: url,
-      async: false,
-      dataType: 'text',
-      timeout: App.timeout,
-      success: function (data) {
-        var jsonData = jQuery.parseJSON(data);
-        console.log("TRACE: Step6 submit -> In success function for the loadAdvancedConfig call");
-        console.log("TRACE: Step6 submit -> value of the url is: " + url);
-        var serviceComponents = jsonData.properties;
-        serviceComponents.setEach('serviceName', serviceName);
-        var configs;
-        if (App.db.getAdvancedServiceConfig()) {
-          configs = App.db.getAdvancedServiceConfig();
-        } else {
-          configs = [];
-        }
-        configs = configs.concat(serviceComponents);
-        self.set('content.advancedServiceConfig', configs);
-        App.db.setAdvancedServiceConfig(configs);
-        console.log('TRACE: servicename: ' + serviceName);
-      },
-
-      error: function (request, ajaxOptions, error) {
-        console.log("TRACE: STep6 submit -> In error function for the loadAdvancedConfig call");
-        console.log("TRACE: STep6 submit-> value of the url is: " + url);
-        console.log("TRACE: STep6 submit-> error code status is: " + request.status);
-        console.log('Step6 submit: Error message is: ' + request.responseText);
-      },
-
-      statusCode: require('data/statusCodes')
-    });
-  },
-
   /**
   /**
    * Remove all loaded data.
    * Remove all loaded data.
    * Created as copy for App.router.clearAllSteps
    * Created as copy for App.router.clearAllSteps

+ 137 - 0
ambari-web/app/controllers/main/host/configs_service.js

@@ -0,0 +1,137 @@
+/**
+ * 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.MainHostServiceConfigsController = App.MainServiceInfoConfigsController.extend({
+  name: 'mainHostServiceConfigsController',
+  host: null,
+  /**
+   * On load function
+   */
+  loadStep: function () {
+    var content = this.get('content');
+    this.set('host', content.host);
+    this._super();
+  },
+
+  /**
+   * Removes categories which are not valid for this host. Ex: Remove JOBTRACKER
+   * category on host which does not have it installed.
+   */
+  renderServiceConfigs: function (serviceConfigs) {
+    var newServiceConfigs = jQuery.extend({}, serviceConfigs);
+    var hostHostComponentNames = [];
+    var hostComponents = this.get('host.hostComponents');
+    if (hostComponents) {
+      hostComponents.forEach(function (hc) {
+        var name = hc.get('componentName');
+        if (!hostHostComponentNames.contains(name)) {
+          hostHostComponentNames.push(name);
+        }
+      });
+    }
+    newServiceConfigs.configCategories = serviceConfigs.configCategories.filter(function (category) {
+      var hcNames = category.get('hostComponentNames');
+      if (hcNames != null && hcNames.length > 0) {
+        var show = false;
+        hcNames.forEach(function (name) {
+          if (hostHostComponentNames.contains(name)) {
+            show = true;
+          }
+        });
+        return show;
+      }
+      return true;
+    });
+    this._super(newServiceConfigs);
+  },
+
+  /**
+   * This method will *not load* the overridden properties. However it will
+   * replace the value shown for properties which this host has override for.
+   */
+  loadServiceConfigHostsOverrides: function (serviceConfig) {
+    var thisHostName = this.get('host.hostName');
+    var configKeyToConfigMap = {};
+    serviceConfig.configs.forEach(function (item) {
+      configKeyToConfigMap[item.name] = item;
+    });
+    var typeTagToHostMap = {};
+    var urlParams = [];
+    for ( var hostname in this.loadedHostToOverrideSiteToTagMap) {
+      if (hostname === thisHostName) {
+        var overrideTypeTags = this.loadedHostToOverrideSiteToTagMap[hostname];
+        for ( var type in overrideTypeTags) {
+          var tag = overrideTypeTags[type];
+          typeTagToHostMap[type + "///" + tag] = hostname;
+          urlParams.push('(type=' + type + '&tag=' + tag + ')');
+        }
+      }
+    }
+    if (urlParams.length > 0) {
+      var hostOverridesConfigsUrl = this.getUrl('', '/configurations?' + urlParams.join('|'));
+      $.ajax({
+        type: 'GET',
+        url: hostOverridesConfigsUrl,
+        async: false,
+        timeout: 10000,
+        dataType: 'json',
+        success: function (data) {
+          console.debug("loadServiceConfigHostsOverrides(" + hostOverridesConfigsUrl + "): Data=", data);
+          data.items.forEach(function (config) {
+            var hostname = typeTagToHostMap[config.type + "///" + config.tag];
+            var properties = config.properties;
+            for ( var prop in properties) {
+              var serviceConfig = configKeyToConfigMap[prop];
+              var hostOverrideValue = properties[prop];
+              if (serviceConfig && serviceConfig.displayType === 'int') {
+                if (/\d+m$/.test(hostOverrideValue)) {
+                  hostOverrideValue = hostOverrideValue.slice(0, hostOverrideValue.length - 1);
+                }
+              } else if (serviceConfig && serviceConfig.displayType === 'checkbox') {
+                switch (hostOverrideValue) {
+                  case 'true':
+                    hostOverrideValue = true;
+                    break;
+                  case 'false':
+                    hostOverrideValue = false;
+                    break;
+                }
+              }
+              if (serviceConfig) {
+                // Value of this property is different for this host.
+                console.log("loadServiceConfigHostsOverrides(" + thisHostName + "): [" + hostname + "] OVERRODE(" + serviceConfig.name + "): " + serviceConfig.value + " -> " + hostOverrideValue);
+                serviceConfig.value = hostOverrideValue;
+                serviceConfig.defaultValue = hostOverrideValue;
+                serviceConfig.isOriginalSCP = false;
+                serviceConfig.selectedHostOptions = [thisHostName];
+              }
+            }
+          });
+          console.log("loadServiceConfigHostsOverrides(" + thisHostName + "): Finished loading.");
+        },
+        error: function (request, ajaxOptions, error) {
+          console.log("TRACE: loadServiceConfigHostsOverrides(" + thisHostName + "): ERROR");
+          console.log("TRACE: value of the url is: " + hostOverridesConfigsUrl);
+          console.log("TRACE: error code status is: " + request.status);
+        },
+        statusCode: require('data/statusCodes')
+      });
+    }
+  }
+});

+ 73 - 44
ambari-web/app/controllers/main/host/details.js

@@ -94,8 +94,13 @@ App.MainHostDetailsController = Em.Controller.extend({
       var component = event.context;
       var component = event.context;
 
 
       self.sendCommandToServer('/hosts/' + self.get('content.hostName') + '/host_components/' + component.get('componentName').toUpperCase(),{
       self.sendCommandToServer('/hosts/' + self.get('content.hostName') + '/host_components/' + component.get('componentName').toUpperCase(),{
-        HostRoles:{
-          state: 'STARTED'
+        RequestInfo : {
+          "context" : Em.I18n.t('requestInfo.startHostComponent') + " " + component.get('componentName').toUpperCase()
+        },
+        Body:{
+          HostRoles:{
+            state: 'STARTED'
+          }
         }
         }
       }, 'PUT',
       }, 'PUT',
         function(requestId){
         function(requestId){
@@ -113,16 +118,6 @@ App.MainHostDetailsController = Em.Controller.extend({
           },App.testModeDelayForActions);
           },App.testModeDelayForActions);
         } else {
         } else {
           App.router.get('clusterController').loadUpdatedStatusDelayed(500);
           App.router.get('clusterController').loadUpdatedStatusDelayed(500);
-          App.router.get('backgroundOperationsController.eventsArray').push({
-            "when" : function(controller){
-              var result = (controller.getOperationsForRequestId(requestId).length == 0);
-              console.log('startComponent.when = ', result)
-              return result;
-            },
-            "do" : function(){
-              App.router.get('clusterController').loadUpdatedStatus();
-            }
-          });
         }
         }
 
 
         App.router.get('backgroundOperationsController').showPopup();
         App.router.get('backgroundOperationsController').showPopup();
@@ -131,6 +126,46 @@ App.MainHostDetailsController = Em.Controller.extend({
     });
     });
   },
   },
 
 
+  /**
+   * send command to server to upgrade selected host component
+   * @param event
+   */
+  upgradeComponent: function (event) {
+    var self = this;
+    var component = event.context;
+    App.showConfirmationPopup(function() {
+      self.sendCommandToServer('/hosts/' + self.get('content.hostName') + '/host_components/' + component.get('componentName').toUpperCase(),{
+            RequestInfo : {
+              "context" : Em.I18n.t('requestInfo.upgradeHostComponent') + " " + component.get('componentName').toUpperCase()
+            },
+            Body:{
+              HostRoles:{
+                stack_id: 'HDP-1.2.2',
+                state: 'INSTALLED'
+              }
+            }
+          }, 'PUT',
+          function(requestId){
+            if(!requestId){
+              return;
+            }
+
+            console.log('Send request for UPGRADE successfully');
+
+            if (App.testMode) {
+              component.set('workStatus', App.HostComponentStatus.starting);
+              setTimeout(function(){
+                component.set('workStatus', App.HostComponentStatus.started);
+              },App.testModeDelayForActions);
+            } else {
+              App.router.get('clusterController').loadUpdatedStatus();
+            }
+
+            App.router.get('backgroundOperationsController').showPopup();
+
+          });
+    });
+  },
   /**
   /**
    * send command to server to stop selected host component
    * send command to server to stop selected host component
    * @param event
    * @param event
@@ -140,8 +175,13 @@ App.MainHostDetailsController = Em.Controller.extend({
     App.showConfirmationPopup(function() {
     App.showConfirmationPopup(function() {
       var component = event.context;
       var component = event.context;
       self.sendCommandToServer('/hosts/' + self.get('content.hostName') + '/host_components/' + component.get('componentName').toUpperCase(),{
       self.sendCommandToServer('/hosts/' + self.get('content.hostName') + '/host_components/' + component.get('componentName').toUpperCase(),{
-        HostRoles:{
-          state: 'INSTALLED'
+        RequestInfo : {
+          "context" : Em.I18n.t('requestInfo.stopHostComponent')+ " " + component.get('componentName').toUpperCase()
+        },
+        Body:{
+          HostRoles:{
+            state: 'INSTALLED'
+          }
         }
         }
       }, 'PUT',
       }, 'PUT',
         function(requestId){
         function(requestId){
@@ -158,16 +198,6 @@ App.MainHostDetailsController = Em.Controller.extend({
           },App.testModeDelayForActions);
           },App.testModeDelayForActions);
         } else {
         } else {
           App.router.get('clusterController').loadUpdatedStatus();
           App.router.get('clusterController').loadUpdatedStatus();
-          App.router.get('backgroundOperationsController.eventsArray').push({
-            "when" : function(controller){
-              var result = (controller.getOperationsForRequestId(requestId).length == 0);
-              console.log('stopComponent.when = ', result)
-              return result;
-            },
-            "do" : function(){
-              App.router.get('clusterController').loadUpdatedStatus();
-            }
-          });
         }
         }
 
 
         App.router.get('backgroundOperationsController').showPopup();
         App.router.get('backgroundOperationsController').showPopup();
@@ -189,12 +219,16 @@ App.MainHostDetailsController = Em.Controller.extend({
     App.showConfirmationPopup(function() {
     App.showConfirmationPopup(function() {
 
 
       self.sendCommandToServer('/hosts?Hosts/host_name=' + self.get('content.hostName'),{
       self.sendCommandToServer('/hosts?Hosts/host_name=' + self.get('content.hostName'),{
-        host_components: [{
-          HostRoles:{
-            component_name: componentName
-          }
-        }]
-
+        RequestInfo : {
+          "context" : Em.I18n.t('requestInfo.installHostComponent') + " " + componentName
+        },
+        Body:{
+          host_components: [{
+            HostRoles:{
+              component_name: componentName
+            }
+          }]
+        }
       },
       },
         'POST',
         'POST',
         function(requestId){
         function(requestId){
@@ -202,8 +236,13 @@ App.MainHostDetailsController = Em.Controller.extend({
           console.log('Send request for ADDING NEW COMPONENT successfully');
           console.log('Send request for ADDING NEW COMPONENT successfully');
 
 
           self.sendCommandToServer('/host_components?HostRoles/host_name=' + self.get('content.hostName') + '\&HostRoles/component_name=' + componentName + '\&HostRoles/state=INIT',{
           self.sendCommandToServer('/host_components?HostRoles/host_name=' + self.get('content.hostName') + '\&HostRoles/component_name=' + componentName + '\&HostRoles/state=INIT',{
-              HostRoles:{
-                state: 'INSTALLED'
+              RequestInfo : {
+                "context" : Em.I18n.t('requestInfo.installingHostComponent')+ " " + componentName
+              },
+              Body:{
+                HostRoles:{
+                  state: 'INSTALLED'
+                }
               }
               }
             },
             },
             'PUT',
             'PUT',
@@ -221,16 +260,6 @@ App.MainHostDetailsController = Em.Controller.extend({
                 },App.testModeDelayForActions);
                 },App.testModeDelayForActions);
               } else {
               } else {
                 App.router.get('clusterController').loadUpdatedStatus();
                 App.router.get('clusterController').loadUpdatedStatus();
-                App.router.get('backgroundOperationsController.eventsArray').push({
-                  "when" : function(controller){
-                    var result = (controller.getOperationsForRequestId(requestId).length == 0);
-                    console.log('installComponent.when = ', result)
-                    return result;
-                  },
-                  "do" : function(){
-                    App.router.get('clusterController').loadUpdatedStatus();
-                  }
-                });
               }
               }
 
 
               App.router.get('backgroundOperationsController').showPopup();
               App.router.get('backgroundOperationsController').showPopup();
@@ -364,11 +393,11 @@ App.MainHostDetailsController = Em.Controller.extend({
 
 
   /**
   /**
    * Deletion of hosts not supported for this version
    * Deletion of hosts not supported for this version
-   * 
+   *
    * validateDeletion: function () { var slaveComponents = [ 'DataNode',
    * validateDeletion: function () { var slaveComponents = [ 'DataNode',
    * 'TaskTracker', 'RegionServer' ]; var masterComponents = []; var
    * 'TaskTracker', 'RegionServer' ]; var masterComponents = []; var
    * workingComponents = [];
    * workingComponents = [];
-   * 
+   *
    * var components = this.get('content.components');
    * var components = this.get('content.components');
    * components.forEach(function (cInstance) { var cName =
    * components.forEach(function (cInstance) { var cName =
    * cInstance.get('componentName'); if (slaveComponents.contains(cName)) { if
    * cInstance.get('componentName'); if (slaveComponents.contains(cName)) { if

+ 123 - 0
ambari-web/app/controllers/main/mirroring/dataset_controller.js

@@ -0,0 +1,123 @@
+/**
+ * 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.MainMirroringDataSetController = Ember.Controller.extend({
+  name: 'mainMirroringDataSetController',
+
+  model: Ember.Object.create(
+    {
+      newDataSet: null,
+      listOfTargetClusterNames: function () {
+        var listOfClusterNames = [];
+        var listOfTargetClusters = App.TargetCluster.find();
+        if (listOfTargetClusters && listOfTargetClusters.content.length) {
+          listOfTargetClusters.forEach(function (tcluster) {
+            listOfClusterNames.push(tcluster.get('clusterName'));
+          });
+        }
+        return listOfClusterNames;
+      }.property('newDataSet.targetCluster'),  // this property will be set when someone clicks the save button
+
+      originalRecord: null
+    }
+
+  ),
+
+  /**
+   * Popup with add/edit form
+   */
+  popup: null,
+
+  /**
+   * true - popup with edit form
+   * false - popup with add form
+   */
+  isPopupForEdit: false,
+
+  createNewDataSet: function () {
+    var newDataSet = Ember.Object.create({
+      name: null,
+      sourceDir: null,
+      targetCluster: Ember.Object.create(),
+      targetDir: null,
+      schedule: Ember.Object.create()
+    });
+    this.set('model.newDataSet', newDataSet);
+    return newDataSet;
+  },
+
+  setDataSet: function (dataset) {
+    var newDataSet = Ember.Object.create({
+      name: dataset.get('name'),
+      sourceDir: dataset.get('sourceDir'),
+      targetCluster: dataset.get('targetCluster'),
+      targetDir: dataset.get('targetDir'),
+      schedule: dataset.get('schedule')
+    });
+    this.set('model.newDataSet', newDataSet);
+  },
+
+  setOriginalDataSetRecord: function (datasetRecord) {
+    this.set('model.originalRecord', datasetRecord);
+  },
+
+
+  getNewDataSet: function () {
+    return this.get('model.newDataSet');
+  },
+
+  createTargetCluster: function () {
+    var controller = App.router.get('mainMirroringTargetClusterController');
+    controller.set('returnRoute', App.get('router.currentState.path'));
+    App.router.transitionTo('addTargetClusterRoute');
+  },
+
+  /**
+   * Set old values for all properties in the dataset
+   */
+  undoChanges: function () {
+    this.set('model.newDataSet', this.get('rawDataSet'));
+  },
+
+  /**
+   * Delete created dataset and its schedule
+   */
+  deleteNewDataSet: function () {
+    var originalRecordSchedule = this.get('model.originalRecord.schedule');
+    originalRecordSchedule.deleteRecord();
+    originalRecordSchedule.get("transaction").commit();
+
+    var originalRecord = this.get('model.originalRecord');
+
+    originalRecord.deleteRecord();
+    originalRecord.get("transaction").commit();
+  },
+
+  /**
+   * "Delete" button handler
+   */
+  deleteDatasetClick: function () {
+    var self = this;
+    App.showConfirmationPopup(function () {
+      self.deleteNewDataSet();
+      self.get('popup').hide();
+      App.router.transitionTo('main.mirroring.index');
+    });
+  }
+
+});

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

@@ -0,0 +1,23 @@
+/**
+ * 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'
+});

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

@@ -0,0 +1,26 @@
+/**
+ * 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.MainJobsController = Em.Controller.extend({
+  name: 'mainJobsController',
+  jobs: function() {
+    return App.DataSetJob.find().filterProperty('dataset', this.get('content'));
+  }.property('content')
+});

+ 89 - 0
ambari-web/app/controllers/main/mirroring/targetClusterController.js

@@ -0,0 +1,89 @@
+/**
+ * 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.MainMirroringTargetClusterController = Ember.Controller.extend({
+  name: 'mainMirroringTargetClusterController',
+  model: Ember.Object.create({
+    targetCluster : null,
+    originalRecord : null,
+    isPopupForEdit : false // set the default to add scenario
+  }),
+  setOriginalRecord : function(targetClusterRecord){
+    this.set('model.originalRecord', targetClusterRecord);
+  },
+
+  setTargetCluster: function (targetClusterRecord) {
+    var targetCluster = Ember.Object.create({
+      id: targetClusterRecord.get('id'),
+      clusterName: targetClusterRecord.get('clusterName'),
+      nameNodeWebUrl: targetClusterRecord.get('nameNodeWebUrl'),
+      nameNodeRpcUrl: targetClusterRecord.get('nameNodeRpcUrl'),
+      oozieServerUrl: targetClusterRecord.get('oozieServerUrl')
+    });
+
+    this.set('model.targetCluster', targetCluster);
+  },
+
+
+  createTargetCluster: function () {
+    var targetCluster = Ember.Object.create({
+      clusterName: null,
+      nameNodeWebUrl: null,
+      nameNodeRpcUrl: null,
+      oozieServerUrl: null
+    });
+    this.set('model.targetCluster', targetCluster);
+    return targetCluster;
+
+    /* For future (but on record objects , not on pojos):
+     targetCluster.on('didUpdate', function() {
+     console.log("------Updated!");
+     });
+     targetCluster.on('didDelete', function() {
+     console.log("------Deleted!");
+     });
+     targetCluster.on('didCreate', function() {
+     console.log("------Created!");
+     });
+     */
+
+  },
+  getTargetCluster: function () {
+    return this.get('content.targetCluster');
+  },
+
+  popup : null,
+
+  /**
+   * "Delete" button handler.
+   * A DataSet
+   */
+  deleteTargetCluster: function () {
+    var self = this;
+    App.showConfirmationPopup(function () {
+      var originalRecord = self.get('model.originalRecord');
+      originalRecord.deleteRecord();
+      originalRecord.get("transaction").commit();
+      self.get('popup').hide();
+      App.router.transitionTo('main.mirroring.index');
+    });
+  }
+
+
+
+});

+ 155 - 0
ambari-web/app/controllers/main/mirroring/testConnectionResults_controller.js

@@ -0,0 +1,155 @@
+/**
+ * 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.TestConnectionResultsController = Ember.Controller.extend({
+  name: 'testConnectionResultsController',
+
+  connectStatuses: [
+    Ember.Object.create({
+      type: 'readonly',
+      isConnectionSuccess: false
+    }),
+    Ember.Object.create({
+      type: 'write',
+      isConnectionSuccess: false
+    }),
+    Ember.Object.create({
+      type: 'workflow',
+      isConnectionSuccess: false
+    })
+
+  ],
+
+  isNameNodeWebUIConnected: function () {
+    var connectStatus = this.get('connectStatuses').findProperty('type', 'readonly');
+    return connectStatus.get('isConnectionSuccess');
+  }.property('connectStatuses.@each.isConnectionSuccess'),
+
+  isNameNodeRpcConnected: function () {
+    var connectStatus = this.get('connectStatuses').findProperty('type', 'write');
+    return connectStatus.get('isConnectionSuccess');
+  }.property('connectStatuses.@each.isConnectionSuccess'),
+
+  isOozieServerConnected: function () {
+    var connectStatus = this.get('connectStatuses').findProperty('type', 'workflow');
+    return connectStatus.get('isConnectionSuccess');
+  }.property('connectStatuses.@each.isConnectionSuccess'),
+
+  isConnectionSuccessful: function () {
+    return this.get('isNameNodeWebUIConnected') && this.get('isNameNodeRpcConnected') && this.get('isOozieServerConnected');
+  }.property('isNameNodeWebUIConnected', 'isNameNodeRpcConnected', 'isOozieServerConnected'),
+
+  shouldBeDisabled: function () {
+    return !this.get('isConnectionSuccessful');
+  }.property('isConnectionSuccessful'),
+
+  mockDataPrefix: '/data/mirroring/poll/',
+
+  tryConnecting: function () {
+    var types = ["readonly", "write", "workflow"];
+    var arrayOfPollData = ["testConnection_poll1", "testConnection_poll2", "testConnection_poll3", "testConnection_poll4"];
+
+    var shouldContinuePolling = true;
+
+    var poll_count = 0;
+
+    var interval_id = 0;
+
+    var self = this;
+
+    var connect = function () {
+      var method = 'GET';
+      console.debug('poll_count : ' + poll_count);
+      var url = self.get('mockDataPrefix') + arrayOfPollData[poll_count++] + ".json";
+      $.ajax({
+        type: method,
+        url: url,
+        async: true, // shd be chnaged to true
+        data: null, // temporarily .this depends upon what the api is expecting.
+        dataType: 'text',
+        timeout: App.timeout,
+        success: function (data) {
+          var jsonData = jQuery.parseJSON(data);
+          var connectStatuses = self.get('connectStatuses');
+          jsonData.tasks.forEach(function (task) {
+            var type = task.Tasks.type;
+            var status = task.Tasks.status;
+            var connectStatus = connectStatuses.findProperty("type", type);
+            connectStatus.set('isConnectionSuccess', status === "SUCCESS");
+          });
+
+          var totalNum = connectStatuses.length;
+          var succeededStatuses = connectStatuses.filterProperty("isConnectionSuccess", true);
+          var succeededNum = succeededStatuses.length;
+
+          if (totalNum == succeededNum) {
+            clearInterval(interval_id);
+            console.debug('Cleared function id ' + interval_id);
+          }
+          else {
+            clearInterval(interval_id);
+            console.debug('Cleared function id ' + interval_id + "totalNum : " + totalNum + ', succeededNum : ' + succeededNum);
+            interval_id = setInterval(connect, 100);
+            console.debug('Generated function id ' + interval_id);
+          }
+
+        }
+      });
+    };
+
+    connect();
+  },
+
+  saveClusterName: function () {
+    var targetCluster = this.get('content.targetCluster');
+    var isEditing = this.get('content.isPopupForEdit');
+    if (isEditing) {
+      var targetClusterRecord = this.get('content.originalRecord');
+      var targetClusterEdited = this.get('content.targetCluster');
+
+      targetClusterRecord.set('id', targetClusterEdited.get('id'));
+      targetClusterRecord.set('clusterName', targetClusterEdited.get('clusterName'));
+      targetClusterRecord.set('nameNodeWebUrl', targetClusterEdited.get('nameNodeRpcUrl'));
+      targetClusterRecord.set('nameNodeRpcUrl', targetClusterEdited.get('id'));
+      targetClusterRecord.set('oozieServerUrl', targetClusterEdited.get('oozieServerUrl'));
+
+
+    } else {
+      var targetClusterRecord = App.TargetCluster.createRecord(targetCluster);
+
+      // refresh main page model
+      var mainMirroringController = App.router.get('mainMirroringController');
+      mainMirroringController.notifyPropertyChange("targetClusters");
+
+      // refresh add/edit dataset model
+      var addDataSetController = App.router.get('mainMirroringDataSetController');
+      var dataSet = addDataSetController.get('model.newDataSet');
+      if (dataSet)  // this may be undefined or null if we try to add cluster from main page. Hence the if check.
+        dataSet.set('targetCluster', targetClusterRecord);
+    }
+
+    var popup = this.get('controllers.mainMirroringTargetClusterController.popup');
+    popup.hide();
+  }
+
+
+
+
+
+
+});

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

@@ -0,0 +1,23 @@
+/**
+ * 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.TestConnectionController = Ember.Controller.extend({
+  name:'testConnectionController'
+
+
+});

+ 10 - 2
ambari-web/app/controllers/main/mirroring_controller.js

@@ -19,6 +19,14 @@
 var App = require('app');
 var App = require('app');
 
 
 App.MainMirroringController = Em.ArrayController.extend({
 App.MainMirroringController = Em.ArrayController.extend({
-  name:'mainMirroringController',
-  content: App.DataSet.find()
+  name: 'mainMirroringController',
+
+  datasets: function () {
+    return App.Dataset.find();
+  }.property(),
+
+  targetClusters: function () {
+    return App.TargetCluster.find();
+  }.property()
+
 });
 });

+ 101 - 1
ambari-web/app/controllers/main/service.js

@@ -27,11 +27,111 @@ App.MainServiceController = Em.ArrayController.extend({
     return App.Service.find();
     return App.Service.find();
   }.property('App.router.clusterController.isLoaded'),
   }.property('App.router.clusterController.isLoaded'),
 
 
+  cluster: function () {
+    if (!App.router.get('clusterController.isLoaded')) {
+      return null;
+    }
+    return App.Cluster.find().objectAt(0);
+  }.property('App.router.clusterController.isLoaded'),
+
   hdfsService: function () {
   hdfsService: function () {
     var hdfsSvcs = App.HDFSService.find();
     var hdfsSvcs = App.HDFSService.find();
     if (hdfsSvcs && hdfsSvcs.get('length') > 0) {
     if (hdfsSvcs && hdfsSvcs.get('length') > 0) {
       return hdfsSvcs.objectAt(0);
       return hdfsSvcs.objectAt(0);
     }
     }
     return null;
     return null;
-  }.property('App.router.clusterController.isLoaded', 'App.router.updateController.isUpdated')
+  }.property('App.router.clusterController.isLoaded', 'App.router.updateController.isUpdated'),
+
+  isStartAllDisabled: function(){
+    if(this.get('isStartStopAllClicked') == true) {
+      return true;
+    }
+    var stoppedServiceLength = this.get('content').filterProperty('healthStatus','red').length;
+    return (stoppedServiceLength === 0); // all green status
+  }.property('isStartStopAllClicked', 'content.@each.healthStatus'),
+  isStopAllDisabled: function(){
+    if(this.get('isStartStopAllClicked') == true) {
+      return true;
+    }
+    var startedService = this.get('content').filterProperty('healthStatus','green');
+    var flag = true;
+    startedService.forEach(function(item){
+      if(!['HCATALOG', 'PIG', 'SQOOP'].contains(item.get('serviceName'))){
+        flag = false;
+      }
+    })
+    return flag;
+  }.property('isStartStopAllClicked', 'content.@each.healthStatus'),
+  isStartStopAllClicked: function(){
+    return (App.router.get('backgroundOperationsController').get('allOperationsCount') !== 0);
+  }.property('App.router.backgroundOperationsController.allOperationsCount'),
+
+  /**
+   * callback for <code>start all service</code> button
+   */
+  startAllService: function(event){
+    if ($(event.target).hasClass('disabled') || $(event.target.parentElement).hasClass('disabled')) {
+      return;
+    }
+    var self = this;
+    App.showConfirmationPopup2(function() {
+      self.startAllServicesCall('startAllService');
+    });
+  },
+
+  /**
+   * callback for <code>stop all service</code> button
+   */
+  stopAllService: function(event){
+    if ($(event.target).hasClass('disabled') || $(event.target.parentElement).hasClass('disabled')) {
+      return;
+    }
+    var self = this;
+    App.showConfirmationPopup2(function() {
+      self.startAllServicesCall('stopAllService');
+    });
+  },
+
+  startAllServicesCall: function(state){
+    var clusterName = App.router.get('applicationController').get('clusterName');
+    var method = 'PUT';
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo';
+    var data;
+    if(state == 'stopAllService'){
+      data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.stopAllServices') +'"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
+    }else{
+      data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.startAllServices') +'"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
+    }
+
+    if (App.testMode) {
+      url = this.get('mockDataPrefix') + '/poll_6.json';
+      method = 'GET';
+      this.numPolls = 6;
+    }
+
+    $.ajax({
+      type: method,
+      url: url,
+      async: false,
+      data: data,
+      dataType: 'text',
+      timeout: App.timeout,
+      success: function (data) {
+        var jsonData = jQuery.parseJSON(data);
+        console.log("TRACE: Start/Stop all service -> In success function for the start/stop all Service call");
+        console.log("TRACE: Start/Stop all service -> value of the url is: " + url);
+        console.log("TRACE: Start/Stop all service -> value of the received data is: " + jsonData);
+        var requestId = jsonData.Requests.id;
+        console.log('requestId is: ' + requestId);
+
+        App.router.get('backgroundOperationsController').showPopup();
+      },
+      error: function () {
+        console.log("ERROR");
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+
+  }
 })
 })

+ 3 - 92
ambari-web/app/controllers/main/service/add_controller.js

@@ -91,6 +91,9 @@ App.AddServiceController = App.WizardController.extend({
    * Load services data from server.
    * Load services data from server.
    */
    */
   loadServicesFromServer: function() {
   loadServicesFromServer: function() {
+    if(App.db.getService()){
+      return;
+    }
     var displayOrderConfig = require('data/services');
     var displayOrderConfig = require('data/services');
     var apiUrl = App.get('stackVersionURL');
     var apiUrl = App.get('stackVersionURL');
     var apiService = this.loadServiceComponents(displayOrderConfig, apiUrl);
     var apiService = this.loadServiceComponents(displayOrderConfig, apiUrl);
@@ -274,46 +277,6 @@ App.AddServiceController = App.WizardController.extend({
     console.log("AddServiceController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
     console.log("AddServiceController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
   },
   },
 
 
-  /**
-   * Save config properties
-   * @param stepController Step7WizardController
-   */
-  saveServiceConfigProperties: function (stepController) {
-    var serviceConfigProperties = [];
-    stepController.get('stepConfigs').forEach(function (_content) {
-      _content.get('configs').forEach(function (_configProperties) {
-        var displayType = _configProperties.get('displayType');
-        if (displayType === 'directories' || displayType === 'directory') {
-          var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
-          _configProperties.set('value', value);
-        }
-        var configProperty = {
-          id: _configProperties.get('id'),
-          name: _configProperties.get('name'),
-          value: _configProperties.get('value'),
-          defaultValue: _configProperties.get('defaultValue'),
-          service: _configProperties.get('serviceName'),
-          domain:  _configProperties.get('domain'),
-          filename: _configProperties.get('filename')
-        };
-        serviceConfigProperties.push(configProperty);
-      }, this);
-
-    }, this);
-
-    App.db.setServiceConfigProperties(serviceConfigProperties);
-    this.set('content.serviceConfigProperties', serviceConfigProperties);
-  },
-
-  /**
-   * Load serviceConfigProperties to model
-   */
-  loadServiceConfigProperties: function () {
-    var serviceConfigProperties = App.db.getServiceConfigProperties();
-    this.set('content.serviceConfigProperties', serviceConfigProperties);
-    console.log("AddServiceController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
-  },
-
   /**
   /**
    * Load information about hosts with clients components
    * Load information about hosts with clients components
    */
    */
@@ -372,58 +335,6 @@ App.AddServiceController = App.WizardController.extend({
     }
     }
   },
   },
 
 
-  /**
-   * load advanced configs for all selected services
-   */
-  loadAdvancedConfigs: function () {
-    App.db.getSelectedServiceNames().forEach(function (_serviceName) {
-      this.loadAdvancedConfig(_serviceName);
-    }, this);
-  },
-
-  /**
-   * load advanced config for one service
-   * @param serviceName
-   */
-  loadAdvancedConfig: function (serviceName) {
-    var self = this;
-    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + App.get('stackVersionURL') + '/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
-    var method = 'GET';
-    $.ajax({
-      type: method,
-      url: url,
-      async: false,
-      dataType: 'text',
-      timeout: App.timeout,
-      success: function (data) {
-        var jsonData = jQuery.parseJSON(data);
-        console.log("TRACE: Step6 submit -> In success function for the loadAdvancedConfig call");
-        console.log("TRACE: Step6 submit -> value of the url is: " + url);
-        var serviceComponents = jsonData.properties;
-        serviceComponents.setEach('serviceName', serviceName);
-        var configs;
-        if (App.db.getAdvancedServiceConfig()) {
-          configs = App.db.getAdvancedServiceConfig();
-        } else {
-          configs = [];
-        }
-        configs = configs.concat(serviceComponents);
-        self.set('content.advancedServiceConfig', configs);
-        App.db.setAdvancedServiceConfig(configs);
-        console.log('TRACE: servicename: ' + serviceName);
-      },
-
-      error: function (request, ajaxOptions, error) {
-        console.log("TRACE: STep6 submit -> In error function for the loadAdvancedConfig call");
-        console.log("TRACE: STep6 submit-> value of the url is: " + url);
-        console.log("TRACE: STep6 submit-> error code status is: " + request.status);
-        console.log('Step6 submit: Error message is: ' + request.responseText);
-      },
-
-      statusCode: require('data/statusCodes')
-    });
-  },
-
   /**
   /**
    * Remove all loaded data.
    * Remove all loaded data.
    * Created as copy for App.router.clearAllSteps
    * Created as copy for App.router.clearAllSteps

文件差异内容过多而无法显示
+ 509 - 370
ambari-web/app/controllers/main/service/info/configs.js


+ 9 - 11
ambari-web/app/controllers/main/service/item.js

@@ -49,7 +49,7 @@ App.MainServiceItemController = Em.Controller.extend({
    */
    */
   ajaxSuccess: function(data, ajaxOptions) {
   ajaxSuccess: function(data, ajaxOptions) {
     if(data && data.Requests) {
     if(data && data.Requests) {
-      this.ajaxCallBack(data.Requests.id, (JSON.parse(ajaxOptions.data)).ServiceInfo.state);
+      this.ajaxCallBack(data.Requests.id, (JSON.parse(ajaxOptions.data)).Body.ServiceInfo.state);
     }
     }
     else {
     else {
       console.log('cannot get request id from ', data);
       console.log('cannot get request id from ', data);
@@ -74,16 +74,6 @@ App.MainServiceItemController = Em.Controller.extend({
     }
     }
     else {
     else {
       App.router.get('clusterController').loadUpdatedStatusDelayed(500);// @todo check working without param 500
       App.router.get('clusterController').loadUpdatedStatusDelayed(500);// @todo check working without param 500
-      App.router.get('backgroundOperationsController.eventsArray').push({
-        "when": function (controller) {
-          var result = (controller.getOperationsForRequestId(requestId).length == 0);
-          console.log(config.s + 'Service.when = ', result)
-          return result;
-        },
-        "do": function () {
-          App.router.get('clusterController').loadUpdatedStatus();
-        }
-      });
     }
     }
     App.router.get('backgroundOperationsController').showPopup();
     App.router.get('backgroundOperationsController').showPopup();
   },
   },
@@ -103,11 +93,19 @@ App.MainServiceItemController = Em.Controller.extend({
   },
   },
 
 
   startStopPopupPrimary: function(serviceHealth) {
   startStopPopupPrimary: function(serviceHealth) {
+    var requestInfo = "";
+    if(serviceHealth == "STARTED"){
+      requestInfo = 'Start service ' + this.get('content.serviceName').toUpperCase() ;
+    }else{
+      requestInfo = 'Stop service ' + this.get('content.serviceName').toUpperCase() ;
+    }
+
     App.ajax.send({
     App.ajax.send({
       'name': 'service.item.start_stop',
       'name': 'service.item.start_stop',
       'sender': this,
       'sender': this,
       'success': 'ajaxSuccess',
       'success': 'ajaxSuccess',
       'data': {
       'data': {
+        'requestInfo':requestInfo,
         'serviceName': this.get('content.serviceName').toUpperCase(),
         'serviceName': this.get('content.serviceName').toUpperCase(),
         'state': serviceHealth
         'state': serviceHealth
       }
       }

+ 37 - 30
ambari-web/app/controllers/main/service/reassign_controller.js

@@ -54,6 +54,10 @@ App.ReassignMasterController = App.WizardController.extend({
     reassign: null
     reassign: null
   }),
   }),
 
 
+  skipStep3: function () {
+    return this.get('content.reassign.service_id') == 'GANGLIA';
+  }.property('content.reassign.service_id'),
+
   /**
   /**
    * return new object extended from clusterStatusTemplate
    * return new object extended from clusterStatusTemplate
    * @return Object
    * @return Object
@@ -125,6 +129,33 @@ App.ReassignMasterController = App.WizardController.extend({
     console.log("ReassignMasterController.loadMasterComponentHosts: loaded hosts ", masterComponentHosts);
     console.log("ReassignMasterController.loadMasterComponentHosts: loaded hosts ", masterComponentHosts);
   },
   },
 
 
+  /**
+   * Load tasks statuses for step5 of Reassign Master Wizard to restore installation
+   */
+  loadTasksStatuses: function(){
+    var statuses = App.db.getReassignTasksStatuses();
+    this.set('content.tasksStatuses', statuses);
+    console.log('ReassignMasterController.loadTasksStatuses: loaded statuses', statuses);
+  },
+
+  /**
+   * save status of the cluster.
+   * @param clusterStatus object with status,requestId fields.
+   */
+  saveClusterStatus: function (clusterStatus) {
+    var oldStatus = this.toObject(this.get('content.cluster'));
+    clusterStatus = jQuery.extend(oldStatus, clusterStatus);
+    if (clusterStatus.requestId) {
+      clusterStatus.requestId.forEach(function (requestId) {
+        if (clusterStatus.oldRequestsId.indexOf(requestId) === -1) {
+          clusterStatus.oldRequestsId.push(requestId)
+        }
+      }, this);
+    }
+    this.set('content.cluster', clusterStatus);
+    this.save('cluster');
+  },
+
   /**
   /**
    * Save Master Component Hosts data to Main Controller
    * Save Master Component Hosts data to Main Controller
    * @param stepController App.WizardStep5Controller
    * @param stepController App.WizardStep5Controller
@@ -162,36 +193,10 @@ App.ReassignMasterController = App.WizardController.extend({
     };
     };
     App.db.setMasterToReassign(component);
     App.db.setMasterToReassign(component);
   },
   },
-
-  /**
-   * Save config properties
-   * @param stepController Step7WizardController
-   */
-  saveServiceConfigProperties: function (stepController) {
-    var serviceConfigProperties = [];
-    stepController.get('stepConfigs').forEach(function (_content) {
-      _content.get('configs').forEach(function (_configProperties) {
-        var displayType = _configProperties.get('displayType');
-        if (displayType === 'directories' || displayType === 'directory') {
-          var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
-          _configProperties.set('value', value);
-        }
-        var configProperty = {
-          id: _configProperties.get('id'),
-          name: _configProperties.get('name'),
-          value: _configProperties.get('value'),
-          defaultValue: _configProperties.get('defaultValue'),
-          service: _configProperties.get('serviceName'),
-          domain:  _configProperties.get('domain'),
-          filename: _configProperties.get('filename')
-        };
-        serviceConfigProperties.push(configProperty);
-      }, this);
-
-    }, this);
-
-    App.db.setServiceConfigProperties(serviceConfigProperties);
-    this.set('content.serviceConfigProperties', serviceConfigProperties);
+  saveTasksStatuses: function(statuses){
+    App.db.setReassignTasksStatuses(statuses);
+    this.set('content.tasksStatuses', statuses);
+    console.log('ReassignMasterController.saveTasksStatuses: saved statuses', statuses);
   },
   },
 
 
   /**
   /**
@@ -202,8 +207,10 @@ App.ReassignMasterController = App.WizardController.extend({
     switch (step) {
     switch (step) {
       case '6':
       case '6':
       case '5':
       case '5':
+        this.loadTasksStatuses();
       case '4':
       case '4':
       case '3':
       case '3':
+        this.loadServiceConfigProperties();
       case '2':
       case '2':
         this.loadServicesFromServer();
         this.loadServicesFromServer();
         this.loadMasterComponentHosts();
         this.loadMasterComponentHosts();

+ 101 - 21
ambari-web/app/controllers/wizard.js

@@ -262,21 +262,20 @@ App.WizardController = Em.Controller.extend({
     switch (this.get('content.controllerName')) {
     switch (this.get('content.controllerName')) {
       case 'addHostController':
       case 'addHostController':
         if (isRetry) {
         if (isRetry) {
-          url = App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state!=INSTALLED';
-          data = '{"HostRoles": {"state": "INSTALLED"}}';
+          url = App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state=INSTALLED';
         } else {
         } else {
           url = App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state=INIT';
           url = App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state=INIT';
-          data = '{"HostRoles": {"state": "INSTALLED"}}';
         }
         }
+        data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installComponents') +'"}, "Body": {"HostRoles": {"state": "INSTALLED"}}}';
         break;
         break;
       case 'installerController':
       case 'installerController':
       default:
       default:
         if (isRetry) {
         if (isRetry) {
           url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state!=INSTALLED';
           url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state!=INSTALLED';
-          data = '{"HostRoles": {"state": "INSTALLED"}}';
+          data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installComponents') +'"}, "Body": {"HostRoles": {"state": "INSTALLED"}}}';
         } else {
         } else {
           url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=INIT';
           url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=INIT';
-          data = '{"ServiceInfo": {"state": "INSTALLED"}}';
+          data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installServices') +'"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
         }
         }
         break;
         break;
     }
     }
@@ -431,7 +430,7 @@ App.WizardController = Em.Controller.extend({
   loadServiceComponents: function (displayOrderConfig, apiUrl) {
   loadServiceComponents: function (displayOrderConfig, apiUrl) {
     var result = null;
     var result = null;
     var method = 'GET';
     var method = 'GET';
-    var testUrl = '/data/wizard/stack/hdp/version/1.2.0.json';
+    var testUrl = '/data/wizard/stack/hdp/version/1.3.0.json';
     var url = (App.testMode) ? testUrl : App.apiPrefix + apiUrl;
     var url = (App.testMode) ? testUrl : App.apiPrefix + apiUrl;
     $.ajax({
     $.ajax({
       type: method,
       type: method,
@@ -460,19 +459,23 @@ App.WizardController = Em.Controller.extend({
         // loop through all the service components
         // loop through all the service components
         for (var i = 0; i < displayOrderConfig.length; i++) {
         for (var i = 0; i < displayOrderConfig.length; i++) {
           var entry = jsonData.services.findProperty("name", displayOrderConfig[i].serviceName);
           var entry = jsonData.services.findProperty("name", displayOrderConfig[i].serviceName);
-
-          var myService = Service.create({
-            serviceName: entry.name,
-            displayName: displayOrderConfig[i].displayName,
-            isDisabled: i === 0,
-            isSelected: true,
-            isInstalled: false,
-            isHidden: displayOrderConfig[i].isHidden,
-            description: entry.comment,
-            version: entry.version
-          });
-
-          data.push(myService);
+          if (entry) {
+            var myService = Service.create({
+              serviceName: entry.name,
+              displayName: displayOrderConfig[i].displayName,
+              isDisabled: i === 0,
+              isSelected: true,
+              isInstalled: false,
+              isHidden: displayOrderConfig[i].isHidden,
+              description: entry.comment,
+              version: entry.version
+            });
+
+            data.push(myService);
+          }
+          else {
+            console.warn('Service not found - ', displayOrderConfig[i].serviceName);
+          }
         }
         }
 
 
         result = data;
         result = data;
@@ -585,7 +588,7 @@ App.WizardController = Em.Controller.extend({
           formattedHosts.get(header.get('name')).push({
           formattedHosts.get(header.get('name')).push({
             hostName: host.hostName,
             hostName: host.hostName,
             group: 'Default',
             group: 'Default',
-            isInstalled: cb.get('installed')
+            isInstalled: cb.get('isInstalled')
           });
           });
         }
         }
       });
       });
@@ -624,6 +627,83 @@ App.WizardController = Em.Controller.extend({
       },50);
       },50);
     }
     }
     return dfd.promise();
     return dfd.promise();
-  }
+  },
+
+  /**
+   * Save cluster status before going to deploy step
+   * @param name cluster state. Unique for every wizard
+   */
+  saveClusterState: function(name){
+    App.clusterStatus.setClusterStatus({
+      clusterName: this.get('content.cluster.name'),
+      clusterState: name,
+      wizardControllerName: this.get('content.controllerName'),
+      localdb: App.db.data
+    });
+  },
 
 
+  /**
+   * load advanced configs from server
+   */
+  loadAdvancedConfigs: function () {
+    var configs = (App.db.getAdvancedServiceConfig()) ? App.db.getAdvancedServiceConfig() : [];
+    this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName').forEach(function (_serviceName) {
+      var serviceComponents = App.config.loadAdvancedConfig(_serviceName);
+      if(serviceComponents){
+        configs = configs.concat(serviceComponents);
+      }
+    }, this);
+    this.set('content.advancedServiceConfig', configs);
+    App.db.setAdvancedServiceConfig(configs);
+  },
+  /**
+   * Load serviceConfigProperties to model
+   */
+  loadServiceConfigProperties: function () {
+    var serviceConfigProperties = App.db.getServiceConfigProperties();
+    this.set('content.serviceConfigProperties', serviceConfigProperties);
+    console.log("AddHostController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
+  },
+  /**
+   * Save config properties
+   * @param stepController Step7WizardController
+   */
+  saveServiceConfigProperties: function (stepController) {
+    var serviceConfigProperties = [];
+    stepController.get('stepConfigs').forEach(function (_content) {
+      _content.get('configs').forEach(function (_configProperties) {
+        var displayType = _configProperties.get('displayType');
+        if (displayType === 'directories' || displayType === 'directory') {
+          var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
+          _configProperties.set('value', value);
+        }
+        var overrides = _configProperties.get('overrides');
+        var overridesArray = [];
+        if(overrides!=null){
+          overrides.forEach(function(override){
+            var overrideEntry = {
+              value: override.get('value'),
+              hosts: []
+            };
+            override.get('selectedHostOptions').forEach(function(host){
+              overrideEntry.hosts.push(host);
+            });
+            overridesArray.push(overrideEntry);
+          });
+        }
+        var configProperty = {
+          id: _configProperties.get('id'),
+          name: _configProperties.get('name'),
+          value: _configProperties.get('value'),
+          defaultValue: _configProperties.get('defaultValue'),
+          serviceName: _configProperties.get('serviceName'),
+          domain:  _configProperties.get('domain'),
+          filename: _configProperties.get('filename')
+        };
+        serviceConfigProperties.push(configProperty);
+      }, this);
+    }, this);
+    App.db.setServiceConfigProperties(serviceConfigProperties);
+    this.set('content.serviceConfigProperties', serviceConfigProperties);
+  }
 })
 })

+ 398 - 377
ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js

@@ -23,63 +23,68 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
 
 
   POLL_INTERVAL: 4000,
   POLL_INTERVAL: 4000,
   isPolling: false,
   isPolling: false,
-  isUpgradeStarted: false,
-  servicesOrder: [
-    'HDFS',
-    'MAPREDUCE',
-    'ZOOKEEPER',
-    'HBASE',
-    'HIVE',
-    'OOZIE',
-    'NAGIOS',
-    'GANGLIA',
-    'PIG',
-    'SQOOP'
+  /**
+   * STOP_SERVICES internal statuses:
+   * - PENDING
+   * - IN_PROGRESS
+   * - SUCCESS
+   * - FAILED
+   * UPGRADE_SERVICES internal statuses:
+   * - PENDING
+   * - IN_PROGRESS
+   * - SUCCESS
+   * - FAILED
+   * - WARNING
+   */
+  processes:[
+    Em.Object.create({
+      name: 'STOP_SERVICES',
+      displayName: Em.I18n.t('installer.stackUpgrade.step3.stop.header'),
+      progress:0,
+      status: 'PENDING',
+      message: null,
+      isRunning: false,
+      hosts: [],
+      isRetry: false
+    }),
+    Em.Object.create({
+      name: 'UPGRADE_SERVICES',
+      displayName: Em.I18n.t('installer.stackUpgrade.step3.upgrade.header'),
+      progress: 0,
+      status: 'PENDING',
+      message:'',
+      isRunning: false,
+      hosts: [],
+      isRetry: false
+    })
   ],
   ],
-
   /**
   /**
-   * overall status of Upgrade
-   * FAILED - some service is FAILED
-   * SUCCESS - every services are SUCCESS
-   * WARNING - some service is WARNING and all the rest are SUCCESS
-   * IN_PROGRESS - when all services is stopped
+   * pass processes as services to popup
    */
    */
-  status: 'PENDING',
-  onStatus: function () {
-    var services = this.get('services');
-    var status = this.get('isServicesStopped') ? 'IN_PROGRESS' : 'PENDING';
-    var withoutWarning = [];
-    if (services.someProperty('status', 'FAILED')) {
-      this.set('isPolling', false);
-      status =  'FAILED';
-      this.setClusterStatus('STACK_UPGRADE_FAILED');
-    }
-    if (services.someProperty('status', 'WARNING')) {
-      withoutWarning = services.filter(function(service){
-        if(service.get('status') !== "WARNING"){
-          return true;
-        }
-      });
-      if(withoutWarning.everyProperty('status', 'SUCCESS')){
-        this.set('isPolling', false);
-        status = "WARNING";
-        this.setClusterStatus('STACK_UPGRADED');
-      }
-    }
-    if (services.everyProperty('status', 'SUCCESS')) {
-      this.set('isPolling', false);
-      status = 'SUCCESS';
-      this.set('content.cluster.isCompleted', true);
-      App.router.get(this.get('content.controllerName')).save('cluster');
-      this.setClusterStatus('STACK_UPGRADED');
-    }
-    this.set('status', status);
-  }.observes('services.@each.status'),
-  setClusterStatus: function(state){
+  services: function(){
+    return this.get('processes');
+  }.property('processes'),
+  /**
+   * save current requestId and clusterState
+   * to localStorage and put it to server
+   *
+   * STOP_SERVICES cluster status:
+   * - STOPPING_SERVICES,
+   * UPGRADE_SERVICES cluster status:
+   * - STACK_UPGRADING,
+   * - STACK_UPGRADE_FAILED,
+   * - STACK_UPGRADED,
+   * - STACK_UPGRADE_COMPLETED
+   */
+  saveClusterStatus: function(clusterStatus){
+    var oldStatus = this.get('content.cluster');
+    clusterStatus = jQuery.extend(oldStatus, clusterStatus);
+    this.set('content.cluster', clusterStatus);
+    App.router.get(this.get('content.controllerName')).save('cluster');
     if(!App.testMode){
     if(!App.testMode){
       App.clusterStatus.setClusterStatus({
       App.clusterStatus.setClusterStatus({
         clusterName: this.get('content.cluster.name'),
         clusterName: this.get('content.cluster.name'),
-        clusterState: state,
+        clusterState: clusterStatus.status,
         wizardControllerName: 'stackUpgradeController',
         wizardControllerName: 'stackUpgradeController',
         localdb: App.db.data
         localdb: App.db.data
       });
       });
@@ -88,267 +93,228 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
   // provide binding for Host Popup data
   // provide binding for Host Popup data
   serviceTimestamp: null,
   serviceTimestamp: null,
   /**
   /**
-   * The dependence of the status of service to status of the tasks
-   * FAILED - any task is TIMEDOUT, ABORTED, FAILED (depends on component is master)
-   * WARNING - any task is TIMEDOUT, ABORTED, FAILED (depends on component is slave or client)
-   * SUCCESS - every tasks are COMPLETED
-   * IN_PROGRESS - any task is UPGRADING(IN_PROGRESS)
-   * PENDING - every tasks are QUEUED or PENDING
-   */
-  services: [],
-  /**
-   * load services, which installed on cluster
+   * load hosts for each process
    */
    */
-  loadServices: function(){
-    var installedServices = App.testMode ? this.get('mockServices') : this.get('content.servicesInfo');
-    var services = [];
-    var order = this.get('servicesOrder');
-    installedServices.sort(function(a, b){
-      return order.indexOf(a.get('serviceName')) - order.indexOf(b.get('serviceName'));
+  loadHosts: function () {
+    var hosts = [];
+    var installedHosts = App.Host.find();
+    this.get('processes').forEach(function(process){
+      var hosts = [];
+      installedHosts.forEach(function (host) {
+        hosts.push(Em.Object.create({
+          name: host.get('hostName'),
+          publicName: host.get('publicHostName'),
+          logTasks: []
+        }));
+      });
+      process.set('hosts', hosts);
     });
     });
-    installedServices.forEach(function(_service){
-      services.push(Em.Object.create({
-        name: _service.get('serviceName'),
-        displayName: _service.get('displayName'),
-        hosts: this.loadHosts(_service),
-        progress: 0,
-        message: function(){
-          switch(this.get('status')){
-            case "FAILED":
-              return Em.I18n.t('installer.stackUpgrade.step3.service.failedUpgrade').format(this.get('name'));
-              break;
-            case "WARNING":
-              return Em.I18n.t('installer.stackUpgrade.step3.service.upgraded').format(this.get('name'));
-              break;
-            case "SUCCESS":
-              return Em.I18n.t('installer.stackUpgrade.step3.service.upgraded').format(this.get('name'));
-              break;
-            case "IN_PROGRESS":
-              return Em.I18n.t('installer.stackUpgrade.step3.service.upgrading').format(this.get('name'));
-              break;
-            case "PENDING":
-            default:
-              return Em.I18n.t('installer.stackUpgrade.step3.service.pending').format(this.get('name'));
-              break;
-          }
-        }.property('status'),
-        status: "PENDING",
-        detailMessage:''
-      }));
-    }, this);
-    this.set('services', services);
   }.observes('content.servicesInfo'),
   }.observes('content.servicesInfo'),
+  submitButton: null,
   /**
   /**
-   * load hosts as services property
-   * @param service
-   * @return {Array}
-   */
-  loadHosts: function(service){
-    var hostComponents = App.HostComponent.find().filterProperty('service.serviceName', service.get('serviceName'));
-    var hosts = hostComponents.mapProperty('host').uniq();
-    var result = [];
-    hosts.forEach(function(host){
-      result.push(Em.Object.create({
-        name: host.get('hostName'),
-        publicName: host.get('publicHostName'),
-        logTasks: [],
-        components: hostComponents.filterProperty('host.hostName', host.get('hostName')).mapProperty('componentName')
-      }));
-    });
-    return result;
-  },
-  /**
-   * upgrade status SUCCESS - submit button enabled with label "Done"
-   * upgrade status WARNING - submit button enabled with label "Proceed with Warning"
-   * upgrade status FAILED or IN_PROGRESS - submit button disabled
+   * restart upgrade
+   * restart stop services
+   * @param event
    */
    */
-  submitButton: function(){
-    if(this.get('status') == 'SUCCESS'){
-      return Em.I18n.t('common.done');
-    } else if(this.get('status') == 'WARNING'){
-      return Em.I18n.t('installer.stackUpgrade.step3.ProceedWithWarning');
+  retry: function(event){
+    var processName = event.context;
+    var process = this.get('processes').findProperty('name', processName);
+    this.resetProgress(process);
+    this.resetMockConfig();
+    if(processName == 'STOP_SERVICES'){
+      this.stopServices();
     } else {
     } else {
-      return false;
+      this.set('submitButton', false);
+      this.runUpgrade();
     }
     }
-  }.property('status'),
-  showRetry: function () {
-    return (this.get('status') === 'FAILED' || this.get('status') === 'WARNING');
-  }.property('status'),
-  isServicesStopped: function(){
-    return this.get('servicesStopProgress') === 100;
-  }.property('servicesStopProgress'),
-  isServicesStopFailed: function(){
-    return this.get('servicesStopProgress') === false;
-  }.property('servicesStopProgress'),
-  installedServices: App.Service.find(),
+  },
   /**
   /**
-   * progress of stopping services process
-   * check whether service stop fails
+   * reset progress and status to retry
+   * @param process
    */
    */
-  servicesStopProgress: function(){
-    var services = App.testMode ? this.get('mockServices') : this.get('installedServices').toArray();
-    var progress = 0;
-    var stopFailed = false;
-    services.forEach(function(service){
-      if(!stopFailed){
-        stopFailed = service.get('hostComponents').filterProperty('isMaster').someProperty('workStatus', 'STOP_FAILED');
-      }
-    });
-    if(stopFailed){
-      return false;
-    } else {
-      progress = (services.filterProperty('workStatus', 'STOPPING').length / services.length) * 0.2;
-      return Math.round((progress + services.filterProperty('workStatus', 'INSTALLED').length / services.length) * 100);
-    }
-  }.property('installedServices.@each.workStatus', 'mockServices.@each.workStatus'),
-  retryStopService: function(){
-    App.router.get(this.get('content.controllerName')).stopServices();
+  resetProgress: function(process){
+    process.set('isRetry', false);
+    process.set('status', 'PENDING');
+    process.set('progress', 0);
+    process.get('hosts').forEach(function(host){host.get('logTasks').clear()});
   },
   },
   /**
   /**
-   * restart upgrade if fail or warning occurred
-   * @param event
+   * run stop services
    */
    */
-  retry: function(event){
-    this.set('isUpgradeStarted', false);
-    this.resetMockConfig(true);
-    this.loadServices();
-    this.runUpgrade();
+  stopServices: function () {
+    var clusterName = this.get('content.cluster.name');
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=STARTED';
+    var data = '{"RequestInfo": {"context": "'+ Em.I18n.t("requestInfo.stopAllServices") +'"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
+    var method = 'PUT';
+    var process = this.get('processes').findProperty('name', 'STOP_SERVICES');
+    var self = this;
+    process.set('isRunning', true);
+    if (App.testMode) {
+      this.startPolling();
+      this.saveClusterStatus({
+        requestId: 1,
+        status: 'STOPPING_SERVICES',
+        isCompleted: false
+      });
+    } else {
+      $.ajax({
+        type: method,
+        url: url,
+        async: false,
+        data: data,
+        dataType: 'text',
+        timeout: App.timeout,
+        success: function (data) {
+          var requestId = jQuery.parseJSON(data).Requests.id;
+          var clusterStatus = {
+            requestId: requestId,
+            status: 'STOPPING_SERVICES',
+            isCompleted: false
+          };
+          process.set('status', 'IN_PROGRESS');
+          self.saveClusterStatus(clusterStatus);
+          self.startPolling();
+          console.log('Call to stop service successful')
+        },
+        error: function () {
+          self.finishProcess(process, 'FAILED');
+          process.set('status', 'FAILED');
+          console.log("Call to stop services failed");
+        },
+        statusCode: require('data/statusCodes')
+      });
+    }
   },
   },
   /**
   /**
    * send request to run upgrade all services
    * send request to run upgrade all services
    */
    */
-  runUpgrade: function(){
-    // call to run upgrade on server
-    var method = App.testMode ? "GET" : "PUT";
-    var url = '';
-    var data = '';
+  runUpgrade: function () {
+    var method = "PUT";
+    var url = App.apiPrefix + '/clusters/' + this.get('content.cluster.name');
     var self = this;
     var self = this;
-    if(this.get('isServicesStopped') && !this.get('isUpgradeStarted')){
-      //TODO remove assignment isUpgradeStarted true to Ajax success callback
-      this.set('isUpgradeStarted', true);
-      /* $.ajax({
-       type: method,
-       url: url,
-       data: data,
-       async: false,
-       dataType: 'text',
-       timeout: App.timeout,
-       success: function (data) {
-
-       },
-
-       error: function (request, ajaxOptions, error) {
-
-       },
-
-       statusCode: require('data/statusCodes')
-       });*/
-      /*App.clusterStatus.setClusterStatus({
-       clusterName: this.get('clusterName'),
-       clusterState: 'UPGRADING_STACK',
-       wizardControllerName: 'stackUpgradeController',
-       localdb: App.db.data
-       });*/
+    var data = '{"Clusters": {"version" : "' + this.get('content.upgradeVersion') + '"}}';
+    var process = this.get('processes').findProperty('name', 'UPGRADE_SERVICES');
+    process.set('isRunning', true);
+    if (App.testMode) {
       this.startPolling();
       this.startPolling();
+      this.saveClusterStatus({
+        requestId: 1,
+        status: 'STACK_UPGRADING',
+        isCompleted: false
+      });
+    } else {
+      $.ajax({
+        type: method,
+        url: url,
+        async: false,
+        data: data,
+        dataType: 'text',
+        timeout: App.timeout,
+        success: function (data) {
+          var jsonData = jQuery.parseJSON(data);
+          var requestId = jsonData.Requests.id;
+          var clusterStatus = {
+            status: 'STACK_UPGRADING',
+            requestId: requestId,
+            isCompleted: false
+          };
+          process.set('status', 'IN_PROGRESS');
+          self.saveClusterStatus(clusterStatus);
+          self.startPolling();
+        },
+        error: function (request, ajaxOptions, error) {
+          self.finishProcess(process, 'FAILED');
+          process.set('status', 'FAILED');
+        },
+        statusCode: require('data/statusCodes')
+      });
     }
     }
-  }.observes('isServicesStopped'),
+  },
   /**
   /**
-   * start polling on upgrade progress
+   * start polling tasks for current process
    */
    */
   startPolling: function(){
   startPolling: function(){
-    //TODO set actual URL to poll upgrade progress
-    var url = '';
     if(!this.get('isPolling')){
     if(!this.get('isPolling')){
       this.set('isPolling', true);
       this.set('isPolling', true);
       if (App.testMode) {
       if (App.testMode) {
         this.simulatePolling();
         this.simulatePolling();
       } else {
       } else {
         //pass an interval "1" to start poll immediately first time
         //pass an interval "1" to start poll immediately first time
-        this.doPoll(url, 1);
+        this.doPoll(1);
       }
       }
     }
     }
   },
   },
-
-  mockServices: [
-    Em.Object.create({
-      serviceName: 'GANGLIA',
-      displayName: 'Ganglia',
-      workStatus: 'STARTED',
-      hostComponents: []
-    }),
-    Em.Object.create({
-      serviceName: 'HDFS',
-      displayName: 'HDFS',
-      workStatus: 'STARTED',
-      hostComponents: []
-    })
-  ],
   simulateAttempt:0,
   simulateAttempt:0,
+  mockUrl:'',
   /**
   /**
    * simulate actual poll, using mock data
    * simulate actual poll, using mock data
    */
    */
   simulatePolling: function(){
   simulatePolling: function(){
     var simulateAttempt = this.get('simulateAttempt');
     var simulateAttempt = this.get('simulateAttempt');
-    var URLs = [
+    var process = this.get('processes').findProperty('isRunning', true);
+    var upgradeURLs = [
       '/data/wizard/upgrade/poll_1.json',
       '/data/wizard/upgrade/poll_1.json',
       '/data/wizard/upgrade/poll_2.json',
       '/data/wizard/upgrade/poll_2.json',
       '/data/wizard/upgrade/poll_3.json',
       '/data/wizard/upgrade/poll_3.json',
       '/data/wizard/upgrade/poll_4.json',
       '/data/wizard/upgrade/poll_4.json',
       '/data/wizard/upgrade/poll_5.json'
       '/data/wizard/upgrade/poll_5.json'
     ];
     ];
-    if(simulateAttempt < 5){
-      this.doPoll(URLs[simulateAttempt]);
-      this.set('simulateAttempt', ++simulateAttempt);
+    var stopURLs = [
+      '/data/wizard/stop_services/poll_1.json',
+      '/data/wizard/stop_services/poll_2.json',
+      '/data/wizard/stop_services/poll_3.json',
+      '/data/wizard/stop_services/poll_4.json'
+    ];
+    if(process.get('name') == 'STOP_SERVICES'){
+      if(simulateAttempt < 4){
+        this.set('mockUrl', stopURLs[simulateAttempt]);
+        this.doPoll();
+        this.set('simulateAttempt', ++simulateAttempt);
+      }
+    } else {
+      if(simulateAttempt < 5){
+        this.set('mockUrl', upgradeURLs[simulateAttempt]);
+        this.doPoll();
+        this.set('simulateAttempt', ++simulateAttempt);
+      }
     }
     }
   },
   },
-  /**
-   * simulate stopping services before upgrade,
-   * using mockServices data
-   */
-  simulateStopService: function(){
-    var services = this.get('mockServices');
-    var self = this;
-    setTimeout(function(){
-      services[0].set('workStatus', 'STOPPING');
-    }, 4000);
-    setTimeout(function(){
-      services[0].set('workStatus', 'INSTALLED');
-    }, 8000);
-    setTimeout(function(){
-      services[1].set('workStatus', 'STOPPING');
-    }, 12000);
-    setTimeout(function(){
-      services[1].set('workStatus', 'INSTALLED');
-      services.setEach('workStatus', 'INSTALLED');
-    }, 16000);
+  getUrl:function(){
+    var requestId = this.get('content.cluster.requestId');
+    var clusterName = this.get('content.cluster.name');
+    if(App.testMode){
+      return this.get('mockUrl');
+    }
+    return App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/*';
   },
   },
-
   /**
   /**
-   * poll server for tasks, which contain upgrade progress data
-   * @param url
+   * poll server for tasks, which contain process progress data
    * @param interval
    * @param interval
    */
    */
-  doPoll: function(url, interval){
+  doPoll: function(interval){
+    var url = this.getUrl();
     var self = this;
     var self = this;
     var pollInterval = interval || self.POLL_INTERVAL;
     var pollInterval = interval || self.POLL_INTERVAL;
     if (self.get('isPolling')) {
     if (self.get('isPolling')) {
       setTimeout(function () {
       setTimeout(function () {
         $.ajax({
         $.ajax({
-          utype: 'GET',
+          type: 'GET',
           url: url,
           url: url,
           async: true,
           async: true,
           timeout: App.timeout,
           timeout: App.timeout,
           dataType: 'json',
           dataType: 'json',
           success: function (data) {
           success: function (data) {
             var result = self.parseTasks(data);
             var result = self.parseTasks(data);
-            if (App.testMode) {
-              self.simulatePolling();
-            } else {
-              self.doPoll(url);
+            if(result){
+              if (App.testMode) {
+                self.simulatePolling();
+              } else {
+                self.doPoll();
+              }
             }
             }
           },
           },
           error: function () {
           error: function () {
-
+            console.log('ERROR: poll request failed')
           },
           },
           statusCode: require('data/statusCodes')
           statusCode: require('data/statusCodes')
         }).retry({times: App.maxRetries, timeout: App.timeout}).then(null,
         }).retry({times: App.maxRetries, timeout: App.timeout}).then(null,
@@ -368,114 +334,139 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
    */
    */
   parseTasks: function(data){
   parseTasks: function(data){
     var tasks = data.tasks || [];
     var tasks = data.tasks || [];
-    this.get('services').forEach(function (service) {
-      var hosts = service.get('hosts');
-      var tasksPerService = [];
-      if(hosts.length){
-        hosts.forEach(function (host) {
-          var tasksPerHost = tasks.filter(function(task){
-            if(task.Tasks.host_name == host.name && host.get('components').contains(task.Tasks.role)){
-              return true;
-            }
-          });
-          if (tasksPerHost.length) {
-            this.setLogTasksStatePerHost(tasksPerHost, host);
-            tasksPerService = tasksPerService.concat(tasksPerHost);
-          }
-        }, this);
-        this.progressOnService(service, tasksPerService);
-        this.statusOnService(service, tasksPerService);
-      } else {
-        service.set('status', 'PENDING');
-        service.set('detailedMessage', Em.I18n.t('installer.stackUpgrade.step3.host.nothingToUpgrade'));
-        console.log('None tasks matched to service ' + service);
-      }
-    }, this);
+    var process = this.get('processes').findProperty('isRunning', true);
+    // if process was finished then it terminates next poll
+    var continuePolling = true;
+
+    this.progressOnProcess(tasks, process);
+    continuePolling = this.statusOnProcess(tasks, process);
+    if(process.get('hosts').length && tasks.length){
+      process.get('hosts').forEach(function (host) {
+        var tasksPerHost = tasks.filterProperty('Tasks.host_name', host.name);
+        if (tasksPerHost.length) {
+          this.setLogTasksStatePerHost(tasksPerHost, host);
+        }
+      }, this);
+    }
     this.set('serviceTimestamp', new Date().getTime());
     this.set('serviceTimestamp', new Date().getTime());
-    return true;
+    return continuePolling;
+  },
+  /**
+   * calculate progress according to tasks status
+   * @param actions
+   * @param process
+   */
+  progressOnProcess: function(actions, process){
+    var progress = 0;
+    var actionsNumber = actions.length;
+    var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length
+      + actions.filterProperty('Tasks.status', 'FAILED').length
+      + actions.filterProperty('Tasks.status', 'ABORTED').length
+      + actions.filterProperty('Tasks.status', 'TIMEDOUT').length;
+    var queuedActions = actions.filterProperty('Tasks.status', 'QUEUED').length;
+    var inProgressActions = actions.filterProperty('Tasks.status', 'IN_PROGRESS').length;
+    progress = Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsNumber * 100);
+    console.log('INFO: progress is: ' + progress);
+    process.set('progress', progress);
   },
   },
   /**
   /**
-   * evaluate status of service depending on the tasks
-   * also set detailMessage that show currently running process
-   * @param service
+   * evaluate status of process according to task status
    * @param actions
    * @param actions
+   * @param process
    */
    */
-  statusOnService: function(service, actions){
-    var status;
-    var errorActions = actions.filter(function(action){
-      if(action.Tasks.status == 'FAILED' || action.Tasks.status == 'ABORTED' || action.Tasks.status == 'TIMEDOUT'){
+  statusOnProcess: function(actions, process){
+    var status = null;
+    var message = '';
+    var continuePolling = true;
+    var errorActions = actions.filter(function (action) {
+      if (action.Tasks.status == 'FAILED' || action.Tasks.status == 'ABORTED' || action.Tasks.status == 'TIMEDOUT') {
         return true;
         return true;
       }
       }
     });
     });
     var masterComponents = ['NAMENODE', 'SECONDARY_NAMENODE', 'SNAMENODE', 'JOBTRACKER', 'ZOOKEEPER_SERVER', 'HIVE_SERVER',
     var masterComponents = ['NAMENODE', 'SECONDARY_NAMENODE', 'SNAMENODE', 'JOBTRACKER', 'ZOOKEEPER_SERVER', 'HIVE_SERVER',
-      'HIVE_METASTORE', 'MYSQL_SERVER', 'HBASE_MASTER', 'NAGIOS_SERVER', 'GANGLIA_SERVER', 'OOZIE_SERVER','WEBHCAT_SERVER'];
+      'HIVE_METASTORE', 'MYSQL_SERVER', 'HBASE_MASTER', 'NAGIOS_SERVER', 'GANGLIA_SERVER', 'OOZIE_SERVER', 'WEBHCAT_SERVER'];
     var failedComponents = errorActions.mapProperty('Tasks.role');
     var failedComponents = errorActions.mapProperty('Tasks.role');
-    if(failedComponents.length){
-      for(var i = 0; i < failedComponents.length; i++){
-        if(masterComponents.contains(failedComponents[i])){
+    if (failedComponents.length) {
+      for (var i = 0; i < failedComponents.length; i++) {
+        if (masterComponents.contains(failedComponents[i])) {
           status = "FAILED";
           status = "FAILED";
+          continuePolling = false;
+          this.finishProcess(process, status);
           break;
           break;
-        } else {
+        } else if(process.get('progress') == 100){
           status = "WARNING";
           status = "WARNING";
+          if(process.get('name') == 'UPGRADE_SERVICES'){
+            continuePolling = false;
+            this.finishProcess(process, status);
+          }
         }
         }
       }
       }
-    } else if(actions.everyProperty('Tasks.status', 'COMPLETED')){
-      status = 'SUCCESS';
-    } else {
-      var activeAction = actions.findProperty('Tasks.status', 'UPGRADING');
-      status = 'IN_PROGRESS';
-      if (activeAction === undefined || activeAction === null) {
-        activeAction = actions.findProperty('Tasks.status', 'QUEUED');
-        status = 'PENDING';
-      }
-      if (activeAction === undefined || activeAction === null) {
-        activeAction = actions.findProperty('Tasks.status', 'PENDING');
-        status = 'PENDING';
-      }
-      if(activeAction){
-        service.set('detailMessage', this.displayMessage(activeAction.Tasks));
+    }
+    if(!status || ((status == 'WARNING') && (process.get('name') == 'STOP_SERVICES'))){
+      if (actions.everyProperty('Tasks.status', 'COMPLETED')) {
+        status = 'SUCCESS';
+        continuePolling = false;
+        this.finishProcess(process, status);
+      } else {
+        var activeAction = actions.findProperty('Tasks.status', 'IN_PROGRESS');
+        status = 'IN_PROGRESS';
+        if (activeAction === undefined || activeAction === null) {
+          activeAction = actions.findProperty('Tasks.status', 'QUEUED');
+          status = 'PENDING';
+        }
+        if (activeAction === undefined || activeAction === null) {
+          activeAction = actions.findProperty('Tasks.status', 'PENDING');
+          status = 'PENDING';
+        }
+        if (activeAction) {
+          message = this.displayMessage(activeAction.Tasks);
+        }
       }
       }
     }
     }
-    service.set('status', status);
-  },
-  /**
-   * calculate progress of service depending on the tasks
-   * @param service
-   * @param actions
-   */
-  progressOnService: function(service, actions){
-    var progress = 0;
-    var actionsNumber = actions.length;
-    var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length
-      + actions.filterProperty('Tasks.status', 'FAILED').length
-      + actions.filterProperty('Tasks.status', 'ABORTED').length
-      + actions.filterProperty('Tasks.status', 'TIMEDOUT').length;
-    var queuedActions = actions.filterProperty('Tasks.status', 'QUEUED').length;
-    var inProgressActions = actions.filterProperty('Tasks.status', 'UPGRADING').length;
-    progress = Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsNumber * 100);
-    console.log('INFO: progressPerService is: ' + progress);
-    service.set('progress', progress);
+    console.log('INFO: status is: ' + status);
+    process.set('status', status);
+    process.set('message', message);
+    return continuePolling;
   },
   },
   /**
   /**
-   * determine description of current running process
-   * @param task
-   * @return {*}
+   * complete process phase
+   * accept FAILED, SUCCESS, WARNING process status
+   * @param process
+   * @param status
    */
    */
-  displayMessage: function (task) {
-    var role = App.format.role(task.role);
-    // accept only default command - "UPGRADE"
-    console.log("In display message with task command value: " + task.command);
-    switch (task.status) {
-      case 'PENDING':
-        return Em.I18n.t('installer.step9.serviceStatus.upgrade.pending') + role;
-      case 'QUEUED' :
-        return Em.I18n.t('installer.step9.serviceStatus.upgrade.queued') + role;
-      case 'UPGRADING':
-        return Em.I18n.t('installer.step9.serviceStatus.upgrade.inProgress') + role;
-      case 'COMPLETED' :
-        return Em.I18n.t('installer.step9.serviceStatus.upgrade.completed') + role;
-      case 'FAILED':
-        return Em.I18n.t('installer.step9.serviceStatus.upgrade.failed') + role;
+  finishProcess: function(process, status){
+    this.set('isPolling', false);
+    if(process.get('name') == 'STOP_SERVICES'){
+      if(status == 'SUCCESS'){
+        process.set('isRunning', false);
+        this.resetMockConfig();
+        this.runUpgrade();
+      } else {
+        process.set('isRetry', true);
+      }
+    }
+    if(process.get('name') == 'UPGRADE_SERVICES'){
+      if(status == 'SUCCESS'){
+        this.set('submitButton', Em.I18n.t('common.done'));
+        this.saveClusterStatus({
+          status: 'STACK_UPGRADED',
+          isCompleted: true
+        })
+      } else if(status == 'FAILED') {
+        process.set('isRetry', true);
+        this.set('submitButton', false);
+        this.saveClusterStatus({
+          status: 'STACK_UPGRADE_FAILED',
+          isCompleted: false
+        })
+      } else if(status == 'WARNING'){
+        this.set('submitButton', Em.I18n.t('installer.stackUpgrade.step3.ProceedWithWarning'));
+        process.set('isRetry', true);
+        this.saveClusterStatus({
+          status: 'STACK_UPGRADED',
+          isCompleted: true
+        })
+      }
     }
     }
   },
   },
   /**
   /**
@@ -495,58 +486,88 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
       //}
       //}
     }, this);
     }, this);
   },
   },
-  /**
-   * clear config and data after completion of upgrade
-   */
-  clearStep: function(){
-    this.get('services').clear();
-    this.set('isUpgradeStarted', false);
-    this.resetMockConfig(false);
-  },
   /**
   /**
    * reset mock configs to run upgrade simulation again
    * reset mock configs to run upgrade simulation again
    */
    */
   resetMockConfig: function(retry){
   resetMockConfig: function(retry){
-    if(!retry){
-      this.get('mockServices').setEach('workStatus', 'STARTED');
-    }
     this.set('simulateAttempt', 0);
     this.set('simulateAttempt', 0);
   },
   },
   /**
   /**
-   * navigate to show current process depending on cluster status
+   * resume wizard on last operation
    */
    */
-  navigateStep: function(){
+  resumeStep: function () {
     var clusterStatus = this.get('content.cluster.status');
     var clusterStatus = this.get('content.cluster.status');
-    var status = 'PENDING';
-    if (this.get('content.cluster.isCompleted') === false) {
-      if (this.get('isServicesStopped')){
-        this.startPolling();
-        if (clusterStatus === 'STACK_UPGRADING'){
-          // IN_PROGRESS
-          status = 'IN_PROGRESS';
-        } else if (clusterStatus === 'STACK_UPGRADE_FAILED'){
-          // FAILED
-          status = 'FAILED';
-          // poll only one time
-          this.set('isPolling', false);
-        } else {
-          // WARNING
-          status = 'WARNING';
-          // poll only one time
-          this.set('isPolling', false);
-        }
-      } else {
-        // services are stopping yet
+    var upgrade = this.get('processes').findProperty('name', 'UPGRADE_SERVICES');
+    var stop = this.get('processes').findProperty('name', 'STOP_SERVICES');
+    if(App.testMode){
+      if(this.get('processes').everyProperty('isRunning', false)){
+        stop.set('isRunning', true);
       }
       }
-    } else {
-      status = 'SUCCESS';
+      clusterStatus = (this.get('processes').findProperty('name', 'UPGRADE_SERVICES').get('isRunning'))?
+       'STACK_UPGRADING':
+       'STOPPING_SERVICES';
+      upgrade.set('isRetry', false);
+      stop.set('isRetry', false);
     }
     }
-    if (App.testMode) {
-      if(!this.get('isServicesStopped')){
-        this.simulateStopService();
+    if (clusterStatus == 'STOPPING_SERVICES') {
+      this.startPolling();
+      stop.set('isRunning', true);
+      upgrade.set('isRunning', false);
+    } else if(clusterStatus != 'PENDING'){
+      stop.set('status', 'SUCCESS');
+      stop.set('progress', 100);
+      stop.set('isRunning', false);
+      upgrade.set('isRunning', true);
+      if (clusterStatus == 'STACK_UPGRADING') {
+        upgrade.set('status', 'IN_PROGRESS');
+        this.startPolling();
+      } else if (clusterStatus == 'STACK_UPGRADE_FAILED') {
+        upgrade.set('status', 'FAILED');
+        upgrade.set('isRetry', true);
+      } else if (clusterStatus == 'STACK_UPGRADED') {
+        upgrade.set('status', 'SUCCESS');
+        upgrade.set('progress', 100);
+        this.startPolling();
+        this.set('isPolling', false);
       }
       }
-    } else {
-      this.set('status', status);
+    }
+  },
+  /**
+   * determine description of current running process
+   * @param task
+   * @return {*}
+   */
+  displayMessage: function (task) {
+    var role = App.format.role(task.role);
+    console.log("In display message with task command value: " + task.command);
+    switch (task.command){
+      case 'UPGRADE':
+        switch (task.status) {
+          case 'PENDING':
+            return Em.I18n.t('installer.step9.serviceStatus.upgrade.pending') + role;
+          case 'QUEUED' :
+            return Em.I18n.t('installer.step9.serviceStatus.upgrade.queued') + role;
+          case 'IN_PROGRESS':
+            return Em.I18n.t('installer.step9.serviceStatus.upgrade.inProgress') + role;
+          case 'COMPLETED' :
+            return Em.I18n.t('installer.step9.serviceStatus.upgrade.completed') + role;
+          case 'FAILED':
+            return Em.I18n.t('installer.step9.serviceStatus.upgrade.failed') + role;
+        }
+        break;
+      case 'STOP' :
+        switch (task.status) {
+          case 'PENDING':
+            return Em.I18n.t('installer.step9.serviceStatus.stop.pending') + role;
+          case 'QUEUED' :
+            return Em.I18n.t('installer.step9.serviceStatus.stop.queued') + role;
+          case 'IN_PROGRESS':
+            return Em.I18n.t('installer.step9.serviceStatus.stop.inProgress') + role;
+          case 'COMPLETED' :
+            return role + Em.I18n.t('installer.step9.serviceStatus.stop.completed');
+          case 'FAILED':
+            return role + Em.I18n.t('installer.step9.serviceStatus.stop.failed');
+        }
     }
     }
   }
   }
 });
 });

+ 544 - 376
ambari-web/app/controllers/wizard/step14_controller.js

@@ -20,15 +20,31 @@ var App = require('app');
 
 
 App.WizardStep14Controller = Em.Controller.extend({
 App.WizardStep14Controller = Em.Controller.extend({
 
 
-  status: function () {
+  status: 'IN_PROGRESS',
+
+  onStatusChange: function () {
     if (this.get('tasks').someProperty('status', 'FAILED')) {
     if (this.get('tasks').someProperty('status', 'FAILED')) {
-      return 'FAILED';
-    }
-    if (this.get('tasks').everyProperty('status', 'COMPLETED')) {
-      return 'COMPLETED';
+      this.set('status', 'FAILED');
+      if (this.get('tasks')[5].status == 'FAILED' || this.get('tasks')[6].status == 'FAILED') {
+        this.set('showRetry', true);
+      }
+    } else if (this.get('tasks').everyProperty('status', 'COMPLETED')) {
+      this.set('status', 'COMPLETED');
+      this.set('isSubmitDisabled', false);
+    } else {
+      this.set('status', 'IN_PROGRESS')
     }
     }
-    return 'IN_PROGRESS';
-  }.property('tasks.@each.status'),
+    var statuses = this.get('tasks').mapProperty('status');
+    App.router.get(this.get('content.controllerName')).saveTasksStatuses(statuses);
+    App.clusterStatus.setClusterStatus({
+      clusterName: this.get('content.cluster.name'),
+      clusterState: 'REASSIGN_MASTER_INSTALLING',
+      wizardControllerName: this.get('content.controllerName'),
+      localdb: App.db.data
+    });
+    this.setTasksMessages();
+    this.navigateStep();
+  },
 
 
   tasks: [],
   tasks: [],
 
 
@@ -38,6 +54,10 @@ App.WizardStep14Controller = Em.Controller.extend({
   setTasksMessages: function () {
   setTasksMessages: function () {
     var service = this.get('service.displayName');
     var service = this.get('service.displayName');
     var master = this.get('masterComponent.display_name');
     var master = this.get('masterComponent.display_name');
+    if (this.get('isCohosted')) {
+      service = 'Hive, WebHCat';
+      master = Em.I18n.t('installer.step5.hiveGroup');
+    }
     for (i = 0; i < this.get('tasks').length; i++) {
     for (i = 0; i < this.get('tasks').length; i++) {
       var status = this.get('tasks')[i].status.toLowerCase().replace('initialize', 'pending').replace('_', ' ');
       var status = this.get('tasks')[i].status.toLowerCase().replace('initialize', 'pending').replace('_', ' ');
       if (i == 0 || i == 6) {
       if (i == 0 || i == 6) {
@@ -46,18 +66,20 @@ App.WizardStep14Controller = Em.Controller.extend({
         this.get('tasks')[i].set('message', Em.I18n.t('installer.step14.task' + i).format(master) + ' ' + status);
         this.get('tasks')[i].set('message', Em.I18n.t('installer.step14.task' + i).format(master) + ' ' + status);
       }
       }
     }
     }
-  }.observes('tasks.@each.status'),
+  },
 
 
   configs: [],
   configs: [],
   globals: [],
   globals: [],
-  configMapping: require('data/config_mapping'),
+  configMapping: require('data/config_mapping').all(),
   newConfigsTag: null,
   newConfigsTag: null,
   createdConfigs: [],
   createdConfigs: [],
 
 
-  currentRequestId: null,
+  currentRequestId: [],
 
 
   isSubmitDisabled: true,
   isSubmitDisabled: true,
 
 
+  showRetry: false,
+
   service: function () {
   service: function () {
     return App.Service.find().findProperty('serviceName', this.get('masterComponent.service_id'));
     return App.Service.find().findProperty('serviceName', this.get('masterComponent.service_id'));
   }.property('masterComponent'),
   }.property('masterComponent'),
@@ -66,13 +88,20 @@ App.WizardStep14Controller = Em.Controller.extend({
     return this.get('content.reassign');
     return this.get('content.reassign');
   }.property('content.reassign'),
   }.property('content.reassign'),
 
 
+  isCohosted: function () {
+    return this.get('masterComponent.component_name') == 'HIVE_SERVER';
+  }.property('masterComponent'),
+
   loadStep: function () {
   loadStep: function () {
     this.clearStep();
     this.clearStep();
     this.loadTasks();
     this.loadTasks();
-    this.navigateStep();
+    this.addObserver('tasks.@each.status', this, 'onStatusChange');
+    this.onStatusChange();
   },
   },
 
 
   clearStep: function () {
   clearStep: function () {
+    this.removeObserver('tasks.@each.status', this, 'onStatusChange');
+    this.removeObserver('createdConfigs.length', this, 'onCreateConfigsCompleted');
     var tasks = [];
     var tasks = [];
     for (var i = 0; i < 8; i++) {
     for (var i = 0; i < 8; i++) {
       tasks.pushObject(Ember.Object.create({
       tasks.pushObject(Ember.Object.create({
@@ -83,6 +112,10 @@ App.WizardStep14Controller = Em.Controller.extend({
       }));
       }));
     }
     }
     this.set('tasks', tasks);
     this.set('tasks', tasks);
+    this.set('createdConfigsCount', 0);
+    this.set('queueTasksCompleted', 0);
+    this.set('dataPollCounter', 1);
+    this.set('showRetry', false);
     this.set('isSubmitDisabled', true);
     this.set('isSubmitDisabled', true);
     this.get('configs').clear();
     this.get('configs').clear();
     this.get('globals').clear();
     this.get('globals').clear();
@@ -90,7 +123,17 @@ App.WizardStep14Controller = Em.Controller.extend({
   },
   },
 
 
   loadTasks: function () {
   loadTasks: function () {
-
+    var statuses = this.get('content.tasksStatuses');
+    if (statuses) {
+      statuses.forEach(function (status, index) {
+        this.get('tasks')[index].status = status;
+      }, this)
+    }
+    var statusesForRequestId = ['PENDING', 'QUEUED', 'IN_PROGRESS'];
+    if (statusesForRequestId.contains(statuses[0]) || statusesForRequestId.contains(statuses[5]) || statusesForRequestId.contains(statuses[6])) {
+      this.set('currentRequestId', this.get('content.cluster.requestId'));
+      this.getLogsByRequest();
+    }
   },
   },
 
 
   /**
   /**
@@ -121,7 +164,7 @@ App.WizardStep14Controller = Em.Controller.extend({
     else if (this.taskIsReady(7)) {
     else if (this.taskIsReady(7)) {
       this.removeComponent();
       this.removeComponent();
     }
     }
-  }.observes('tasks.@each.status'),
+  },
 
 
   /**
   /**
    * Determine preparedness to run task
    * Determine preparedness to run task
@@ -129,151 +172,182 @@ App.WizardStep14Controller = Em.Controller.extend({
    * @return {Boolean}
    * @return {Boolean}
    */
    */
   taskIsReady: function (task) {
   taskIsReady: function (task) {
-    var startIndex = (task == 5) ? 0 : 1;
+    if (this.get('tasks')[task].status != 'INITIALIZE') {
+      return false;
+    }
+    var startIndex = (task == 4) ? 0 : 1;
     var tempArr = this.get('tasks').mapProperty('status').slice(startIndex, task).uniq();
     var tempArr = this.get('tasks').mapProperty('status').slice(startIndex, task).uniq();
-    return this.get('tasks')[task].status == 'INITIALIZE' && tempArr.length == 1 && tempArr[0] == 'COMPLETED';
+    return tempArr.length == 1 && tempArr[0] == 'COMPLETED';
   },
   },
 
 
+  queueTasksCompleted: 0,
+
   /**
   /**
    * Change status of the task
    * Change status of the task
    * @param task
    * @param task
    * @param status
    * @param status
    */
    */
   setTasksStatus: function (task, status) {
   setTasksStatus: function (task, status) {
-    this.get('tasks')[task].set('status', status);
+    if (status == 'COMPLETED' && this.get('isCohosted') && [1, 4, 7].contains(task) && this.get('queueTasksCompleted') < 2) {
+      this.set('queueTasksCompleted', this.get('queueTasksCompleted') + 1);
+    } else {
+      this.get('tasks')[task].set('status', status);
+    }
+  },
+
+  saveClusterStatus: function (requestId, status) {
+    var clusterStatus = {
+      status: status,
+      requestId: requestId
+    };
+    App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
   },
   },
 
 
   stopService: function () {
   stopService: function () {
-    var self = this;
-    var clusterName = this.get('content.cluster.name');
-    var serviceName = this.get('masterComponent.service_id');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + serviceName;
-    var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
-    var method = 'PUT';
-    $.ajax({
-      type: method,
-      url: url,
-      data: data,
-      dataType: 'text',
-      timeout: App.timeout,
-
-      beforeSend: function () {
-        self.setTasksStatus(0, 'PENDING');
-      },
+    this.set('currentRequestId', []);
+    var serviceNames = [this.get('masterComponent.service_id')];
+    if (this.get('isCohosted')) {
+      serviceNames = ['HIVE', 'WEBHCAT'];
+    }
+    serviceNames.forEach(function (serviceName) {
+      App.ajax.send({
+        name: 'reassign.stop_service',
+        sender: this,
+        data: {
+          serviceName: serviceName
+        },
+        beforeSend: 'onStopServiceBeforeSend',
+        success: 'onStopServiceSuccess',
+        error: 'onStopServiceError'
+      });
+    }, this);
+  },
 
 
-      success: function (data) {
-        if (jQuery.parseJSON(data)) {
-          self.set('currentRequestId', jQuery.parseJSON(data).Requests.id);
-          self.getLogsByRequest();
-        } else {
-          self.setTasksStatus(0, 'FAILED');
-        }
-      },
+  onStopServiceBeforeSend: function () {
+    this.setTasksStatus(0, 'PENDING');
+  },
 
 
-      error: function () {
-        self.setTasksStatus(0, 'FAILED');
-      },
+  onStopServiceSuccess: function (data) {
+    if (data) {
+      var requestId = data.Requests.id;
+      this.get('currentRequestId').push(requestId);
+      this.saveClusterStatus(this.get('currentRequestId'), 'PENDING');
+      if ((this.get('isCohosted') && this.get('currentRequestId.length') == 2) || !this.get('isCohosted')) {
+        this.getLogsByRequest();
+      }
+    } else {
+      this.setTasksStatus(0, 'FAILED');
+    }
+  },
 
 
-      statusCode: require('data/statusCodes')
-    });
+  onStopServiceError: function () {
+    this.setTasksStatus(0, 'FAILED');
   },
   },
 
 
   createMasterComponent: function () {
   createMasterComponent: function () {
-    var self = this;
-    var clusterName = this.get('content.cluster.name');
     var hostName = this.get('content.masterComponentHosts').findProperty('component', this.get('content.reassign.component_name')).hostName;
     var hostName = this.get('content.masterComponentHosts').findProperty('component', this.get('content.reassign.component_name')).hostName;
-    var componentName = this.get('masterComponent.component_name');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/hosts?Hosts/host_name=' + hostName;
-    var data = {
-      "host_components": [
-        {
-          "HostRoles": {
-            "component_name": componentName
-          }
-        }
-      ]
-    };
-    var method = 'POST';
-    $.ajax({
-      type: method,
-      url: url,
-      data: JSON.stringify(data),
-      dataType: 'text',
-      timeout: App.timeout,
-
-      beforeSend: function () {
-        self.setTasksStatus(1, 'PENDING');
-      },
-
-      success: function () {
-        self.setTasksStatus(1, 'COMPLETED');
-      },
+    var componentNames = [this.get('masterComponent.component_name')];
+    if (this.get('isCohosted')) {
+      this.set('queueTasksCompleted', 0);
+      componentNames = ['HIVE_SERVER', 'WEBHCAT_SERVER', 'MYSQL_SERVER'];
+    }
+    componentNames.forEach(function (componentName) {
+      if (App.testMode) {
+        this.setTasksStatus(1, 'COMPLETED');
+      } else {
+        App.ajax.send({
+          name: 'reassign.create_master',
+          sender: this,
+          data: {
+            hostName: hostName,
+            componentName: componentName
+          },
+          beforeSend: 'onCreateMasterComponentBeforeSend',
+          success: 'onCreateMasterComponentSuccess',
+          error: 'onCreateMasterComponentError'
+        });
+      }
+    }, this);
+  },
 
 
-      error: function () {
-        self.setTasksStatus(1, 'FAILED');
-      },
+  onCreateMasterComponentBeforeSend: function () {
+    this.setTasksStatus(1, 'PENDING');
+  },
 
 
-      statusCode: require('data/statusCodes')
-    });
+  onCreateMasterComponentSuccess: function () {
+    this.setTasksStatus(1, 'COMPLETED');
+  },
 
 
+  onCreateMasterComponentError: function () {
+    this.setTasksStatus(1, 'FAILED');
   },
   },
 
 
   createConfigs: function () {
   createConfigs: function () {
-    this.loadGlobals();
-    this.loadConfigs();
-    this.set('newConfigsTag', 'version' + (new Date).getTime());
-    var serviceName = this.get('service.serviceName');
-    this.createConfigSite(this.createGlobalSiteObj());
-    this.createConfigSite(this.createCoreSiteObj());
-    if (serviceName == 'HDFS') {
-      this.createConfigSite(this.createHdfsSiteObj());
-    }
-    if (serviceName == 'MAPREDUCE') {
-      this.createConfigSite(this.createMrSiteObj());
-    }
-    if (serviceName == 'HBASE') {
-      this.createConfigSite(this.createHbaseSiteObj());
-    }
-    if (serviceName == 'OOZIE') {
-      this.createConfigSite(this.createOozieSiteObj());
-    }
-    if (serviceName == 'HIVE') {
-      this.createConfigSite(this.createHiveSiteObj());
-    }
-    if (serviceName == 'WEBHCAT') {
-      this.createConfigSite(this.createWebHCatSiteObj());
-    }
-    if (this.get('tasks')[2].status !== 'FAILED') {
+    if (this.get('service.serviceName') == 'GANGLIA' || App.testMode) {
       this.setTasksStatus(2, 'COMPLETED');
       this.setTasksStatus(2, 'COMPLETED');
+    } else {
+      this.setTasksStatus(2, 'PENDING');
+      this.loadGlobals();
+      this.loadConfigs();
+      this.set('newConfigsTag', 'version' + (new Date).getTime());
+      var serviceName = this.get('service.serviceName');
+      this.createConfigSite(this.createGlobalSiteObj());
+      this.createConfigSite(this.createCoreSiteObj());
+      if (serviceName == 'HDFS') {
+        this.createConfigSite(this.createSiteObj('hdfs-site'));
+      }
+      if (serviceName == 'MAPREDUCE') {
+        this.createConfigSite(this.createSiteObj('mapred-site'));
+      }
+      if (serviceName == 'HBASE') {
+        this.createConfigSite(this.createSiteObj('hbase-site'));
+      }
+      if (serviceName == 'OOZIE') {
+        this.createConfigSite(this.createSiteObj('oozie-site'));
+      }
+      if (serviceName == 'HIVE' || this.get('isCohosted')) {
+        this.createConfigSite(this.createSiteObj('hive-site'));
+      }
+      if (serviceName == 'WEBHCAT' || this.get('isCohosted')) {
+        this.createConfigSite(this.createSiteObj('webhcat-site'));
+      }
+      this.addObserver('createdConfigs.length', this, 'onCreateConfigsCompleted');
+      this.onCreateConfigsCompleted();
     }
     }
   },
   },
 
 
-  createConfigSite: function (data) {
-    var self = this;
-    data.tag = this.get('newConfigsTag');
-    var clusterName = this.get('content.cluster.name');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/configurations';
-    $.ajax({
-      type: 'POST',
-      url: url,
-      data: JSON.stringify(data),
-      dataType: 'text',
-      timeout: 5000,
-
-      beforeSend: function () {
-        self.setTasksStatus(2, 'PENDING');
+  createConfigSite: function (configs) {
+    configs.tag = this.get('newConfigsTag');
+    App.ajax.send({
+      name: 'reassign.create_configs',
+      sender: this,
+      data: {
+        configs: configs
       },
       },
+      beforeSend: 'onCreateConfigsBeforeSend',
+      success: 'onCreateConfigsSuccess',
+      error: 'onCreateConfigsError'
+    });
+  },
 
 
-      success: function () {
-        self.get('createdConfigs').push(data.type);
-      },
+  onCreateConfigsBeforeSend: function () {
+    this.set('createdConfigsCount', this.get('createdConfigsCount') + 1);
+  },
 
 
-      error: function () {
-        self.setTasksStatus(2, 'FAILED');
-      },
+  onCreateConfigsSuccess: function (data, opts) {
+    this.get('createdConfigs').pushObject(opts.configs.type);
+  },
 
 
-      statusCode: require('data/statusCodes')
-    });
+  onCreateConfigsError: function () {
+    this.setTasksStatus(2, 'FAILED');
+  },
+
+  createdConfigsCount: 0,
+
+  onCreateConfigsCompleted: function () {
+    if (this.get('createdConfigs.length') == this.get('createdConfigsCount')) {
+      this.setTasksStatus(2, 'COMPLETED');
+    }
   },
   },
 
 
   loadGlobals: function () {
   loadGlobals: function () {
@@ -334,10 +408,8 @@ App.WizardStep14Controller = Em.Controller.extend({
       return expression;
       return expression;
     }
     }
     express.forEach(function (_express) {
     express.forEach(function (_express) {
-      //console.log("The value of template is: " + _express);
       var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
       var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
       if (this.get('globals').someProperty('name', templateName[index])) {
       if (this.get('globals').someProperty('name', templateName[index])) {
-        //console.log("The name of the variable is: " + this.get('content.serviceConfigProperties').findProperty('name', templateName[index]).name);
         var globValue = this.get('globals').findProperty('name', templateName[index]).value;
         var globValue = this.get('globals').findProperty('name', templateName[index]).value;
         // Hack for templeton.zookeeper.hosts
         // Hack for templeton.zookeeper.hosts
         if (value !== null) {   // if the property depends on more than one template name like <templateName[0]>/<templateName[1]> then don't proceed to the next if the prior is null or not found in the global configs
         if (value !== null) {   // if the property depends on more than one template name like <templateName[0]>/<templateName[1]> then don't proceed to the next if the prior is null or not found in the global configs
@@ -357,12 +429,6 @@ App.WizardStep14Controller = Em.Controller.extend({
           }
           }
         }
         }
       } else {
       } else {
-        /*
-         console.log("ERROR: The variable name is: " + templateName[index]);
-         console.log("ERROR: mapped config from configMapping file has no corresponding variable in " +
-         "content.serviceConfigProperties. Two possible reasons for the error could be: 1) The service is not selected. " +
-         "and/OR 2) The service_config metadata file has no corresponding global var for the site property variable");
-         */
         value = null;
         value = null;
       }
       }
     }, this);
     }, this);
@@ -426,32 +492,6 @@ App.WizardStep14Controller = Em.Controller.extend({
     }
     }
   },
   },
 
 
-
-  /**
-   * override site properties with the entered key-value pair in *-site.xml
-   */
-  setCustomConfigs: function () {
-    var site = this.get('content.serviceConfigProperties').filterProperty('id', 'conf-site');
-    site.forEach(function (_site) {
-      var keyValue = _site.value.split(/\n+/);
-      if (keyValue) {
-        keyValue.forEach(function (_keyValue) {
-          _keyValue = _keyValue.trim();
-          console.log("The value of the keyValue is: " + _keyValue);
-          // split on the first = encountered (the value may contain ='s)
-          var matches = _keyValue.match(/^([^=]+)=(.*)$/);
-          if (matches) {
-            var key = matches[1];
-            var value = matches[2];
-            if (key) {
-              this.setSiteProperty(key, value, _site.name + '.xml');
-            }
-          }
-        }, this);
-      }
-    }, this);
-  },
-
   /**
   /**
    * Set property of the site variable
    * Set property of the site variable
    */
    */
@@ -476,8 +516,6 @@ App.WizardStep14Controller = Em.Controller.extend({
         } else {
         } else {
           globalSiteProperties[_globalSiteObj.name] = _globalSiteObj.value;
           globalSiteProperties[_globalSiteObj.name] = _globalSiteObj.value;
         }
         }
-        console.log("STEP8: name of the global property is: " + _globalSiteObj.name);
-        console.log("STEP8: value of the global property is: " + _globalSiteObj.value);
       }
       }
     }, this);
     }, this);
     return {"type": "global", "properties": globalSiteProperties};
     return {"type": "global", "properties": globalSiteProperties};
@@ -498,93 +536,39 @@ App.WizardStep14Controller = Em.Controller.extend({
       if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
       if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
         coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
         coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
       }
       }
-      console.log("STEP*: name of the property is: " + _coreSiteObj.name);
-      console.log("STEP8: value of the property is: " + _coreSiteObj.value);
     }, this);
     }, this);
     return {"type": "core-site", "properties": coreSiteProperties};
     return {"type": "core-site", "properties": coreSiteProperties};
   },
   },
 
 
-  createHdfsSiteObj: function () {
-    var hdfsSiteObj = this.get('configs').filterProperty('filename', 'hdfs-site.xml');
-    var hdfsProperties = {};
-    hdfsSiteObj.forEach(function (_configProperty) {
-      hdfsProperties[_configProperty.name] = _configProperty.value;
-      console.log("STEP*: name of the property is: " + _configProperty.name);
-      console.log("STEP8: value of the property is: " + _configProperty.value);
-    }, this);
-    return {"type": "hdfs-site", "properties": hdfsProperties };
-  },
-
-  createMrSiteObj: function () {
-    var configs = this.get('configs').filterProperty('filename', 'mapred-site.xml');
-    var mrProperties = {};
-    configs.forEach(function (_configProperty) {
-      mrProperties[_configProperty.name] = _configProperty.value;
-      console.log("STEP*: name of the property is: " + _configProperty.name);
-      console.log("STEP8: value of the property is: " + _configProperty.value);
-    }, this);
-    return {type: 'mapred-site', properties: mrProperties};
-  },
-
-  createHbaseSiteObj: function () {
-    var configs = this.get('configs').filterProperty('filename', 'hbase-site.xml');
-    var hbaseProperties = {};
-    configs.forEach(function (_configProperty) {
-      hbaseProperties[_configProperty.name] = _configProperty.value;
-    }, this);
-    return {type: 'hbase-site', properties: hbaseProperties};
-  },
-
-  createOozieSiteObj: function () {
-    var configs = this.get('configs').filterProperty('filename', 'oozie-site.xml');
-    var oozieProperties = {};
-    configs.forEach(function (_configProperty) {
-      oozieProperties[_configProperty.name] = _configProperty.value;
-    }, this);
-    return {type: 'oozie-site', properties: oozieProperties};
-  },
-
-  createHiveSiteObj: function () {
-    var configs = this.get('configs').filterProperty('filename', 'hive-site.xml');
-    var hiveProperties = {};
-    configs.forEach(function (_configProperty) {
-      hiveProperties[_configProperty.name] = _configProperty.value;
-    }, this);
-    return {type: 'hive-site', properties: hiveProperties};
-  },
-
-  createWebHCatSiteObj: function () {
-    var configs = this.get('configs').filterProperty('filename', 'webhcat-site.xml');
-    var webHCatProperties = {};
+  createSiteObj: function (name) {
+    var fileName = name + '.xml';
+    var configs = this.get('configs').filterProperty('filename', fileName);
+    var properties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
-      webHCatProperties[_configProperty.name] = _configProperty.value;
+      properties[_configProperty.name] = _configProperty.value;
     }, this);
     }, this);
-    return {type: 'webhcat-site', properties: webHCatProperties};
+    return {type: name, properties: properties};
   },
   },
 
 
   applyConfigs: function () {
   applyConfigs: function () {
-    var self = this;
-    var configTags;
-    var clusterName = this.get('content.cluster.name');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + this.get('service.serviceName');
-    $.ajax({
-      type: 'GET',
-      url: url,
-      async: false,
-      timeout: 10000,
-      dataType: 'text',
-      success: function (data) {
-        var jsonData = jQuery.parseJSON(data);
-        configTags = jsonData.ServiceInfo.desired_configs;
-      },
-
-      error: function () {
-        self.setTasksStatus(3, 'FAILED');
-      },
-
-      statusCode: require('data/statusCodes')
-    });
+    if (this.get('service.serviceName') == 'GANGLIA' || App.testMode) {
+      this.setTasksStatus(3, 'COMPLETED');
+    } else {
+      var serviceName = this.get('service.serviceName');
+      App.ajax.send({
+        name: 'reassign.check_configs',
+        sender: this,
+        data: {
+          serviceName: serviceName
+        },
+        success: 'onCheckConfigsSuccess',
+        error: 'onCheckConfigsError'
+      });
+    }
+  },
 
 
+  onCheckConfigsSuccess: function (configs) {
+    var configTags = configs.ServiceInfo.desired_configs;
     if (!configTags) {
     if (!configTags) {
       this.setTasksStatus(0, 'FAILED');
       this.setTasksStatus(0, 'FAILED');
       return;
       return;
@@ -596,100 +580,156 @@ App.WizardStep14Controller = Em.Controller.extend({
       }
       }
     }
     }
     var data = {config: configTags};
     var data = {config: configTags};
-
-    $.ajax({
-      type: 'PUT',
-      url: url,
-      dataType: 'text',
-      data: JSON.stringify(data),
-      timeout: 5000,
-
-      beforeSend: function () {
-        self.setTasksStatus(3, 'PENDING');
+    var serviceName = this.get('service.serviceName');
+    App.ajax.send({
+      name: 'reassign.apply_configs',
+      sender: this,
+      data: {
+        serviceName: serviceName,
+        configs: data
       },
       },
+      beforeSend: 'onApplyConfigsBeforeSend',
+      success: 'onApplyConfigsSuccess',
+      error: 'onApplyConfigsError'
+    });
+  },
 
 
-      success: function () {
-        self.setTasksStatus(3, 'COMPLETED');
-      },
+  onCheckConfigsError: function () {
+    this.setTasksStatus(3, 'FAILED');
+  },
 
 
-      error: function () {
-        self.setTasksStatus(3, 'FAILED');
-      },
+  onApplyConfigsBeforeSend: function () {
+    this.setTasksStatus(3, 'PENDING');
+  },
 
 
-      statusCode: require('data/statusCodes')
-    });
+  onApplyConfigsSuccess: function () {
+    this.setTasksStatus(3, 'COMPLETED');
+  },
+
+  onApplyConfigsError: function () {
+    this.setTasksStatus(3, 'FAILED');
   },
   },
 
 
   putInMaintenanceMode: function () {
   putInMaintenanceMode: function () {
-    //todo after API providing
+    if (App.testMode) {
+      this.setTasksStatus(4, 'COMPLETED');
+    } else {
+      var hostName = this.get('content.reassign.host_id');
+      var componentNames = [this.get('masterComponent.component_name')];
+      if (this.get('isCohosted')) {
+        componentNames = ['HIVE_SERVER', 'WEBHCAT_SERVER', 'MYSQL_SERVER'];
+        this.set('queueTasksCompleted', 0);
+      }
+      componentNames.forEach(function (componentName) {
+        App.ajax.send({
+          name: 'reassign.maintenance_mode',
+          sender: this,
+          data: {
+            hostName: hostName,
+            componentName: componentName
+          },
+          beforeSend: 'onPutInMaintenanceModeBeforeSend',
+          success: 'onPutInMaintenanceModeSuccess',
+          error: 'onPutInMaintenanceModeError'
+        });
+      }, this);
+    }
+  },
+
+  onPutInMaintenanceModeBeforeSend: function () {
+    this.setTasksStatus(4, 'PENDING');
+  },
+
+  onPutInMaintenanceModeSuccess: function () {
     this.setTasksStatus(4, 'COMPLETED');
     this.setTasksStatus(4, 'COMPLETED');
   },
   },
 
 
+  onPutInMaintenanceModeError: function () {
+    this.setTasksStatus(4, 'FAILED');
+  },
+
   installComponent: function () {
   installComponent: function () {
-    var self = this;
-    var clusterName = this.get('content.cluster.name');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state=INIT';
-    var data = '{"HostRoles": {"state": "INSTALLED"}}';
-    var method = 'PUT';
-    $.ajax({
-      type: method,
-      url: url,
-      data: data,
-      dataType: 'text',
-      timeout: App.timeout,
-
-      beforeSend: function () {
-        self.setTasksStatus(5, 'PENDING');
-      },
+    this.set('currentRequestId', []);
+    var componentNames = [this.get('masterComponent.component_name')];
+    if (this.get('isCohosted')) {
+      componentNames = ['HIVE_SERVER', 'WEBHCAT_SERVER', 'MYSQL_SERVER'];
+    }
+    var hostName = this.get('content.masterComponentHosts').findProperty('component', this.get('content.reassign.component_name')).hostName;
+    componentNames.forEach(function (componentName) {
+      App.ajax.send({
+        name: 'reassign.install_component',
+        sender: this,
+        data: {
+          hostName: hostName,
+          componentName: componentName
+        },
+        beforeSend: 'onInstallComponentBeforeSend',
+        success: 'onInstallComponentSuccess',
+        error: 'onInstallComponentError'
+      });
+    }, this);
+  },
 
 
-      success: function (data) {
-        if (jQuery.parseJSON(data)) {
-          self.set('currentRequestId', jQuery.parseJSON(data).Requests.id);
-          self.getLogsByRequest();
-        } else {
-          self.setTasksStatus(5, 'FAILED');
-        }
-      },
+  onInstallComponentBeforeSend: function () {
+    this.setTasksStatus(5, 'PENDING');
+  },
 
 
-      error: function () {
-        self.setTasksStatus(5, 'FAILED');
-      },
+  onInstallComponentSuccess: function (data) {
+    if (data) {
+      var requestId = data.Requests.id;
+      this.get('currentRequestId').push(requestId);
+      this.saveClusterStatus(this.get('currentRequestId'), 'PENDING');
+      if ((this.get('isCohosted') && this.get('currentRequestId.length') == 3) || !this.get('isCohosted')) {
+        this.getLogsByRequest();
+      }
+    } else {
+      this.setTasksStatus(5, 'FAILED');
+    }
+  },
 
 
-      statusCode: require('data/statusCodes')
-    });
+  onInstallComponentError: function () {
+    this.setTasksStatus(5, 'FAILED');
   },
   },
 
 
   startComponents: function () {
   startComponents: function () {
-    var self = this;
-    var clusterName = this.get('content.cluster.name');
-    var serviceName = this.get('masterComponent.service_id');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + serviceName;
-    var data = '{"ServiceInfo": {"state": "STARTED"}}';
-    var method = 'PUT';
-    $.ajax({
-      type: method,
-      url: url,
-      data: data,
-      dataType: 'text',
-      timeout: App.timeout,
-
-      beforeSend: function () {
-        self.setTasksStatus(6, 'PENDING');
-      },
+    this.set('currentRequestId', []);
+    var serviceNames = [this.get('masterComponent.service_id')];
+    if (this.get('isCohosted')) {
+      serviceNames = ['HIVE', 'WEBHCAT'];
+    }
+    serviceNames.forEach(function (serviceName) {
+      App.ajax.send({
+        name: 'reassign.start_components',
+        sender: this,
+        data: {
+          serviceName: serviceName
+        },
+        beforeSend: 'onStartComponentsBeforeSend',
+        success: 'onStartComponentsSuccess',
+        error: 'onStartComponentsError'
+      });
+    }, this);
+  },
 
 
-      success: function (data) {
-        if (jQuery.parseJSON(data)) {
-          self.set('currentRequestId', jQuery.parseJSON(data).Requests.id);
-          self.getLogsByRequest();
-        }
-      },
+  onStartComponentsBeforeSend: function () {
+    this.setTasksStatus(6, 'PENDING');
+  },
 
 
-      error: function () {
-        self.setTasksStatus(6, 'FAILED');
-      },
+  onStartComponentsSuccess: function (data) {
+    if (data) {
+      var requestId = data.Requests.id;
+      this.get('currentRequestId').push(requestId);
+      this.saveClusterStatus(this.get('currentRequestId'), 'PENDING');
+      if ((this.get('isCohosted') && this.get('currentRequestId.length') == 2) || !this.get('isCohosted')) {
+        this.getLogsByRequest();
+      }
+    } else {
+      this.setTasksStatus(6, 'FAILED');
+    }
+  },
 
 
-      statusCode: require('data/statusCodes')
-    });
+  onStartComponentsError: function () {
+    this.setTasksStatus(6, 'FAILED');
   },
   },
 
 
   /**
   /**
@@ -700,94 +740,222 @@ App.WizardStep14Controller = Em.Controller.extend({
     var self = this;
     var self = this;
     var task;
     var task;
     var stopPolling = false;
     var stopPolling = false;
-    var starting = false;
-    var polledData = logs.tasks;
-    var status;
-    if ((this.get('tasks')[5].status != 'COMPLETED' && this.get('tasks')[6].status != 'COMPLETED' && this.get('tasks')[0].status != 'COMPLETED') ||
-        ((this.get('tasks')[5].status == 'COMPLETED') && this.get('tasks')[0].status == 'COMPLETED' && this.get('tasks')[6].status != 'COMPLETED')) {
-      //stopping or starting components
-      if (this.get('tasks')[0].status == 'COMPLETED') {
-        task = 6;
-        starting = true;
+    var polledData = [];
+    logs.forEach(function (item) {
+      polledData = polledData.concat(item.tasks);
+    }, this);
+    if (this.get('tasks')[0].status == 'COMPLETED') {
+      task = this.get('tasks')[5].status == 'COMPLETED' ? 6 : 5;
+    } else {
+      task = 0;
+    }
+    if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
+      if (polledData.someProperty('Tasks.status', 'FAILED')) {
+        this.setTasksStatus(task, 'FAILED');
       } else {
       } else {
-        task = 0;
+        this.setTasksStatus(task, 'COMPLETED');
       }
       }
-      if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
-        if (polledData.someProperty('Tasks.status', 'FAILED')) {
-          this.setTasksStatus(task, 'FAILED');
-          status = 'FAILED'
-        } else {
-          this.setTasksStatus(task, 'COMPLETED');
-          status = 'COMPLETED';
-        }
-        stopPolling = true;
-      } else if (polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
+      stopPolling = true;
+    } else if (polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
+      if (task == 5) {
+        this.get('tasks')[5].set('progress', 50);
+      } else {
         var progress = polledData.filterProperty('Tasks.status', 'COMPLETED').length / polledData.length * 100;
         var progress = polledData.filterProperty('Tasks.status', 'COMPLETED').length / polledData.length * 100;
-        this.setTasksStatus(task, 'IN_PROGRESS');
         this.get('tasks')[task].set('progress', Math.round(progress));
         this.get('tasks')[task].set('progress', Math.round(progress));
       }
       }
-    } else {
-      //installing component
-      status = polledData[0].Tasks.status;
-      this.setTasksStatus(5, status);
-      if (status == 'IN_PROGRESS') {
-        this.get('tasks')[5].set('progress', '50');
-      }
-      if (status == 'COMPLETED' || status == 'FAILED') {
-        stopPolling = true;
-      }
+      this.setTasksStatus(task, 'IN_PROGRESS');
     }
     }
     if (!stopPolling) {
     if (!stopPolling) {
       window.setTimeout(function () {
       window.setTimeout(function () {
         self.getLogsByRequest()
         self.getLogsByRequest()
       }, self.POLL_INTERVAL);
       }, self.POLL_INTERVAL);
-    } else {
-      if (status == 'FAILED') {
-        //todo show retry
-      }
-      if (starting && status == 'COMPLETED') {
-        this.set('isSubmitDisabled', false);
-      }
     }
     }
   },
   },
 
 
   POLL_INTERVAL: 4000,
   POLL_INTERVAL: 4000,
+  dataPollCounter: 1,
 
 
   getLogsByRequest: function () {
   getLogsByRequest: function () {
-    var self = this;
-    var clusterName = this.get('content.cluster.name');
-    var requestId = this.get('currentRequestId');
-    var url = App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/*';
-    $.ajax({
-      type: 'GET',
-      url: url,
-      timeout: App.timeout,
-      dataType: 'text',
-      success: function (data) {
-        self.parseLogs(jQuery.parseJSON(data));
-      },
+    this.set('logs', []);
+    if (App.testMode) {
+      var data = require('data/mock/step14PolledData/tasks_poll' + this.get('dataPollCounter'));
+      this.set('dataPollCounter', this.get('dataPollCounter') + 1);
+      if (this.get('dataPollCounter') == 6) {
+        this.set('dataPollCounter', 1);
+      }
+      this.onGetLogsByRequestSuccess(data);
+    } else {
+      var requestIds = this.get('currentRequestId');
+      requestIds.forEach(function (requestId) {
+        App.ajax.send({
+          name: 'reassign.get_logs',
+          sender: this,
+          data: {
+            requestId: requestId
+          },
+          success: 'onGetLogsByRequestSuccess',
+          error: 'onGetLogsByRequestError'
+        });
+      }, this);
+    }
+  },
 
 
-      error: function () {
-        this.set('status', 'FAILED');
-      },
+  logs: [],
 
 
-      statusCode: require('data/statusCodes')
-    }).retry({times: App.maxRetries, timeout: App.timeout}).then(null,
-        function () {
-          App.showReloadPopup();
-          console.log('Install services all retries FAILED');
-        }
-    );
+  onGetLogsByRequestSuccess: function (data) {
+    this.get('logs').push(data);
+    if (this.get('logs.length') == this.get('currentRequestId.length') || App.testMode) {
+      this.parseLogs(this.get('logs'))
+    }
+  },
+
+  onGetLogsByRequestError: function () {
+    this.set('status', 'FAILED');
   },
   },
 
 
   removeComponent: function () {
   removeComponent: function () {
-    //todo after API providing
+    if (App.testMode) {
+      this.setTasksStatus(7, 'COMPLETED');
+    } else {
+      var hostName = this.get('content.reassign.host_id');
+      var componentNames = [this.get('masterComponent.component_name')];
+      if (this.get('isCohosted')) {
+        componentNames = ['HIVE_SERVER', 'WEBHCAT_SERVER', 'MYSQL_SERVER'];
+        this.set('queueTasksCompleted', 0);
+      }
+      componentNames.forEach(function (componentName) {
+        App.ajax.send({
+          name: 'reassign.remove_component',
+          sender: this,
+          data: {
+            hostName: hostName,
+            componentName: componentName
+          },
+          beforeSend: 'onRemoveComponentBeforeSend',
+          success: 'onRemoveComponentSuccess',
+          error: 'onRemoveComponentError'
+        });
+      }, this);
+    }
+  },
+
+  onRemoveComponentBeforeSend: function () {
+    this.setTasksStatus(7, 'PENDING');
+  },
+
+  onRemoveComponentSuccess: function () {
     this.setTasksStatus(7, 'COMPLETED');
     this.setTasksStatus(7, 'COMPLETED');
   },
   },
 
 
-  submit: function () {
-    if (!this.get('isSubmitDisabled')) {
-      App.router.send('next');
+  onRemoveComponentError: function () {
+    this.setTasksStatus(7, 'FAILED');
+  },
+
+  retry: function () {
+    if (this.get('tasks')[5].status == 'FAILED') {
+      this.installComponent();
+    } else {
+      this.startComponents();
+    }
+    this.set('showRetry', false);
+  },
+
+  abort: function () {
+    var hostName = this.get('content.masterComponentHosts').findProperty('component', this.get('content.reassign.component_name')).hostName;
+    var componentNames = [this.get('masterComponent.component_name')];
+    if (this.get('isCohosted')) {
+      componentNames = ['HIVE_SERVER', 'WEBHCAT_SERVER', 'MYSQL_SERVER'];
+      this.set('queueTasksCompleted', 0);
+    }
+    componentNames.forEach(function (componentName) {
+      App.ajax.send({
+        name: 'reassign.maintenance_mode',
+        sender: this,
+        data: {
+          hostName: hostName,
+          componentName: componentName
+        },
+        success: 'onAbortMaintenance',
+        error: 'onAbortError'
+      });
+    }, this);
+  },
+
+
+  onAbortMaintenance: function () {
+    if (this.get('isCohosted') && this.get('queueTasksCompleted') < 2) {
+      this.set('queueTasksCompleted', this.get('queueTasksCompleted') + 1);
+    } else {
+      var hostName = this.get('content.masterComponentHosts').findProperty('component', this.get('content.reassign.component_name')).hostName;
+      var componentNames = [this.get('masterComponent.component_name')];
+      if (this.get('isCohosted')) {
+        componentNames = ['HIVE_SERVER', 'WEBHCAT_SERVER', 'MYSQL_SERVER'];
+        this.set('queueTasksCompleted', 0);
+      }
+      componentNames.forEach(function (componentName) {
+        App.ajax.send({
+          name: 'reassign.remove_component',
+          sender: this,
+          data: {
+            hostName: hostName,
+            componentName: componentName
+          },
+          success: 'onAbortRemoveComponent',
+          error: 'onAbortError'
+        });
+      }, this);
+    }
+  },
+
+  onAbortRemoveComponent: function () {
+    if (this.get('isCohosted') && this.get('queueTasksCompleted') < 2) {
+      this.set('queueTasksCompleted', this.get('queueTasksCompleted') + 1);
+    } else {
+      var hostName = this.get('content.reassign.host_id');
+      var componentNames = [this.get('masterComponent.component_name')];
+      if (this.get('isCohosted')) {
+        componentNames = ['HIVE_SERVER', 'WEBHCAT_SERVER', 'MYSQL_SERVER'];
+        this.set('queueTasksCompleted', 0);
+      }
+      componentNames.forEach(function (componentName) {
+        App.ajax.send({
+          name: 'reassign.install_component',
+          sender: this,
+          data: {
+            hostName: hostName,
+            componentName: componentName
+          },
+          success: 'onAbortCompleted',
+          error: 'onAbortError'
+        });
+      }, this);
     }
     }
+  },
+
+  onAbortCompleted: function () {
+    if (this.get('isCohosted') && this.get('queueTasksCompleted') < 2) {
+      this.set('queueTasksCompleted', this.get('queueTasksCompleted') + 1);
+    } else {
+      App.clusterStatus.setClusterStatus({
+        clusterName: this.get('content.cluster.name'),
+        clusterState: 'REASSIGN_MASTER_ABORTED',
+        wizardControllerName: this.get('content.controllerName'),
+        localdb: App.db.data
+      });
+      App.router.send('back');
+    }
+  },
+
+  onAbortError: function () {
+    App.ModalPopup.show({
+      header: Em.I18n.translations['common.error'],
+      secondary: false,
+      onPrimary: function () {
+        this.hide();
+      },
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile('<p>{{t installer.step14.abortError}}</p>')
+      })
+    });
   }
   }
 })
 })

+ 52 - 42
ambari-web/app/controllers/wizard/step5_controller.js

@@ -32,6 +32,10 @@ App.WizardStep5Controller = Em.Controller.extend({
     return this.get('content.controllerName') == 'reassignMasterController';
     return this.get('content.controllerName') == 'reassignMasterController';
   }.property(),
   }.property(),
 
 
+  isReassignHive: function () {
+    return this.get('servicesMasters').objectAt(0) && this.get('servicesMasters').objectAt(0).component_name == 'HIVE_SERVER' && this.get('isReassignWizard');
+  }.property('isReassignWizard', 'servicesMasters'),
+
   hosts:[],
   hosts:[],
 
 
   servicesMasters:[],
   servicesMasters:[],
@@ -66,13 +70,13 @@ App.WizardStep5Controller = Em.Controller.extend({
   updateComponent: function(componentName){
   updateComponent: function(componentName){
     var component = this.last(componentName);
     var component = this.last(componentName);
     if (component) {
     if (component) {
-      if (this.get("selectedServicesMasters").filterProperty("component_name", componentName).length < this.get("hosts.length")) {
+      if (this.get("selectedServicesMasters").filterProperty("component_name", componentName).length < this.get("hosts.length") && !this.get('isReassignWizard')) {
         component.set('showAddControl', true);
         component.set('showAddControl', true);
       } else {
       } else {
         component.set('showRemoveControl', false);
         component.set('showRemoveControl', false);
       }
       }
-      if(componentName == 'ZOOKEEPER_SERVER'){
-        this.rebalanceZookeeperHosts();
+      if(componentName == 'ZOOKEEPER_SERVER' || componentName == 'HBASE_MASTER'){
+        this.rebalanceComponentHosts(componentName);
       }
       }
     }
     }
   },
   },
@@ -161,7 +165,7 @@ App.WizardStep5Controller = Em.Controller.extend({
           componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.HostComponent.find().someProperty('componentName', _componentInfo.component_name);
           componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.HostComponent.find().someProperty('componentName', _componentInfo.component_name);
           componentObj.serviceId = services[index];
           componentObj.serviceId = services[index];
           componentObj.availableHosts = [];
           componentObj.availableHosts = [];
-          componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name);
+          componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name) && !this.get('isReassignWizard');
           resultComponents.push(componentObj);
           resultComponents.push(componentObj);
         }
         }
       }, this);
       }, this);
@@ -175,8 +179,11 @@ App.WizardStep5Controller = Em.Controller.extend({
    * @param masterComponents
    * @param masterComponents
    */
    */
   renderComponents:function (masterComponents) {
   renderComponents:function (masterComponents) {
-    var countZookeeper = masterComponents.filterProperty('display_name', 'ZooKeeper').length;
-    var countHbaseMaster = masterComponents.filterProperty('component_name', 'HBASE_MASTER').length;
+    var services = this.get('content.services')
+      .filterProperty('isInstalled', true).mapProperty('serviceName'); //list of shown services
+
+    var showRemoveControlZk = !services.contains('ZOOKEEPER') && masterComponents.filterProperty('display_name', 'ZooKeeper').length > 1;
+    var showRemoveControlHb = !services.contains('HBASE') && masterComponents.filterProperty('component_name', 'HBASE_MASTER').length > 1;
     var zid = 1;
     var zid = 1;
     var hid = 1;
     var hid = 1;
     var result = [];
     var result = [];
@@ -188,10 +195,10 @@ App.WizardStep5Controller = Em.Controller.extend({
 
 
       if (item.display_name === "ZooKeeper") {
       if (item.display_name === "ZooKeeper") {
         componentObj.set('zId', zid++);
         componentObj.set('zId', zid++);
-        componentObj.set("showRemoveControl", countZookeeper > 1);
+        componentObj.set("showRemoveControl", showRemoveControlZk);
       } else if(item.component_name === "HBASE_MASTER"){
       } else if(item.component_name === "HBASE_MASTER"){
         componentObj.set('zId', hid++);
         componentObj.set('zId', hid++);
-        componentObj.set("showRemoveControl", countHbaseMaster > 1);
+        componentObj.set("showRemoveControl", showRemoveControlHb);
       }
       }
       componentObj.set("availableHosts", this.get("hosts"));
       componentObj.set("availableHosts", this.get("hosts"));
       result.push(componentObj);
       result.push(componentObj);
@@ -199,15 +206,16 @@ App.WizardStep5Controller = Em.Controller.extend({
 
 
     this.set("selectedServicesMasters", result);
     this.set("selectedServicesMasters", result);
     if (this.get('isReassignWizard')) {
     if (this.get('isReassignWizard')) {
-      var component = result.findProperty('component_name', this.get('content.reassign.component_name')).set('isInstalled', false);
-      this.set('servicesMasters', [component]);
+      var components = result.filterProperty('component_name', this.get('content.reassign.component_name'));
+      components.setEach('isInstalled', false);
+      this.set('servicesMasters', components);
     } else {
     } else {
       this.set('servicesMasters', result);
       this.set('servicesMasters', result);
     }
     }
   },
   },
 
 
   hasHiveServer: function () {
   hasHiveServer: function () {
-    return !!this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_SERVER');
+    return !!this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_SERVER') && !this.get('isReassignWizard');
   }.property('selectedServicesMasters'),
   }.property('selectedServicesMasters'),
 
 
   updateHiveCoHosts: function () {
   updateHiveCoHosts: function () {
@@ -215,7 +223,9 @@ App.WizardStep5Controller = Em.Controller.extend({
     var hiveMetastore = this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE');
     var hiveMetastore = this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE');
     var webHCatServer = this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER');
     var webHCatServer = this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER');
     if (hiveServer && hiveMetastore && webHCatServer) {
     if (hiveServer && hiveMetastore && webHCatServer) {
-      this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE').set('selectedHost', hiveServer.get('selectedHost'));
+      if (!this.get('isReassignHive') && this.get('servicesMasters').objectAt(0) && !this.get('servicesMasters').objectAt(0).component_name == 'HIVE_METASTORE') {
+        this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE').set('selectedHost', hiveServer.get('selectedHost'))
+      }
       this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER').set('selectedHost', hiveServer.get('selectedHost'));
       this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER').set('selectedHost', hiveServer.get('selectedHost'));
     }
     }
   }.observes('selectedServicesMasters.@each.selectedHost'),
   }.observes('selectedServicesMasters.@each.selectedHost'),
@@ -294,7 +304,7 @@ App.WizardStep5Controller = Em.Controller.extend({
     }
     }
   },
   },
 
 
-  getOozieServer:function (noOfHosts) {
+  getHiveServer:function (noOfHosts) {
     var hosts = this.get('hosts');
     var hosts = this.get('hosts');
     if (noOfHosts === 1) {
     if (noOfHosts === 1) {
       return hosts[0];
       return hosts[0];
@@ -305,22 +315,23 @@ App.WizardStep5Controller = Em.Controller.extend({
     } else if (noOfHosts <= 30) {
     } else if (noOfHosts <= 30) {
       return hosts[2];
       return hosts[2];
     } else {
     } else {
-      return hosts[3];
+      return hosts[4];
     }
     }
   },
   },
 
 
-  getHiveServer:function (noOfHosts) {
+  getHueServer:function (noOfHosts) {
     var hosts = this.get('hosts');
     var hosts = this.get('hosts');
-    if (noOfHosts === 1) {
-      return hosts[0];
-    } else if (noOfHosts < 3) {
-      return hosts[1];
-    } else if (noOfHosts <= 5) {
-      return hosts[1];
-    } else if (noOfHosts <= 30) {
-      return hosts[2];
+    var hostnames = [];
+    var inc = 0;
+    hosts.forEach(function (_hostname) {
+      hostnames[inc] = _hostname.host_name;
+      inc++;
+    });
+    var hostExcAmbari = hostnames.without(location.hostname);
+    if (noOfHosts > 1) {
+      return hostExcAmbari[0];
     } else {
     } else {
-      return hosts[4];
+      return hostnames[0];
     }
     }
   },
   },
 
 
@@ -406,6 +417,8 @@ App.WizardStep5Controller = Em.Controller.extend({
         return this.getGangliaServer(noOfHosts);
         return this.getGangliaServer(noOfHosts);
       case 'NAGIOS_SERVER':
       case 'NAGIOS_SERVER':
         return this.getNagiosServer(noOfHosts);
         return this.getNagiosServer(noOfHosts);
+      case 'HUE_SERVER':
+        return this.getHueServer(noOfHosts);
     }
     }
   },
   },
 
 
@@ -456,11 +469,9 @@ App.WizardStep5Controller = Em.Controller.extend({
    */
    */
   assignHostToMaster:function (componentName, selectedHost, zId) {
   assignHostToMaster:function (componentName, selectedHost, zId) {
     if (selectedHost && componentName) {
     if (selectedHost && componentName) {
-      if ((componentName === "ZOOKEEPER_SERVER") && zId) {
-        this.get('selectedServicesMasters').filterProperty('component_name', componentName).findProperty("zId", zId).set("selectedHost", selectedHost);
-        this.rebalanceZookeeperHosts();
-      } else if(zId){ //Hbase
+      if (zId) {
         this.get('selectedServicesMasters').filterProperty('component_name', componentName).findProperty("zId", zId).set("selectedHost", selectedHost);
         this.get('selectedServicesMasters').filterProperty('component_name', componentName).findProperty("zId", zId).set("selectedHost", selectedHost);
+        this.rebalanceComponentHosts(componentName);
       } else {
       } else {
         this.get('selectedServicesMasters').findProperty("component_name", componentName).set("selectedHost", selectedHost);
         this.get('selectedServicesMasters').findProperty("component_name", componentName).set("selectedHost", selectedHost);
       }
       }
@@ -537,8 +548,8 @@ App.WizardStep5Controller = Em.Controller.extend({
 
 
       this.get("selectedServicesMasters").insertAt(this.get("selectedServicesMasters").indexOf(lastZoo) + 1, newZookeeper);
       this.get("selectedServicesMasters").insertAt(this.get("selectedServicesMasters").indexOf(lastZoo) + 1, newZookeeper);
 
 
-      if(componentName == 'ZOOKEEPER_SERVER'){
-        this.rebalanceZookeeperHosts();
+      if(componentName == 'ZOOKEEPER_SERVER' || componentName == 'HBASE_MASTER'){
+        this.rebalanceComponentHosts(componentName);
       }
       }
 
 
       return true;
       return true;
@@ -571,8 +582,8 @@ App.WizardStep5Controller = Em.Controller.extend({
       if (currentZooKeepers.get("length") === 1) {
       if (currentZooKeepers.get("length") === 1) {
         currentZooKeepers.set("lastObject.showRemoveControl", false);
         currentZooKeepers.set("lastObject.showRemoveControl", false);
       }
       }
-      if(componentName == 'ZOOKEEPER_SERVER'){
-        this.rebalanceZookeeperHosts();
+      if(componentName == 'ZOOKEEPER_SERVER' || componentName == 'HBASE_MASTER'){
+        this.rebalanceComponentHosts(componentName);
       }
       }
 
 
       return true;
       return true;
@@ -582,23 +593,22 @@ App.WizardStep5Controller = Em.Controller.extend({
 
 
   },
   },
 
 
-  rebalanceZookeeperHosts:function () {
-    //for a zookeeper update the available hosts for the other zookeepers
-
-    var currentZooKeepers = this.get("selectedServicesMasters").filterProperty("display_name", "ZooKeeper"),
-      zooHosts = currentZooKeepers.mapProperty("selectedHost"),
-      availableZooHosts = [],
+  rebalanceComponentHosts:function (componentName) {
+    //for a zookeeper and hbase update the available hosts for the other zookeepers and hbases
+    var currentComponents = this.get("selectedServicesMasters").filterProperty("component_name", componentName),
+      componentHosts = currentComponents.mapProperty("selectedHost"),
+      availableComponentHosts = [],
       preparedAvailableHosts = null;
       preparedAvailableHosts = null;
 
 
     //get all hosts available for zookeepers
     //get all hosts available for zookeepers
     this.get("hosts").forEach(function (item) {
     this.get("hosts").forEach(function (item) {
-      if (!zooHosts.contains(item.get("host_name"))) {
-        availableZooHosts.pushObject(item);
+      if (!componentHosts.contains(item.get("host_name"))) {
+        availableComponentHosts.pushObject(item);
       }
       }
     }, this);
     }, this);
 
 
-    currentZooKeepers.forEach(function (item) {
-      preparedAvailableHosts = availableZooHosts.slice(0);
+    currentComponents.forEach(function (item) {
+      preparedAvailableHosts = availableComponentHosts.slice(0);
       preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("selectedHost")))
       preparedAvailableHosts.pushObject(this.get("hosts").findProperty("host_name", item.get("selectedHost")))
       preparedAvailableHosts.sort(this.sortHostsByConfig, this);
       preparedAvailableHosts.sort(this.sortHostsByConfig, this);
       item.set("availableHosts", preparedAvailableHosts);
       item.set("availableHosts", preparedAvailableHosts);

+ 11 - 1
ambari-web/app/controllers/wizard/step6_controller.js

@@ -49,6 +49,10 @@ App.WizardStep6Controller = Em.Controller.extend({
     return this.get('content.controllerName') === 'addHostController';
     return this.get('content.controllerName') === 'addHostController';
   }.property('content.controllerName'),
   }.property('content.controllerName'),
 
 
+  isInstallerWizard: function(){
+    return this.get('content.controllerName') === 'installerController';
+  }.property('content.controllerName'),
+
   clearError: function () {
   clearError: function () {
     var self = this;
     var self = this;
     var isError = false;
     var isError = false;
@@ -310,6 +314,7 @@ App.WizardStep6Controller = Em.Controller.extend({
         host.isMaster = self.hasMasterComponents(host.hostName);
         host.isMaster = self.hasMasterComponents(host.hostName);
         var checkboxes = host.get('checkboxes');
         var checkboxes = host.get('checkboxes');
         checkboxes.setEach('checked', !host.isMaster);
         checkboxes.setEach('checked', !host.isMaster);
+        checkboxes.setEach('isInstalled', false);
         checkboxes.findProperty('title', headers.findProperty('name', 'CLIENT').get('label')).set('checked', false);
         checkboxes.findProperty('title', headers.findProperty('name', 'CLIENT').get('label')).set('checked', false);
         // First not Master should have Client (only first!)
         // First not Master should have Client (only first!)
         if (!client_is_set) {
         if (!client_is_set) {
@@ -320,6 +325,11 @@ App.WizardStep6Controller = Em.Controller.extend({
           }
           }
         }
         }
       });
       });
+
+      if(this.get('isInstallerWizard') && hostsObj.everyProperty('isMaster', true)){
+        var lastHost = hostsObj[hostsObj.length - 1];
+        lastHost.get('checkboxes').setEach('checked', true);
+      }
     }
     }
     else {
     else {
       this.get('headers').forEach(function(header) {
       this.get('headers').forEach(function(header) {
@@ -329,7 +339,7 @@ App.WizardStep6Controller = Em.Controller.extend({
             var node = hostsObj.findProperty('hostName', _node.hostName);
             var node = hostsObj.findProperty('hostName', _node.hostName);
             if (node) {
             if (node) {
               node.get('checkboxes').findProperty('title', header.get('label')).set('checked', true);
               node.get('checkboxes').findProperty('title', header.get('label')).set('checked', true);
-              node.get('checkboxes').findProperty('title', header.get('label')).set('installed', _node.isInstalled);
+              node.get('checkboxes').findProperty('title', header.get('label')).set('isInstalled', _node.isInstalled);
             }
             }
           });
           });
         }
         }

+ 18 - 208
ambari-web/app/controllers/wizard/step7_controller.js

@@ -58,9 +58,6 @@ App.WizardStep7Controller = Em.Controller.extend({
     return this.get('content.slaveGroupProperties');
     return this.get('content.slaveGroupProperties');
   }.property('content.slaveGroupProperties', 'content.slaveComponentHosts'),
   }.property('content.slaveGroupProperties', 'content.slaveComponentHosts'),
 
 
-  serviceConfigs: require('data/service_configs'),
-  configMapping: require('data/config_mapping'),
-  customConfigs: require('data/custom_configs'),
   customData: [],
   customData: [],
 
 
   clearStep: function () {
   clearStep: function () {
@@ -73,193 +70,26 @@ App.WizardStep7Controller = Em.Controller.extend({
   loadStep: function () {
   loadStep: function () {
     console.log("TRACE: Loading step7: Configure Services");
     console.log("TRACE: Loading step7: Configure Services");
     this.clearStep();
     this.clearStep();
-    var serviceConfigs = this.get('serviceConfigs');
-    var advancedConfig = this.get('content.advancedServiceConfig') || [];
-    this.loadAdvancedConfig(serviceConfigs, advancedConfig);
-    this.loadCustomConfig();
-    this.renderServiceConfigs(serviceConfigs);
-    var storedServices = this.get('content.serviceConfigProperties');
-    if (storedServices) {
-      var configs = new Ember.Set();
-
-      // for all services`
-      this.get('stepConfigs').forEach(function (_content) {
-        //for all components
-        
-        // Update existing values
-        var seenStoredConfigs = {};
-        _content.get('configs').forEach(function (_config) {
-          var componentVal = storedServices.findProperty('name', _config.get('name'));
-          //if we have config for specified component
-          if (componentVal) {
-            //set it
-            seenStoredConfigs[componentVal.name] = 'true';
-            _config.set('value', componentVal.value)
-            this.updateHostOverrides(_config, componentVal);
-          }
-        }, this);
-        
-        // Create new values
-        var currentServiceStoredConfigs = storedServices.filterProperty('service', _content.serviceName);
-        currentServiceStoredConfigs.forEach(function (storedConfig) {
-          if(!(storedConfig.name in seenStoredConfigs)){
-            console.log("loadStep7(): New property from local storage: ", storedConfig);
-            // Determine category
-            var configCategory = 'Advanced';
-            var serviceConfigMetaData = serviceConfigs.findProperty('serviceName', _content.serviceName);
-            var categoryMetaData = serviceConfigMetaData == null ? null : serviceConfigMetaData.configCategories.findProperty('siteFileName', storedConfig.filename);
-            if (categoryMetaData != null) {
-              configCategory = categoryMetaData.get('name');
-            }
-            // Configuration data
-            var configData = {
-                id: storedConfig.id,
-                name: storedConfig.name,
-                displayName: storedConfig.name,
-                serviceName: _content.serviceName,
-                value: storedConfig.value,
-                defaultValue: storedConfig.defaultValue,
-                displayType: "advanced",
-                filename: storedConfig.filename,
-                category: configCategory,
-                isUserProperty: true
-            }
-            var serviceConfigProperty = App.ServiceConfigProperty.create(configData);
-            serviceConfigProperty.serviceConfig = _content;
-            serviceConfigProperty.initialValue();
-            this.updateHostOverrides(serviceConfigProperty, storedConfig);
-            _content.configs.pushObject(serviceConfigProperty);
-            serviceConfigProperty.validate();
-          }
-        }, this);
-      }, this);
-    }
-  },
-  
-  updateHostOverrides: function (configProperty, storedConfigProperty) {
-    if(storedConfigProperty.overrides!=null && storedConfigProperty.overrides.length>0){
-      var overrides = configProperty.get('overrides');
-      if (!overrides) {
-        overrides = []; 
-        configProperty.set('overrides', overrides);
-      }
-      storedConfigProperty.overrides.forEach(function(overrideEntry){
-        // create new override with new value
-        var newSCP = App.ServiceConfigProperty.create(configProperty);
-        newSCP.set('value', overrideEntry.value);
-        newSCP.set('isOriginalSCP', false); // indicated this is overridden value,
-        newSCP.set('parentSCP', configProperty);
-        var hostsArray = Ember.A([]);
-        overrideEntry.hosts.forEach(function(host){
-          hostsArray.push(host);
-        });
-        newSCP.set('selectedHostOptions', hostsArray);
-        overrides.pushObject(newSCP);
-      });
-    }
-  },
-
-  /*
-   Loads the advanced configs fetched from the server metadata libarary
-   */
-
-  loadAdvancedConfig: function (serviceConfigs, advancedConfig) {
-    advancedConfig.forEach(function (_config) {
-      if (_config) {
-        var service = serviceConfigs.findProperty('serviceName', _config.serviceName);
-        if (service) {
-          if (this.get('configMapping').someProperty('name', _config.name)) {
-          } else if (!(service.configs.someProperty('name', _config.name))) {
-            _config.id = "site property";
-            _config.category = 'Advanced';
-            var serviceConfigMetaData = this.get('serviceConfigs').findProperty('serviceName', this.get('content.serviceName'));
-            var categoryMetaData = serviceConfigMetaData == null ? null : serviceConfigMetaData.configCategories.findProperty('siteFileName', serviceConfigObj.filename);
-            if (categoryMetaData != null) {
-              _config.category = categoryMetaData.get('name');
-            }
-            _config.displayName = _config.name;
-            _config.defaultValue = _config.value;
-            // make all advanced configs optional and populated by default
-            /*
-             * if (/\${.*}/.test(_config.value) || (service.serviceName !==
-             * 'OOZIE' && service.serviceName !== 'HBASE')) { _config.isRequired =
-             * false; _config.value = ''; } else if
-             * (/^\s+$/.test(_config.value)) { _config.isRequired = false; }
-             */
-            _config.isRequired = false;
-            _config.isVisible = true;
-            _config.displayType = 'advanced';
-            service.configs.pushObject(_config);
-          }
-        }
-      }
-    }, this);
-  },
-
-
-  /**
-   * Render a custom conf-site box for entering properties that will be written in *-site.xml files of the services
-   */
-  loadCustomConfig: function () {
-    var serviceConfigs = this.get('serviceConfigs');
-    this.get('customConfigs').forEach(function (_config) {
-      var service = serviceConfigs.findProperty('serviceName', _config.serviceName);
-      if (service) {
-        if (!(service.configs.someProperty('name', _config.name))) {
-          if( Object.prototype.toString.call( _config.defaultValue ) === '[object Array]' ) {
-            this.loadDefaultCustomConfig(_config);
-          }
-          service.configs.pushObject(_config);
-        }
-      }
-    }, this);
-  },
-
-  loadDefaultCustomConfig: function (customConfig) {
-    var customValue = '';
-    var length = customConfig.defaultValue.length;
-    customConfig.defaultValue.forEach(function (_config, index) {
-      customValue += _config.name + '=' + _config.value;
-      if (index !== length - 1) {
-        customValue += '\n';
-      }
-    }, this);
-    customConfig.value = customValue;
+    //STEP 1: Load advanced configs
+    var advancedConfigs = this.get('content.advancedServiceConfig');
+    //STEP 2: Load on-site configs by service from local DB
+    var storedConfigs = this.get('content.serviceConfigProperties');
+    //STEP 3: Merge pre-defined configs with loaded on-site configs
+    var configs = App.config.mergePreDefinedWithStored(storedConfigs);
+    //STEP 4: Add advanced configs
+    App.config.addAdvancedConfigs(configs, advancedConfigs);
+    //STEP 5: Add custom configs
+    App.config.addCustomConfigs(configs);
+    //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty (configs -> serviceConfigs)
+    var serviceConfigs = App.config.renderConfigs(configs, this.get('allInstalledServiceNames'), this.get('selectedServiceNames'));
+    this.set('stepConfigs', serviceConfigs);
+    this.activateSpecialConfigs();
+    this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
   },
   },
-
-  /**
-   * Render configs for active services
-   * @param serviceConfigs
+   /**
+   * make some configs visible depending on active services
    */
    */
-  renderServiceConfigs: function (serviceConfigs) {
-    serviceConfigs.forEach(function (_serviceConfig) {
-
-      var serviceConfig = App.ServiceConfig.create({
-        filename: _serviceConfig.filename,
-        serviceName: _serviceConfig.serviceName,
-        displayName: _serviceConfig.displayName,
-        configCategories: _serviceConfig.configCategories,
-        showConfig: false,
-        configs: []
-      });
-
-      if (this.get('allInstalledServiceNames').contains(serviceConfig.serviceName) || serviceConfig.serviceName === 'MISC') {
-
-        this.loadComponentConfigs(_serviceConfig, serviceConfig);
-
-        console.log('pushing ' + serviceConfig.serviceName, serviceConfig);
-
-        if (this.get('selectedServiceNames').contains(serviceConfig.serviceName) || serviceConfig.serviceName === 'MISC') {
-          serviceConfig.showConfig = true;
-        }
-
-        this.get('stepConfigs').pushObject(serviceConfig);
-
-      } else {
-        console.log('skipping ' + serviceConfig.serviceName);
-      }
-    }, this);
-
+  activateSpecialConfigs: function () {
     var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
     var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
     var showProxyGroup = this.get('selectedServiceNames').contains('HIVE') ||
     var showProxyGroup = this.get('selectedServiceNames').contains('HIVE') ||
       this.get('selectedServiceNames').contains('HCATALOG') ||
       this.get('selectedServiceNames').contains('HCATALOG') ||
@@ -271,27 +101,7 @@ App.WizardStep7Controller = Em.Controller.extend({
     miscConfigs.findProperty('name', 'hcat_user').set('isVisible', this.get('selectedServiceNames').contains('HCATALOG'));
     miscConfigs.findProperty('name', 'hcat_user').set('isVisible', this.get('selectedServiceNames').contains('HCATALOG'));
     miscConfigs.findProperty('name', 'webhcat_user').set('isVisible', this.get('selectedServiceNames').contains('WEBHCAT'));
     miscConfigs.findProperty('name', 'webhcat_user').set('isVisible', this.get('selectedServiceNames').contains('WEBHCAT'));
     miscConfigs.findProperty('name', 'oozie_user').set('isVisible', this.get('selectedServiceNames').contains('OOZIE'));
     miscConfigs.findProperty('name', 'oozie_user').set('isVisible', this.get('selectedServiceNames').contains('OOZIE'));
-    miscConfigs.findProperty('name', 'pig_user').set('isVisible', this.get('selectedServiceNames').contains('PIG'));
-    miscConfigs.findProperty('name', 'sqoop_user').set('isVisible', this.get('selectedServiceNames').contains('SQOOP'));
     miscConfigs.findProperty('name', 'zk_user').set('isVisible', this.get('selectedServiceNames').contains('ZOOKEEPER'));
     miscConfigs.findProperty('name', 'zk_user').set('isVisible', this.get('selectedServiceNames').contains('ZOOKEEPER'));
-    miscConfigs.findProperty('name', 'rrdcached_base_dir').set('isVisible', this.get('selectedServiceNames').contains('GANGLIA'));
-
-    this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
-  },
-
-  /**
-   * Load child components to service config object
-   * @param _componentConfig
-   * @param componentConfig
-   */
-  loadComponentConfigs: function (_componentConfig, componentConfig) {
-    _componentConfig.configs.forEach(function (_serviceConfigProperty) {
-      var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
-      serviceConfigProperty.serviceConfig = componentConfig;
-      serviceConfigProperty.initialValue();
-      componentConfig.configs.pushObject(serviceConfigProperty);
-      serviceConfigProperty.validate();
-    }, this);
   },
   },
 
 
   /**
   /**

+ 257 - 172
ambari-web/app/controllers/wizard/step8_controller.js

@@ -27,11 +27,32 @@ App.WizardStep8Controller = Em.Controller.extend({
   configs: [],
   configs: [],
   globals: [],
   globals: [],
   ajaxQueue: [],
   ajaxQueue: [],
-  configMapping: require('data/config_mapping'),
+  configMapping: require('data/config_mapping').all(),
   slaveComponentConfig: null,
   slaveComponentConfig: null,
   isSubmitDisabled: false,
   isSubmitDisabled: false,
   hasErrorOccurred: false,
   hasErrorOccurred: false,
   servicesInstalled: false,
   servicesInstalled: false,
+  /**
+   * During page save time, we set the host overrides to the server.
+   * The new host -> site:tag map is stored below. This will be 
+   * useful during save, to update the host's host components. Also,
+   * it will be useful in deletion of overrides.
+   * 
+   * Example:
+   * {
+   *  'hostname1': {
+   *    'global': {
+   *      'tagName': 'tag3187261938_hostname1',
+   *      'map': {
+   *        'hadoop_heapsize': '2048m'
+   *      }
+   *    }
+   *  }
+   * }
+   * 
+   * @see loadedHostToOverrideSiteToTagMap
+   */
+  savedHostToOverrideSiteToTagMap: {},
 
 
   selectedServices: function () {
   selectedServices: function () {
     return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
     return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
@@ -50,8 +71,6 @@ App.WizardStep8Controller = Em.Controller.extend({
     this.clearStep();
     this.clearStep();
     this.loadGlobals();
     this.loadGlobals();
     this.loadConfigs();
     this.loadConfigs();
-    this.setCustomConfigs();
-    //this.loadSlaveConfiguration();
     this.loadClusterInfo();
     this.loadClusterInfo();
     this.loadServices();
     this.loadServices();
     this.set('isSubmitDisabled', false);
     this.set('isSubmitDisabled', false);
@@ -60,14 +79,15 @@ App.WizardStep8Controller = Em.Controller.extend({
   loadGlobals: function () {
   loadGlobals: function () {
     var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
     var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
     if (globals.someProperty('name', 'hive_database')) {
     if (globals.someProperty('name', 'hive_database')) {
-      //TODO: Hive host depends on the type of db selected. Change puppet variable name if postgres is not the default db
       var hiveDb = globals.findProperty('name', 'hive_database');
       var hiveDb = globals.findProperty('name', 'hive_database');
-      var hiveDbType = {name: 'hive_database_type'};
+      var hiveDbType = {name: 'hive_database_type', value: 'mysql'};
+      var hiveJdbcDriver = {name: 'hive_jdbc_driver'};
 
 
       if (hiveDb.value === 'New MySQL Database') {
       if (hiveDb.value === 'New MySQL Database') {
         if (globals.someProperty('name', 'hive_ambari_host')) {
         if (globals.someProperty('name', 'hive_ambari_host')) {
           globals.findProperty('name', 'hive_ambari_host').name = 'hive_hostname';
           globals.findProperty('name', 'hive_ambari_host').name = 'hive_hostname';
           hiveDbType.value = 'mysql';
           hiveDbType.value = 'mysql';
+          hiveJdbcDriver.value = 'com.mysql.jdbc.Driver';
         }
         }
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
@@ -76,6 +96,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       } else if (hiveDb.value === 'Existing MySQL Database'){
       } else if (hiveDb.value === 'Existing MySQL Database'){
         globals.findProperty('name', 'hive_existing_mysql_host').name = 'hive_hostname';
         globals.findProperty('name', 'hive_existing_mysql_host').name = 'hive_hostname';
         hiveDbType.value = 'mysql';
         hiveDbType.value = 'mysql';
+        hiveJdbcDriver.value = 'com.mysql.jdbc.Driver';
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_oracle_host'));
@@ -83,12 +104,69 @@ App.WizardStep8Controller = Em.Controller.extend({
       } else{ //existing oracle database
       } else{ //existing oracle database
         globals.findProperty('name', 'hive_existing_oracle_host').name = 'hive_hostname';
         globals.findProperty('name', 'hive_existing_oracle_host').name = 'hive_hostname';
         hiveDbType.value = 'oracle';
         hiveDbType.value = 'oracle';
+        hiveJdbcDriver.value = 'oracle.jdbc.driver.OracleDriver';
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_host'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_ambari_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_host'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
         globals = globals.without(globals.findProperty('name', 'hive_existing_mysql_database'));
       }
       }
       globals.push(hiveDbType);
       globals.push(hiveDbType);
+      globals.push(hiveJdbcDriver);
+    }
+
+    if (globals.someProperty('name', 'oozie_database')) {
+      var oozieDb = globals.findProperty('name', 'oozie_database');
+      var oozieDbType = {name:'oozie_database_type'};
+      var oozieJdbcDriver = {name: 'oozie_jdbc_driver'};
+      var oozieJPAServcieURL = {name: 'oozie_JPAService_url'};
+
+      if (oozieDb.value === 'Current Derby Database'){
+        oozieDbType.value = 'derby';
+        oozieJdbcDriver.value = 'org.apache.derby.jdbc.EmbeddedDriver';
+        oozieJPAServcieURL.value = '${oozie.data.dir}/${oozie.db.schema.name}-db;create=true';  ///////
+
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+      }else if (oozieDb.value === 'New MySQL Database') {
+        if (globals.someProperty('name', 'oozie_ambari_host')) {
+          globals.findProperty('name', 'oozie_ambari_host').name = 'oozie_hostname';
+          oozieDbType.value = 'mysql';
+          oozieJdbcDriver.value = 'com.mysql.jdbc.Driver';
+          oozieJPAServcieURL.value = '//'+ globals.findProperty('name','oozie_hostname').value +'/' + globals.findProperty('name','oozie_database_name').value +'?createDatabaseIfNotExist=true';
+        }
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+      } else if (oozieDb.value === 'Existing MySQL Database'){
+        globals.findProperty('name', 'oozie_existing_mysql_host').name = 'oozie_hostname';
+        oozieDbType.value = 'mysql';
+        oozieJdbcDriver.value = 'com.mysql.jdbc.Driver';
+        oozieJPAServcieURL.value = '//'+ globals.findProperty('name','oozie_hostname').value +'/' + globals.findProperty('name','oozie_database_name').value +'?createDatabaseIfNotExist=true';
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_oracle_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+      } else{ //existing oracle database
+        globals.findProperty('name', 'oozie_existing_oracle_host').name = 'oozie_hostname';
+        oozieDbType.value = 'oracle';
+        oozieJdbcDriver.value = 'oracle.jdbc.driver.OracleDriver';
+        oozieJPAServcieURL.value = '//'+ globals.findProperty('name','oozie_hostname').value +'/'+ globals.findProperty('name','oozie_database_name').value +'?createDatabaseIfNotExist=true';
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_ambari_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_host'));
+        globals = globals.without(globals.findProperty('name', 'oozie_existing_mysql_database'));
+        globals = globals.without(globals.findProperty('name', 'oozie_derby_database'));
+      }
+      globals.push(oozieDbType);
+      globals.push(oozieJdbcDriver);
+      globals.push(oozieJPAServcieURL);
     }
     }
 
 
     this.set('globals', globals);
     this.set('globals', globals);
@@ -97,7 +175,8 @@ App.WizardStep8Controller = Em.Controller.extend({
   loadConfigs: function () {
   loadConfigs: function () {
     var storedConfigs = this.get('content.serviceConfigProperties').filterProperty('id', 'site property').filterProperty('value');
     var storedConfigs = this.get('content.serviceConfigProperties').filterProperty('id', 'site property').filterProperty('value');
     var uiConfigs = this.loadUiSideConfigs();
     var uiConfigs = this.loadUiSideConfigs();
-    this.set('configs', storedConfigs.concat(uiConfigs));
+    var customConfigs = this.loadCustomConfigs();
+    this.set('configs', storedConfigs.concat(uiConfigs, customConfigs));
   },
   },
 
 
   loadUiSideConfigs: function () {
   loadUiSideConfigs: function () {
@@ -242,106 +321,20 @@ App.WizardStep8Controller = Em.Controller.extend({
 
 
 
 
   /**
   /**
-   * override site properties with the entered key-value pair in *-site.xml
+   * load custom configs
    */
    */
-  setCustomConfigs: function () {
-    var site = this.get('content.serviceConfigProperties').filterProperty('id', 'conf-site');
-    site.forEach(function (_site) {
-      var keyValue = _site.value.split(/\n+/);
-      if (keyValue) {
-        keyValue.forEach(function (_keyValue) {
-          _keyValue = _keyValue.trim();
-          console.log("The value of the keyValue is: " + _keyValue);
-          // split on the first = encountered (the value may contain ='s)
-          var matches = _keyValue.match(/^([^=]+)=(.*)$/);
-          if (matches) {
-            var key = matches[1];
-            var value = matches[2];
-            if (key) {
-              this.setSiteProperty(key, value, _site.name + '.xml');
-            }
-          }
-        }, this);
-      }
-    }, this);
-  },
-
-  /**
-   * Set property of the site variable
-   */
-  setSiteProperty: function (key, value, filename) {
-    this.get('configs').pushObject({
-      "id": "site property",
-      "name": key,
-      "value": value,
-      "filename": filename
-    });
-  },
-
-  loadSlaveConfiguration: function () {
-
-    var slaveComponentConfig = this.convertSlaveConfig(this.get('content.slaveGroupProperties'));
-    this.set("slaveComponentConfig", slaveComponentConfig);
-  },
-
-  convertSlaveConfig: function (slaveContent) {
-    var dest = {
-      "version": "1.0",
-      "components": [
-      ],
-      "slaveHostComponents": []
-    };
-
-    slaveContent.forEach(function (_slaveContent) {
-      var newComponent = {};
-      newComponent.componentName = _slaveContent.componentName;
-      newComponent.serviceName = this.getServiceInfo(newComponent.componentName).name;
-      newComponent.groups = [];
-      var index = 2;
-      if (_slaveContent.groups) {
-        _slaveContent.groups.forEach(function (_group) {
-          var newGroup = {};
-          newGroup.groupName = _group.name;
-          newGroup.configVersion = {config: {'global': 'version1', 'core-site': 'version1'}}; // TODO : every time a new version should be generated
-          if (this.getServiceInfo(_slaveContent.componentName)) {
-            newGroup.configVersion.config[this.getServiceInfo(_slaveContent.componentName).domain] = 'version' + index;
-            newGroup.configVersion.config[this.getServiceInfo(_slaveContent.componentName).siteName] = 'version' + index;
-          }
-          newGroup.siteVersion = 'version' + index;
-          newGroup.hostNames = _slaveContent.hosts.filterProperty("group", newGroup.groupName).mapProperty('hostName');
-          newGroup.properties = _group.properties;
-          if (!Ember.empty(newGroup.hostNames)) {
-            newComponent.groups.push(newGroup);
-          }
-          index++;
-        }, this);
-      }
-      dest.components.push(newComponent);
+  loadCustomConfigs: function () {
+    var configs = this.get('content.serviceConfigProperties').filterProperty('id', 'conf-site');
+    var customConfigs = [];
+    configs.forEach(function (_config) {
+      customConfigs.pushObject({
+        "id": "site property",
+        "name": _config.name,
+        "value": _config.value,
+        "filename": _config.filename
+      });
     }, this);
     }, this);
-    var hostsInfo = this.get('content.hosts');
-
-    for (var index in hostsInfo) {
-      var hostIndex = 2;
-      var slaveHost = {name: null, configVersion: null, slaveComponents: []};
-      dest.components.forEach(function (_component) {
-        _component.groups.forEach(function (_group) {
-          if (_group.hostNames.contains(hostsInfo[index].name)) {
-            var slaveComponent = {};
-            slaveHost.name = hostsInfo[index].name;
-            slaveComponent.componentName = _component.componentName;
-            slaveComponent.groupName = _group.groupName;
-            slaveComponent.properties = _group.properties;
-            slaveHost.slaveComponents.pushObject(slaveComponent);
-          }
-        }, this);
-      }, this);
-      hostIndex++;
-      if (!Ember.none(slaveHost.name)) {
-        dest.slaveHostComponents.pushObject(slaveHost);
-      }
-
-    }
-    return dest;
+    return customConfigs;
   },
   },
 
 
   getServiceInfo: function (componentName) {
   getServiceInfo: function (componentName) {
@@ -462,6 +455,9 @@ App.WizardStep8Controller = Em.Controller.extend({
           case 'GANGLIA':
           case 'GANGLIA':
             this.loadGanglia(serviceObj);
             this.loadGanglia(serviceObj);
             break;
             break;
+          case 'HUE':
+            this.loadHue(serviceObj);
+            break;
           /* case 'PIG':
           /* case 'PIG':
            this.loadPig(serviceObj);
            this.loadPig(serviceObj);
            break;
            break;
@@ -590,23 +586,14 @@ App.WizardStep8Controller = Em.Controller.extend({
 
 
   loadHiveDbValue: function (dbComponent) {
   loadHiveDbValue: function (dbComponent) {
     var hiveDb = App.db.getServiceConfigProperties().findProperty('name', 'hive_database');
     var hiveDb = App.db.getServiceConfigProperties().findProperty('name', 'hive_database');
-
     if (hiveDb.value === 'New MySQL Database') {
     if (hiveDb.value === 'New MySQL Database') {
-
       dbComponent.set('component_value', 'MySQL (New Database)');
       dbComponent.set('component_value', 'MySQL (New Database)');
-
     } else if(hiveDb.value === 'Existing MySQL Database'){
     } else if(hiveDb.value === 'Existing MySQL Database'){
-
       var db = App.db.getServiceConfigProperties().findProperty('name', 'hive_existing_mysql_database');
       var db = App.db.getServiceConfigProperties().findProperty('name', 'hive_existing_mysql_database');
-
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
-
     } else { // existing oracle database
     } else { // existing oracle database
-
       var db = App.db.getServiceConfigProperties().findProperty('name', 'hive_existing_oracle_database');
       var db = App.db.getServiceConfigProperties().findProperty('name', 'hive_existing_oracle_database');
-
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
       dbComponent.set('component_value', db.value + ' (' + hiveDb.value + ')');
-
     }
     }
   },
   },
 
 
@@ -678,6 +665,27 @@ App.WizardStep8Controller = Em.Controller.extend({
     serverComponent.set('component_value', zkHostNames + ' ' + hostSuffix);
     serverComponent.set('component_value', zkHostNames + ' ' + hostSuffix);
   },
   },
 
 
+  /**
+   * Load all info about Hue services
+   * @param hueObj
+   */
+  loadHue: function (hueObj) {
+    hueObj.get('service_components').forEach(function (_component) {
+      switch (_component.get('display_name')) {
+        case 'Server':
+          this.loadHueServerValue(_component);
+          break;
+        default:
+      }
+    }, this);
+    this.get('services').pushObject(hueObj);
+  },
+
+  loadHueServerValue: function (hueServer) {
+    var hueServerName = this.get('content.masterComponentHosts').findProperty('display_name', 'Hue Server');
+    hueServer.set('component_value', hueServerName.hostName);
+  },
+
   /**
   /**
    * Load all info about Oozie services
    * Load all info about Oozie services
    * @param oozieObj
    * @param oozieObj
@@ -690,7 +698,7 @@ App.WizardStep8Controller = Em.Controller.extend({
           break;
           break;
         case 'Database':
         case 'Database':
           // TODO: uncomment when ready to integrate with Oozie Database other than Derby
           // TODO: uncomment when ready to integrate with Oozie Database other than Derby
-          // this.loadOozieDbValue(_component);
+          this.loadOozieDbValue(_component);
           break;
           break;
         default:
         default:
       }
       }
@@ -705,12 +713,19 @@ App.WizardStep8Controller = Em.Controller.extend({
 
 
   loadOozieDbValue: function (dbComponent) {
   loadOozieDbValue: function (dbComponent) {
     var oozieDb = App.db.getServiceConfigProperties().findProperty('name', 'oozie_database');
     var oozieDb = App.db.getServiceConfigProperties().findProperty('name', 'oozie_database');
-    if (oozieDb.value === 'New PostgreSQL Database') {
-      dbComponent.set('component_value', 'PostgreSQL (New Database)');
-    } else {
-      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_existing_database');
+    if (oozieDb.value === 'Current Derby Database'){
+      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_derby_database');
+      dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
+    } else if (oozieDb.value === 'New MySQL Database') {
+      dbComponent.set('component_value', 'MySQL (New Database)');
+    } else if(oozieDb.value === 'Existing MySQL Database'){
+      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_existing_mysql_database');
+      dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
+    } else { // existing oracle database
+      var db = App.db.getServiceConfigProperties().findProperty('name', 'oozie_existing_oracle_database');
       dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
       dbComponent.set('component_value', db.value + ' (' + oozieDb.value + ')');
     }
     }
+
   },
   },
 
 
 
 
@@ -803,6 +818,14 @@ App.WizardStep8Controller = Em.Controller.extend({
           localdb: App.db.data
           localdb: App.db.data
         });
         });
         break;
         break;
+      case 'addServiceController':
+        App.clusterStatus.setClusterStatus({
+          clusterName: this.get('clusterName'),
+          clusterState: 'ADD_SERVICES_DEPLOY_PREP_2',
+          wizardControllerName: this.get('content.controllerName'),
+          localdb: App.db.data
+        });
+        break;
       default:
       default:
         break;
         break;
     }
     }
@@ -818,10 +841,10 @@ App.WizardStep8Controller = Em.Controller.extend({
     this.createCluster();
     this.createCluster();
     this.createSelectedServices();
     this.createSelectedServices();
     this.createConfigurations();
     this.createConfigurations();
-    this.applyCreatedConfToServices();
     this.createComponents();
     this.createComponents();
     this.registerHostsToCluster();
     this.registerHostsToCluster();
     this.createAllHostComponents();
     this.createAllHostComponents();
+    this.createHostOverrideConfigurations();
 
 
     this.ajaxQueueFinished = function () {
     this.ajaxQueueFinished = function () {
       console.log('everything is loaded');
       console.log('everything is loaded');
@@ -1197,41 +1220,47 @@ App.WizardStep8Controller = Em.Controller.extend({
   createConfigurations: function () {
   createConfigurations: function () {
     var selectedServices = this.get('selectedServices');
     var selectedServices = this.get('selectedServices');
     if (this.get('content.controllerName') == 'installerController') {
     if (this.get('content.controllerName') == 'installerController') {
-      this.createConfigSiteForService(this.createGlobalSiteObj());
-      // this.createGlobalSitePerSlaveGroup();
-      this.createConfigSiteForService(this.createCoreSiteObj());
-      this.createConfigSiteForService(this.createHdfsSiteObj());
+      this.applyConfigurationToSite(this.createGlobalSiteObj());
+      this.applyConfigurationToSite(this.createCoreSiteObj());
+      this.applyConfigurationToSite(this.createHdfsSiteObj());
     }
     }
     if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
     if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
-      this.createConfigSiteForService(this.createMrSiteObj());
-      this.createConfigSiteForService(this.createCapacityScheduler());
-      this.createConfigSiteForService(this.createMapredQueueAcls());
+      this.applyConfigurationToSite(this.createMrSiteObj());
+      this.applyConfigurationToSite(this.createCapacityScheduler());
+      this.applyConfigurationToSite(this.createMapredQueueAcls());
     }
     }
     if (selectedServices.someProperty('serviceName', 'HBASE')) {
     if (selectedServices.someProperty('serviceName', 'HBASE')) {
-      this.createConfigSiteForService(this.createHbaseSiteObj());
+      this.applyConfigurationToSite(this.createHbaseSiteObj());
     }
     }
     if (selectedServices.someProperty('serviceName', 'OOZIE')) {
     if (selectedServices.someProperty('serviceName', 'OOZIE')) {
-      this.createConfigSiteForService(this.createOozieSiteObj('OOZIE'));
+      this.applyConfigurationToSite(this.createOozieSiteObj('OOZIE'));
     }
     }
     if (selectedServices.someProperty('serviceName', 'HIVE')) {
     if (selectedServices.someProperty('serviceName', 'HIVE')) {
-      this.createConfigSiteForService(this.createHiveSiteObj('HIVE'));
+      this.applyConfigurationToSite(this.createHiveSiteObj('HIVE'));
     }
     }
     if (selectedServices.someProperty('serviceName', 'WEBHCAT')) {
     if (selectedServices.someProperty('serviceName', 'WEBHCAT')) {
-      this.createConfigSiteForService(this.createWebHCatSiteObj('WEBHCAT'));
+      this.applyConfigurationToSite(this.createWebHCatSiteObj('WEBHCAT'));
+    }
+    if (selectedServices.someProperty('serviceName', 'HUE')) {
+      this.applyConfigurationToSite(this.createHueSiteObj('HUE'));
     }
     }
   },
   },
 
 
-  createConfigSiteForService: function (data) {
-    console.log("Inside createConfigSiteForService");
-
-    var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/configurations';
-
+  applyConfigurationToSite: function (data) {
+    console.log("Inside applyConfigurationToSite");
+    var clusterUrl = App.apiPrefix + '/clusters/' + this.get('clusterName');
+    var clusterData = {
+      Clusters: {
+        desired_configs: data
+      }
+    };
+    console.debug("applyConfigurationToSite(Step8): Applying to URL", clusterUrl, " Data:", clusterData);
     this.ajax({
     this.ajax({
-      type: 'POST',
-      url: url,
-      data: JSON.stringify(data),
+      type: 'PUT',
+      url: clusterUrl,
+      data: JSON.stringify(clusterData),
       beforeSend: function () {
       beforeSend: function () {
-        console.log("BeforeSend: createConfigSiteForService for " + data.type);
+        console.log("BeforeSend: Updating cluster config for " + clusterData.type);
       }
       }
     });
     });
   },
   },
@@ -1254,6 +1283,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       if (_globalSiteObj.name == 'java64_home') {
       if (_globalSiteObj.name == 'java64_home') {
         globalSiteProperties['java64_home'] = this.get('content.installOptions.javaHome');
         globalSiteProperties['java64_home'] = this.get('content.installOptions.javaHome');
       }
       }
+      this._recordHostOverrideFromObj(_globalSiteObj, 'global', 'version1', this);
     }, this);
     }, this);
     return {"type": "global", "tag": "version1", "properties": globalSiteProperties};
     return {"type": "global", "tag": "version1", "properties": globalSiteProperties};
   },
   },
@@ -1271,6 +1301,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     coreSiteObj.forEach(function (_coreSiteObj) {
     coreSiteObj.forEach(function (_coreSiteObj) {
       if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
       if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
         coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
         coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
+        this._recordHostOverrideFromObj(_coreSiteObj, 'core-site', 'version1', this);
       }
       }
       console.log("STEP*: name of the property is: " + _coreSiteObj.name);
       console.log("STEP*: name of the property is: " + _coreSiteObj.name);
       console.log("STEP8: value of the property is: " + _coreSiteObj.value);
       console.log("STEP8: value of the property is: " + _coreSiteObj.value);
@@ -1283,17 +1314,31 @@ App.WizardStep8Controller = Em.Controller.extend({
     var hdfsProperties = {};
     var hdfsProperties = {};
     hdfsSiteObj.forEach(function (_configProperty) {
     hdfsSiteObj.forEach(function (_configProperty) {
       hdfsProperties[_configProperty.name] = _configProperty.value;
       hdfsProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hdfs-site', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
     }, this);
     return {"type": "hdfs-site", "tag": "version1", "properties": hdfsProperties };
     return {"type": "hdfs-site", "tag": "version1", "properties": hdfsProperties };
   },
   },
 
 
+  createHueSiteObj: function () {
+    var hueSiteObj = this.get('configs').filterProperty('filename', 'hue-site.xml');
+    var hueProperties = {};
+    hueSiteObj.forEach(function (_configProperty) {
+      hueProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hue-site', 'version1', this);
+      console.log("STEP*: name of the property is: " + _configProperty.name);
+      console.log("STEP8: value of the property is: " + _configProperty.value);
+    }, this);
+    return {"type": "hue-site", "tag": "version1", "properties": hueProperties };
+  },
+
   createMrSiteObj: function () {
   createMrSiteObj: function () {
     var configs = this.get('configs').filterProperty('filename', 'mapred-site.xml');
     var configs = this.get('configs').filterProperty('filename', 'mapred-site.xml');
     var mrProperties = {};
     var mrProperties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
       mrProperties[_configProperty.name] = _configProperty.value;
       mrProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'mapred-site', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
     }, this);
@@ -1305,6 +1350,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     var csProperties = {};
     var csProperties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
       csProperties[_configProperty.name] = _configProperty.value;
       csProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'capacity-scheduler', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
     }, this);
@@ -1316,6 +1362,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     var mqProperties = {};
     var mqProperties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
      mqProperties[_configProperty.name] = _configProperty.value;
      mqProperties[_configProperty.name] = _configProperty.value;
+     this._recordHostOverrideFromObj(_configProperty, 'mapred-queue-acls', 'version1', this);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP*: name of the property is: " + _configProperty.name);
       console.log("STEP8: value of the property is: " + _configProperty.value);
       console.log("STEP8: value of the property is: " + _configProperty.value);
     }, this);
     }, this);
@@ -1327,6 +1374,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     var hbaseProperties = {};
     var hbaseProperties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
       hbaseProperties[_configProperty.name] = _configProperty.value;
       hbaseProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hbase-site', 'version1', this);
     }, this);
     }, this);
     return {type: 'hbase-site', tag: 'version1', properties: hbaseProperties};
     return {type: 'hbase-site', tag: 'version1', properties: hbaseProperties};
   },
   },
@@ -1336,7 +1384,9 @@ App.WizardStep8Controller = Em.Controller.extend({
     var oozieProperties = {};
     var oozieProperties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
       oozieProperties[_configProperty.name] = _configProperty.value;
       oozieProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'oozie-site', 'version1', this);
     }, this);
     }, this);
+
     return {type: 'oozie-site', tag: 'version1', properties: oozieProperties};
     return {type: 'oozie-site', tag: 'version1', properties: oozieProperties};
   },
   },
 
 
@@ -1345,7 +1395,9 @@ App.WizardStep8Controller = Em.Controller.extend({
     var hiveProperties = {};
     var hiveProperties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
       hiveProperties[_configProperty.name] = _configProperty.value;
       hiveProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'hive-site', 'version1', this);
     }, this);
     }, this);
+
     return {type: 'hive-site', tag: 'version1', properties: hiveProperties};
     return {type: 'hive-site', tag: 'version1', properties: hiveProperties};
   },
   },
 
 
@@ -1354,33 +1406,11 @@ App.WizardStep8Controller = Em.Controller.extend({
     var webHCatProperties = {};
     var webHCatProperties = {};
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
       webHCatProperties[_configProperty.name] = _configProperty.value;
       webHCatProperties[_configProperty.name] = _configProperty.value;
+      this._recordHostOverrideFromObj(_configProperty, 'webhcat-site', 'version1', this);
     }, this);
     }, this);
     return {type: 'webhcat-site', tag: 'version1', properties: webHCatProperties};
     return {type: 'webhcat-site', tag: 'version1', properties: webHCatProperties};
   },
   },
 
 
-  applyCreatedConfToServices: function () {
-    var services = this.get('selectedServices').mapProperty('serviceName');
-    services.forEach(function (_service) {
-      var data = this.getConfigForService(_service);
-      this.applyCreatedConfToService(_service, 'PUT', data);
-    }, this);
-  },
-
-  applyCreatedConfToService: function (service, httpMethod, data) {
-    console.log("Inside applyCreatedConfToService");
-
-    var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services/' + service;
-
-    this.ajax({
-      type: httpMethod,
-      url: url,
-      data: JSON.stringify(data),
-      beforeSend: function () {
-        console.log("BeforeSend: applyCreatedConfToService for " + service);
-      }
-    });
-  },
-
   getConfigForService: function (serviceName) {
   getConfigForService: function (serviceName) {
     switch (serviceName) {
     switch (serviceName) {
       case 'HDFS':
       case 'HDFS':
@@ -1395,6 +1425,8 @@ App.WizardStep8Controller = Em.Controller.extend({
         return {config: {'global': 'version1', 'hive-site': 'version1'}};
         return {config: {'global': 'version1', 'hive-site': 'version1'}};
       case 'WEBHCAT':
       case 'WEBHCAT':
         return {config: {'global': 'version1', 'webhcat-site': 'version1'}};
         return {config: {'global': 'version1', 'webhcat-site': 'version1'}};
+      case 'HUE':
+        return {config: {'global': 'version1', 'hue-site': 'version1'}};
       default:
       default:
         return {config: {'global': 'version1'}};
         return {config: {'global': 'version1'}};
     }
     }
@@ -1428,9 +1460,69 @@ App.WizardStep8Controller = Em.Controller.extend({
   },
   },
 
 
   /**
   /**
-   * We need to do a lot of ajax calls async in special order.
-   * To do this, generate array of ajax objects and then send requests step by step.
-   * All ajax objects are stored in <code>ajaxQueue</code>
+   * Records all the host overrides per site/tag
+   */
+  _recordHostOverrideFromObj: function(serviceConfigObj, siteName, tagName, self){
+    var overrides = serviceConfigObj.overrides;
+    if(overrides && overrides.length>0){
+      overrides.forEach(function(override){
+        override.hosts.forEach(function(host){
+          if(!(host in self.savedHostToOverrideSiteToTagMap)){
+            self.savedHostToOverrideSiteToTagMap[host] = {};
+          }
+          if(!(siteName in self.savedHostToOverrideSiteToTagMap[host])){
+            self.savedHostToOverrideSiteToTagMap[host][siteName] = {};
+            self.savedHostToOverrideSiteToTagMap[host][siteName].map = {};
+          }
+          var finalTag = tagName + '_' + host;
+          console.log("recordHostOverride(): Saving host override for host="+host+", site="+siteName+", tag="+finalTag+", (key,value)=("+serviceConfigObj.name+","+override.value+")");
+          self.savedHostToOverrideSiteToTagMap[host][siteName].tagName = finalTag;
+          self.savedHostToOverrideSiteToTagMap[host][siteName].map[serviceConfigObj.name] = override.value;
+        });
+      });
+    }
+  },
+
+  /**
+   * Creates host level overrides for service configuration.
+   * 
+   */
+  createHostOverrideConfigurations: function () {
+    var savedHostSiteArray = [];
+    for ( var host in this.savedHostToOverrideSiteToTagMap) {
+      for ( var siteName in this.savedHostToOverrideSiteToTagMap[host]) {
+        var tagName = this.savedHostToOverrideSiteToTagMap[host][siteName].tagName;
+        var map = this.savedHostToOverrideSiteToTagMap[host][siteName].map;
+        savedHostSiteArray.push(host + "///" + siteName);
+        var hostOverridenServerData = {
+          Hosts: {
+            desired_config: {
+              type: siteName,
+              tag: tagName,
+              properties: map
+            }
+          }
+        };
+        console.log("createHostOverrideConfigSites(): PUTting host-override config for host=" + host + ", site=" + siteName + ", tag=" + tagName + ". Data=", hostOverridenServerData);
+        var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/hosts/' + host;
+        this.ajax({
+          type: 'PUT',
+          url: url,
+          data: JSON.stringify(hostOverridenServerData),
+          dataType: 'text',
+          beforeSend: function () {
+            console.log("createHostOverrideConfigSites("+host+") override=", hostOverridenServerData);
+          }
+        });
+      }
+    }
+  },
+
+  /**
+   * We need to do a lot of ajax calls async in special order. To do this,
+   * generate array of ajax objects and then send requests step by step. All
+   * ajax objects are stored in <code>ajaxQueue</code>
+   * 
    * @param params
    * @param params
    */
    */
 
 
@@ -1481,10 +1573,3 @@ App.WizardStep8Controller = Em.Controller.extend({
   }
   }
 
 
 });
 });
-
-
-
-
-
-  
-  

+ 67 - 1
ambari-web/app/controllers/wizard/step9_controller.js

@@ -61,6 +61,72 @@ App.WizardStep9Controller = Em.Controller.extend({
     return 'info';
     return 'info';
   }.property('hosts.@each.status', 'progress'),
   }.property('hosts.@each.status', 'progress'),
 
 
+  categoryObject: Em.Object.extend({
+    hostsCount: function () {
+      var category = this;
+      var hosts = this.get('controller.hosts').filter(function(_host) {
+        if(category.get('hostStatus') == 'inProgress'){   // queued, pending, in_progress map to inProgress
+          return (_host.get('status') !== 'success' && _host.get('status') !== 'failed' && _host.get('status') !== 'warning');
+        }
+        return (_host.get('status') == category.get('hostStatus'));
+      }, this);
+      return hosts.get('length');
+    }.property('controller.hosts.@each.status'),
+    label: function () {
+      return "%@ (%@)".fmt(this.get('value'), this.get('hostsCount'));
+    }.property('value', 'hostsCount')
+  }),
+  getCategory: function(field, value){
+    return this.get('categories').find(function(item){
+      return item.get(field) == value;
+    });
+  },
+
+  categories: function () {
+    var self = this;
+    self.categoryObject.reopen({
+      controller: self,
+      isActive: function(){
+        return this.get('controller.category') == this;
+      }.property('controller.category'),
+      itemClass: function(){
+        return this.get('isActive') ? 'active' : '';
+      }.property('isActive')
+    });
+
+    var categories = [
+      self.categoryObject.create({value: Em.I18n.t('common.all'), hostStatus:'all', hostsCount: function () {
+        return this.get('controller.hosts.length');
+      }.property('controller.hosts.length') }),
+      self.categoryObject.create({value: Em.I18n.t('installer.step9.hosts.status.label.inProgress'), hostStatus: 'inProgress'}),
+      self.categoryObject.create({value: Em.I18n.t('installer.step9.hosts.status.label.warning'), hostStatus: 'warning'}),
+      self.categoryObject.create({value: Em.I18n.t('common.success'), hostStatus: 'success'}),
+      self.categoryObject.create({value: Em.I18n.t('common.fail'), hostStatus: 'failed', last: true })
+    ];
+
+    this.set('category', categories.get('firstObject'));
+    return categories;
+  }.property(),
+
+  category: false,
+  visibleHosts: function(){
+    var targetStatus = this.get('category.hostStatus');
+    var visibleHosts =  this.get('hosts').filter(function(_host) {
+      if (targetStatus == 'all') {
+        return true;
+      }
+      if (targetStatus == 'inProgress') {   // queued, pending, in_progress map to inProgress
+        return (_host.get('status') !== 'success' && _host.get('status') !== 'failed' && _host.get('status') !== 'warning');
+      }
+      return (_host.get('status') == targetStatus);
+    }, this);
+    return visibleHosts;
+  }.property('category', 'hosts.@each.status'),
+
+  selectCategory: function(event){
+    this.set('category', event.context);
+  },
+
   showRetry: function () {
   showRetry: function () {
     return this.get('content.cluster.status') == 'INSTALL FAILED';
     return this.get('content.cluster.status') == 'INSTALL FAILED';
   }.property('content.cluster.status'),
   }.property('content.cluster.status'),
@@ -268,7 +334,7 @@ App.WizardStep9Controller = Em.Controller.extend({
     var self = this;
     var self = this;
     var clusterName = this.get('content.cluster.name');
     var clusterName = this.get('content.cluster.name');
     var url = App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=INSTALLED';
     var url = App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=INSTALLED';
-    var data = '{"ServiceInfo": {"state": "STARTED"}}';
+    var data = '{"RequestInfo": {"context": "'+Em.I18n.t("requestInfo.serviceStartCheck")+'"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
     var method = 'PUT';
     var method = 'PUT';
 
 
     if (this.get('content.controllerName') === 'addHostController') {
     if (this.get('content.controllerName') === 'addHostController') {

+ 0 - 147
ambari-web/app/data/capacity-scheduler_default.js

@@ -1,147 +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 = [
-  {
-    name: 'mapred.capacity-scheduler.maximum-system-jobs',
-    value: 3000,
-    description: 'Maximum number of jobs in the system which can be initialized, concurrently, by the CapacityScheduler.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.capacity',
-    value: 100,
-    description: 'Percentage of the number of slots in the cluster that are to be available for jobs in this queue.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.maximum-capacity',
-    value: -1,
-    description: 'maximum-capacity defines a limit beyond which a queue cannot use the capacity of the cluster.' +
-      'This provides a means to limit how much excess capacity a queue can use. By default, there is no limit.' +
-      'The maximum-capacity of a queue can only be greater than or equal to its minimum capacity.' +
-      'Default value of -1 implies a queue can use complete capacity of the cluster.' +
-      '\n' +
-      'This property could be to curtail certain jobs which are long running in nature from occupying more than a' +
-      'certain percentage of the cluster, which in the absence of pre-emption, could lead to capacity guarantees of ' +
-      'other queues being affected.' +
-      '\n' +
-      'One important thing to note is that maximum-capacity is a percentage , so based on the cluster\'s capacity' +
-      'the max capacity would change. So if large no of nodes or racks get added to the cluster , max Capacity in' +
-      'absolute terms would increase accordingly.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.supports-priority',
-    value: false,
-    description: 'If true, priorities of jobs will be taken into account in scheduling decisions.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.minimum-user-limit-percent',
-    value: 100,
-    description: 'Each queue enforces a limit on the percentage of resources' +
-      'allocated to a user at any given time, if there is competition for them.' +
-      'This user limit can vary between a minimum and maximum value. The former' +
-      'depends on the number of users who have submitted jobs, and the latter is' +
-      'set to this property value.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.user-limit-factor',
-    value: 1,
-    description: 'The multiple of the queue capacity which can be configured to' +
-      'allow a single user to acquire more slots.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.maximum-initialized-active-tasks',
-    value: 200000,
-    description: 'The maximum number of tasks, across all jobs in the queue,' +
-      'which can be initialized concurrently. Once the queue\'s jobs exceed this' +
-      'limit they will be queued on disk. '
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.maximum-initialized-active-tasks-per-user',
-    value: 100000,
-    description: 'The maximum number of tasks per-user, across all the of the' +
-      'user\'s jobs in the queue, which can be initialized concurrently. Once the' +
-      'user\'s jobs exceed this limit they will be queued on disk.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.queue.default.init-accept-jobs-factor',
-    value: 10,
-    description: 'The multipe of (maximum-system-jobs * queue-capacity) used to' +
-      'determine the number of jobs which are accepted by the scheduler.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.default-supports-priority',
-    value: false,
-    description: 'If true, priorities of jobs will be taken into' +
-      'account in scheduling decisions by default in a job queue.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.default-minimum-user-limit-percent',
-    value: 100,
-    description: 'The percentage of the resources limited to a particular user' +
-      'for the job queue at any given point of time by default.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.default-user-limit-factor',
-    value: 1,
-    description: 'The default multiple of queue-capacity which is used to' +
-      'determine the amount of slots a single user can consume concurrently.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.default-user-limit-factor',
-    value: 1,
-    description: 'The default multiple of queue-capacity which is used to' +
-      'determine the amount of slots a single user can consume concurrently.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.default-maximum-active-tasks-per-queue',
-    value: 200000,
-    description: 'The default maximum number of tasks, across all jobs in the' +
-      'queue, which can be initialized concurrently. Once the queue\'s jobs exceed' +
-      'this limit they will be queued on disk.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.default-maximum-active-tasks-per-user',
-    value: 100000,
-    description: 'The default maximum number of tasks per-user, across all the of' +
-      'the user\'s jobs in the queue, which can be initialized concurrently. Once' +
-      'the user\'s jobs exceed this limit they will be queued on disk.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.default-init-accept-jobs-factor',
-    value: 10,
-    description: 'The default multipe of (maximum-system-jobs * queue-capacity)' +
-      'used to determine the number of jobs which are accepted by the scheduler.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.init-poll-interval',
-    value: 5000,
-    description: 'The amount of time in milliseconds which is used to poll' +
-      'the job queues for jobs to initialize.'
-  },
-  {
-    name: 'mapred.capacity-scheduler.init-worker-threads',
-    value: 5,
-    description: 'Number of worker threads which would be used by' +
-      'Initialization poller to initialize jobs in a set of queue.' +
-      'If number mentioned in property is equal to number of job queues' +
-      'then a single thread would initialize jobs in a queue. If lesser' +
-      'then a thread would get a set of queues assigned. If the number' +
-      'is greater then number of threads would be equal to number of' +
-      'job queues.'
-  }
-];
-

+ 92 - 38
ambari-web/app/data/config_mapping.js

@@ -16,7 +16,7 @@
  * limitations under the License.
  * limitations under the License.
  */
  */
 
 
-module.exports = [
+var configs = [
   {
   {
     "name": "fs.default.name",
     "name": "fs.default.name",
     "templateName": ["namenode_host"],
     "templateName": ["namenode_host"],
@@ -57,42 +57,48 @@ module.exports = [
     "templateName": ["proxyuser_group"],
     "templateName": ["proxyuser_group"],
     "foreignKey": ["hive_user"],
     "foreignKey": ["hive_user"],
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   },
   {
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "templateName": ["hivemetastore_host"],
     "templateName": ["hivemetastore_host"],
     "foreignKey": ["hive_user"],
     "foreignKey": ["hive_user"],
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   },
   {
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
     "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
     "templateName": ["proxyuser_group"],
     "templateName": ["proxyuser_group"],
     "foreignKey": ["oozie_user"],
     "foreignKey": ["oozie_user"],
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   },
   {
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "templateName": ["oozieserver_host"],
     "templateName": ["oozieserver_host"],
     "foreignKey": ["oozie_user"],
     "foreignKey": ["oozie_user"],
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   },
   {
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
     "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
     "templateName": ["proxyuser_group"],
     "templateName": ["proxyuser_group"],
     "foreignKey": ["webhcat_user"],
     "foreignKey": ["webhcat_user"],
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   },
   {
   {
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
     "templateName": ["hivemetastore_host"],
     "templateName": ["hivemetastore_host"],
     "foreignKey": ["webhcat_user"],
     "foreignKey": ["webhcat_user"],
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
-    "filename": "core-site.xml"
+    "filename": "core-site.xml",
+    "isOverridable" : true
   },
   },
   {
   {
     "name": "dfs.name.dir",
     "name": "dfs.name.dir",
@@ -310,36 +316,59 @@ module.exports = [
     "value": "http://<templateName[0]>:11000/oozie",
     "value": "http://<templateName[0]>:11000/oozie",
     "filename": "oozie-site.xml"
     "filename": "oozie-site.xml"
   },
   },
-  /*
-   {
-   "name": "oozie.service.JPAService.jdbc.password",
-   "templateName": [],
-   "foreignKey": null,
-   "value": " ",
-   "filename": "oozie-site.xml"
-   },
-   {
-   "name": "oozie.db.schema.name",
-   "templateName": [],
-   "foreignKey": null,
-   "value": "oozie",
-   "filename": "oozie-site.xml"
-   },
-   {
-   "name": "oozie.service.JPAService.jdbc.url",
-   "templateName": [],
-   "foreignKey": null,
-   "value": "jdbc:derby:/var/data/oozie/oozie-db;create=true",
-   "filename": "oozie-site.xml"
-   },
-   {
-   "name": "oozie.action.ssh.http.command.post.options",
-   "templateName": [],
-   "foreignKey": null,
-   "value": " ",
-   "filename": "oozie-site.xml"
-   },
-   */
+  {
+    "name": "oozie.service.JPAService.jdbc.password",
+    "templateName": ["oozie_metastore_user_passwd"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "oozie-site.xml"
+  },
+  {
+    "name": "oozie.service.JPAService.jdbc.username",
+    "templateName": ["oozie_metastore_user_name"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "oozie-site.xml"
+  },
+  {
+    "name": "oozie.service.JPAService.jdbc.driver",
+    "templateName": ["oozie_jdbc_driver"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "oozie-site.xml"
+  },
+
+  {
+    "name": "oozie.service.JPAService.jdbc.url",  ///////////////
+    "templateName": ["oozie_database_type", "oozie_JPAService_url"], // 4 type database //
+    "foreignKey": null,
+    "value": "jdbc:<templateName[0]>:<templateName[1]>",
+    "filename": "oozie-site.xml"
+  },
+
+//  {
+//    "name": "oozie.service.JPAService.jdbc.url",
+//    "templateName": ["oozie_database_type", "oozie_hostname", "oozie_database_name"],
+//    "foreignKey": null,
+//    "value": "jdbc:<templateName[0]>://<templateName[1]>/<templateName[2]>?createDatabaseIfNotExist=true",
+//    "filename": "oozie-site.xml"
+//  },
+  
+//  {
+//    "name": "oozie.db.schema.name",
+//    "templateName": ["oozie_metastore_user_name"],
+//    "foreignKey": null,
+//    "value": "<templateName[0]>",
+//    "filename": "oozie-site.xml"
+//  },
+
+//  {
+//    "name": "oozie.action.ssh.http.command.post.options",
+//    "templateName": [],
+//    "foreignKey": null,
+//    "value": " ",
+//    "filename": "oozie-site.xml"
+//  },
   {
   {
     "name": "javax.jdo.option.ConnectionURL",
     "name": "javax.jdo.option.ConnectionURL",
     "templateName": ["hive_database_type", "hive_hostname", "hive_database_name"],
     "templateName": ["hive_database_type", "hive_hostname", "hive_database_name"],
@@ -361,6 +390,13 @@ module.exports = [
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
     "filename": "hive-site.xml"
     "filename": "hive-site.xml"
   },
   },
+  {
+    "name": "javax.jdo.option.ConnectionDriverName",
+    "templateName": ["hive_jdbc_driver"],
+    "foreignKey": null,
+    "value": "<templateName[0]>",
+    "filename": "hive-site.xml"
+  },
   {
   {
     "name": "hive.metastore.uris",
     "name": "hive.metastore.uris",
     "templateName": ["hivemetastore_host"],
     "templateName": ["hivemetastore_host"],
@@ -822,4 +858,22 @@ module.exports = [
     "value": "<templateName[0]>",
     "value": "<templateName[0]>",
     "filename": "hbase-site.xml"
     "filename": "hbase-site.xml"
   }
   }
-];
+];
+
+/**
+ * Configs consists of 2 types: Computed values, which cannot be modified by user
+ * and overridable values, which user can modify. We provide interface how to get all of this
+ * configs separately
+ * @type {Object}
+ */
+module.exports = {
+  all : function(){
+    return configs.slice(0);
+  },
+  overridable: function(){
+    return configs.filterProperty("isOverridable", true);
+  },
+  computed: function(){
+    return configs.filterProperty("isOverridable", false);
+  }
+};

+ 315 - 113
ambari-web/app/data/config_properties.js

@@ -831,32 +831,7 @@ module.exports =
       "serviceName": "HIVE",
       "serviceName": "HIVE",
       "category": "Hive Metastore"
       "category": "Hive Metastore"
     },
     },
-    /* Comment out the other hive_database and uncomment this for Hive with Postgres support
-    {
-      "id": "puppet var",
-      "name": "hive_database",
-      "displayName": "Hive Database",
-      "value": "",
-      "defaultValue": "New PostgreSQL Database",
-      "options": [
-        {
-          displayName: 'New PostgreSQL Database',
-          foreignKeys: ['hive_ambari_database', 'hive_ambari_host']
-        },
-        {
-          displayName: 'Existing Database',
-          foreignKeys: ['hive_existing_database', 'hive_existing_host']
-        }
-      ],
-      "description": "PostgreSQL will be installed by Ambari. Any other database will have to be installed by the user.",
-      "displayType": "radio button",
-      "radioName": "hive-database",
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "HIVE",
-      "category": "Hive Metastore"
-    },
-    */
+
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "hive_database",
       "name": "hive_database",
@@ -903,40 +878,10 @@ module.exports =
       "serviceName": "HIVE",
       "serviceName": "HIVE",
       "category": "Hive Metastore"
       "category": "Hive Metastore"
     },
     },
-    /* Uncomment for Hive with Postgres support
-    {
-      "id": "puppet var",
-      "name": "hive_existing_database",
-      "displayName": "Hive Database",
-      "value": "",
-      "defaultValue": "MySQL",
-      "description": "Select the database, if you already have existing one for Hive Metastore.",
-      "displayType": "string",
-      "isVisible": false,
-      "options": ['MySQL', 'PostgreSQL'],
-      "domain": "global",
-      "serviceName": "HIVE",
-      "category": "Hive Metastore"
-    },
-    {
-      "id": "puppet var",
-      "name": "hive_existing_database",
-      "displayName": "Hive Database",
-      "value": "",
-      "defaultValue": "MySQL",
-      "description": "Select the database, if you already have existing one for Hive Metastore.",
-      "displayType": "combobox",
-      "isVisible": false,
-      "options": ['MySQL', 'PostgreSQL'],
-      "domain": "global",
-      "serviceName": "HIVE",
-      "category": "Hive Metastore"
-    },
-    */
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "hive_existing_mysql_host",
       "name": "hive_existing_mysql_host",
-      "displayName": "Database host",
+      "displayName": "Database Host",
       "description": "Specify the host on which the existing database is hosted",
       "description": "Specify the host on which the existing database is hosted",
       "defaultValue": "",
       "defaultValue": "",
       "isReconfigurable": false,
       "isReconfigurable": false,
@@ -966,7 +911,7 @@ module.exports =
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "hive_existing_oracle_host",
       "name": "hive_existing_oracle_host",
-      "displayName": "Database host",
+      "displayName": "Database Host",
       "description": "Specify the host on which the existing database is hosted",
       "description": "Specify the host on which the existing database is hosted",
       "defaultValue": "",
       "defaultValue": "",
       "isReconfigurable": false,
       "isReconfigurable": false,
@@ -987,7 +932,7 @@ module.exports =
       "description": "MySQL will be installed by Ambari",
       "description": "MySQL will be installed by Ambari",
       "displayType": "masterHost",
       "displayType": "masterHost",
       "isOverridable": false,
       "isOverridable": false,
-      "isVisible": true,
+      "isVisible": false,
       "domain": "global",
       "domain": "global",
       "serviceName": "HIVE",
       "serviceName": "HIVE",
       "category": "Hive Metastore"
       "category": "Hive Metastore"
@@ -997,12 +942,12 @@ module.exports =
       "name": "hive_ambari_host",
       "name": "hive_ambari_host",
       "value": "",
       "value": "",
       "defaultValue": "",
       "defaultValue": "",
-      "displayName": "Database host",
+      "displayName": "Database Host",
       "description": "Host on which the database will be created by Ambari",
       "description": "Host on which the database will be created by Ambari",
       "isReconfigurable": false,
       "isReconfigurable": false,
       "displayType": "masterHost",
       "displayType": "masterHost",
       "isOverridable": false,
       "isOverridable": false,
-      "isVisible": true,
+      "isVisible": false,
       "domain": "global",
       "domain": "global",
       "serviceName": "HIVE",
       "serviceName": "HIVE",
       "category": "Hive Metastore"
       "category": "Hive Metastore"
@@ -1010,7 +955,7 @@ module.exports =
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "hive_database_name",
       "name": "hive_database_name",
-      "displayName": "Database name",
+      "displayName": "Database Name",
       "description": "Database name used as the Hive Metastore",
       "description": "Database name used as the Hive Metastore",
       "defaultValue": "hive",
       "defaultValue": "hive",
       "isReconfigurable": false,
       "isReconfigurable": false,
@@ -1024,7 +969,7 @@ module.exports =
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "hive_metastore_user_name",
       "name": "hive_metastore_user_name",
-      "displayName": "Database user",
+      "displayName": "Database Username",
       "description": "Database user name to use to connect to the database",
       "description": "Database user name to use to connect to the database",
       "defaultValue": "hive",
       "defaultValue": "hive",
       "isReconfigurable": false,
       "isReconfigurable": false,
@@ -1038,7 +983,7 @@ module.exports =
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "hive_metastore_user_passwd",
       "name": "hive_metastore_user_passwd",
-      "displayName": "Database password",
+      "displayName": "Database Password",
       "description": "Database password to use to connect to the PostgreSQL database",
       "description": "Database password to use to connect to the PostgreSQL database",
       "defaultValue": "",
       "defaultValue": "",
       "isReconfigurable": false,
       "isReconfigurable": false,
@@ -1111,7 +1056,7 @@ module.exports =
       "isReconfigurable": false,
       "isReconfigurable": false,
       "displayType": "directory",
       "displayType": "directory",
       "isOverridable": false,
       "isOverridable": false,
-      "isVisible": false,
+      "isVisible": true,
       "domain": "global",
       "domain": "global",
       "serviceName": "HIVE",
       "serviceName": "HIVE",
       "category": "Advanced"
       "category": "Advanced"
@@ -1727,6 +1672,130 @@ module.exports =
       "serviceName": "HDFS",
       "serviceName": "HDFS",
       "category": "Advanced"
       "category": "Advanced"
     },
     },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.maximum-system-jobs",
+      "displayName": "Max system jobs",
+      "displayType": "int",
+      "value": '3000',
+      "defaultValue": '3000',
+      "description": "Maximum number of jobs in the system which can be initialized, concurrently, by the " +
+        "CapacityScheduler. Individual queue limits on initialized jobs are directly proportional to their queue " +
+        "capacities.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "filename": "capacity-scheduler.xml"
+    },
+    /*{
+      "id": "conf-site",
+      "name": "mapred.cluster.map.memory.mb",
+      "displayName": "Map slot memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single map slot in the Map-Reduce framework, used by " +
+        "the scheduler. A job can ask for multiple slots for a single map task via \"Map task memory\", upto the limit " +
+        "specified by \"Max map task memory\", if the scheduler supports the feature. The value of -1 indicates that " +
+        "this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.cluster.reduce.memory.mb",
+      "displayName": "Reduce slot memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single reduce slot in the Map-Reduce framework, " +
+        "used by the scheduler. A job can ask for multiple slots for a single reduce task via \"Reduce task memory\", " +
+        "upto the limit specified by \"Max reduce task memory\", if the scheduler supports the feature.The value of " +
+        "-1 indicates that this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.cluster.max.map.memory.mb",
+      "displayName": "Max map task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The maximum size, in terms of virtual memory, of a single map task launched by the Map-Reduce " +
+        "framework, used by the scheduler. A job can ask for multiple slots for a single map task via " +
+        "\"Map task memory\", upto the limit specified by \"Max map task memory\", if the scheduler supports the " +
+        "feature. The value of -1 indicates that this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.cluster.max.reduce.memory.mb",
+      "displayName": "Max reduce task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The maximum size, in terms of virtual memory, of a single reduce task launched by the Map-Reduce " +
+        "framework, used by the scheduler. A job can ask for multiple slots for a single reduce task via \"Reduce task " +
+        "memory\", upto the limit specified by \"Max reduce task memory\", if the scheduler supports the feature. " +
+        "The value of -1 indicates that this feature is turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.job.map.memory.mb",
+      "displayName": "Map task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single map task for the job. A job can ask for " +
+        "multiple slots for a single map task, rounded up to the next multiple of \"Map slot memory\" and upto " +
+        "the limit specified by \"Max map task memory\", if the scheduler supports the feature. The value of -1 " +
+        "indicates that this feature is turned off iff \"Map slot memory\" is also turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.job.reduce.memory.mb",
+      "displayName": "Reduce task memory",
+      "displayType": "int",
+      "value": '-1',
+      "defaultValue": '-1',
+      "description": "The size, in terms of virtual memory, of a single reduce task for the job. A job can ask for " +
+        "multiple slots for a single reduce task, rounded up to the next multiple of \"Reduce slot memory\" and upto " +
+        "the limit specified by \"Max reduce task memory\", if the scheduler supports the feature. The value of -1 " +
+        "indicates that this feature is turned off iff \"Task slot memory\" is also turned off.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit":"MB",
+      "filename": 'capacity-scheduler.xml'
+    },*/
     /*
     /*
     {
     {
       "id": "puppet var",
       "id": "puppet var",
@@ -1956,20 +2025,6 @@ module.exports =
       "category": "General"
       "category": "General"
     },
     },
     */
     */
-    {
-      "id": "puppet var",
-      "name": "pig_user",
-      "displayName": "Pig User",
-      "description": "User to run Pig as",
-      "defaultValue": "pig",
-      "isReconfigurable": false,
-      "displayType": "user",
-      "isOverridable": false,
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "MISC",
-      "category": "Users and Groups"
-    },
     /*
     /*
     {
     {
       "id": "puppet var",
       "id": "puppet var",
@@ -2000,10 +2055,10 @@ module.exports =
     */
     */
     {
     {
       "id": "puppet var",
       "id": "puppet var",
-      "name": "sqoop_user",
-      "displayName": "Sqoop User",
-      "description": "User to run Sqoop as",
-      "defaultValue": "sqoop",
+      "name": "zk_user",
+      "displayName": "ZooKeeper User",
+      "description": "User to run ZooKeeper as",
+      "defaultValue": "zookeeper",
       "isReconfigurable": false,
       "isReconfigurable": false,
       "displayType": "user",
       "displayType": "user",
       "isOverridable": false,
       "isOverridable": false,
@@ -2014,10 +2069,10 @@ module.exports =
     },
     },
     {
     {
       "id": "puppet var",
       "id": "puppet var",
-      "name": "zk_user",
-      "displayName": "ZooKeeper User",
-      "description": "User to run ZooKeeper as",
-      "defaultValue": "zookeeper",
+      "name": "smokeuser",
+      "displayName": "Smoke Test User",
+      "description": "The user used to run service smoke tests",
+      "defaultValue": "ambari-qa",
       "isReconfigurable": false,
       "isReconfigurable": false,
       "displayType": "user",
       "displayType": "user",
       "isOverridable": false,
       "isOverridable": false,
@@ -2118,64 +2173,204 @@ module.exports =
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
-    /*
+    ////////
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_database",
+//      "displayName": "Oozie Database",
+//      "value": "",
+//      "defaultValue": "New PostgreSQL Database",
+//      "options": [
+//        {
+//          displayName: 'New PostgreSQL Database',
+//          foreignKeys: ['oozie_ambari_database', 'oozie_ambari_host']
+//        },
+//        {
+//          displayName: 'Existing Database',
+//          foreignKeys: ['oozie_existing_database', 'oozie_existing_host']
+//        }
+//      ],
+//      "description": "PostgreSQL will be installed by ambari. Any other database will have to be installed by the user.",
+//      "displayType": "radio button",
+//      "radioName": "oozie-database",
+//      "isVisible": true,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_existing_database",
+//      "displayName": "Oozie Database",
+//      "value": "",
+//      "defaultValue": "MySQL",
+//      "description": "Select the database, if you already have existing one for Oozie.",
+//      "displayType": "combobox",
+//      "isVisible": false,
+//      "options": ['MySQL', 'PostgreSQL'],
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_existing_host",
+//      "displayName": "Database Host",
+//      "description": "Select the host on which the existing database is hosted.",
+//      "defaultValue": "",
+//      "isReconfigurable": false,
+//      "displayType": "host",
+//      "isVisible": false,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_ambari_database",
+//      "displayName": "Oozie Database",
+//      "value": "",
+//      "defaultValue": "PostgreSQL",
+//      "description": "PostgreSQL will be installed by ambari.",
+//      "displayType": "masterHost",
+//      "isVisible": true,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//    {
+//      "id": "puppet var",
+//      "name": "oozie_ambari_host",
+//      "value": "",
+//      "defaultValue": "",
+//      "displayName": "PostgreSQL host",
+//      "description": "Host  on which the PostgreSQL database will be created by ambari. ",
+//      "isReconfigurable": false,
+//      "displayType": "masterHost",
+//      "isVisible": true,
+//      "serviceName": "OOZIE",
+//      "category": "Oozie Server"
+//    },
+//
+
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "oozie_database",
       "name": "oozie_database",
       "displayName": "Oozie Database",
       "displayName": "Oozie Database",
       "value": "",
       "value": "",
-      "defaultValue": "New PostgreSQL Database",
+      "defaultValue": "Current Derby Database",
       "options": [
       "options": [
         {
         {
-          displayName: 'New PostgreSQL Database',
+          displayName: 'Current Derby Database',
+          foreignKeys: ['oozie_derby_database']
+        },
+        {
+          displayName: 'New MySQL Database',
           foreignKeys: ['oozie_ambari_database', 'oozie_ambari_host']
           foreignKeys: ['oozie_ambari_database', 'oozie_ambari_host']
         },
         },
         {
         {
-          displayName: 'Existing Database',
-          foreignKeys: ['oozie_existing_database', 'oozie_existing_host']
+          displayName: 'Existing MySQL Database',
+          foreignKeys: ['oozie_existing_mysql_database', 'oozie_existing_mysql_host']
+        },
+        {
+          displayName: 'Existing Oracle Database',
+          foreignKeys: ['oozie_existing_oracle_database', 'oozie_existing_oracle_host']
         }
         }
       ],
       ],
-      "description": "PostgreSQL will be installed by ambari. Any other database will have to be installed by the user.",
+      "description": "Current Derby Database will be installed by Ambari",
       "displayType": "radio button",
       "displayType": "radio button",
+      "isReconfigurable": false,
+      "isOverridable": false,
       "radioName": "oozie-database",
       "radioName": "oozie-database",
       "isVisible": true,
       "isVisible": true,
+      "domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
+    // for current derby
     {
     {
       "id": "puppet var",
       "id": "puppet var",
-      "name": "oozie_existing_database",
-      "displayName": "Oozie Database",
+      "name": "oozie_derby_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Derby",
+      "description": "Using current Derby database for Oozie Metastore",
+      "displayType": "masterHost",
+      "isVisible": false,
+      "isReconfigurable": false,
+      "isOverridable": false,
+     // "domain": "global",
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
+    // for existing MySQL oozie
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_mysql_database",
+      "displayName": "Database Type",
       "value": "",
       "value": "",
       "defaultValue": "MySQL",
       "defaultValue": "MySQL",
-      "description": "Select the database, if you already have existing one for Oozie.",
-      "displayType": "combobox",
+      "description": "Using an existing MySQL database for Oozie Metastore",
+      "displayType": "masterHost",
+      "isVisible": false,
+      "isReconfigurable": false,
+      "isOverridable": false,
+     //"domain": "global",
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_mysql_host",
+      "displayName": "Database Host",
+      "description": "Specify the host on which the existing database is hosted",
+      "defaultValue": "",
+      "isReconfigurable": false,
+      "isOverridable": false,
+      "displayType": "host",
+      "isVisible": false,
+     //"domain": "global",
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
+    // for existing Oracle
+    {
+      "id": "puppet var",
+      "name": "oozie_existing_oracle_database",
+      "displayName": "Database Type",
+      "value": "",
+      "defaultValue": "Oracle",
+      "description": "Using an existing Oracle database for Oozie Metastore",
+      "displayType": "masterHost",
       "isVisible": false,
       "isVisible": false,
-      "options": ['MySQL', 'PostgreSQL'],
+      "isReconfigurable": false,
+      "isOverridable": false,
+    //"domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
     {
     {
       "id": "puppet var",
       "id": "puppet var",
-      "name": "oozie_existing_host",
-      "displayName": "Database host",
-      "description": "Select the host on which the existing database is hosted.",
+      "name": "oozie_existing_oracle_host",
+      "displayName": "Database Host",
+      "description": "Specify the host on which the existing database is hosted",
       "defaultValue": "",
       "defaultValue": "",
       "isReconfigurable": false,
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "host",
       "displayType": "host",
       "isVisible": false,
       "isVisible": false,
+    //"domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
+    // for new MySQL
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "oozie_ambari_database",
       "name": "oozie_ambari_database",
-      "displayName": "Oozie Database",
+      "displayName": "Database Type",
       "value": "",
       "value": "",
-      "defaultValue": "PostgreSQL",
-      "description": "PostgreSQL will be installed by ambari.",
+      "defaultValue": "MySQL",
+      "description": "MySQL will be installed by Ambari",
       "displayType": "masterHost",
       "displayType": "masterHost",
-      "isVisible": true,
+      "isVisible": false,
+      "isOverridable": false,
+    // "domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
@@ -2184,51 +2379,58 @@ module.exports =
       "name": "oozie_ambari_host",
       "name": "oozie_ambari_host",
       "value": "",
       "value": "",
       "defaultValue": "",
       "defaultValue": "",
-      "displayName": "PostgreSQL host",
-      "description": "Host  on which the PostgreSQL database will be created by ambari. ",
+      "displayName": "Database Host",
+      "description": "Host on which the database will be created by Ambari",
       "isReconfigurable": false,
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "masterHost",
       "displayType": "masterHost",
-      "isVisible": true,
+      "isVisible": false,
+     //"domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "oozie_database_name",
       "name": "oozie_database_name",
-      "displayName": "Database name",
+      "displayName": "Database Name",
       "description": "Database name used for the Oozie",
       "description": "Database name used for the Oozie",
       "defaultValue": "oozie",
       "defaultValue": "oozie",
       "isReconfigurable": false,
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "host",
       "displayType": "host",
       "isVisible": true,
       "isVisible": true,
+     //"domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "oozie_metastore_user_name",
       "name": "oozie_metastore_user_name",
-      "displayName": "Database user",
+      "displayName": "Database Username",
       "description": "Database user name to use to connect to the database",
       "description": "Database user name to use to connect to the database",
       "defaultValue": "oozie",
       "defaultValue": "oozie",
       "isReconfigurable": false,
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "user",
       "displayType": "user",
       "isVisible": true,
       "isVisible": true,
+     //"domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "oozie_metastore_user_passwd",
       "name": "oozie_metastore_user_passwd",
-      "displayName": "Database password",
-      "description": "Database password to use to connect to the PostgreSQL database",
+      "displayName": "Database Password",
+      "description": "Database password to use to connect to the database",
       "defaultValue": "",
       "defaultValue": "",
       "isReconfigurable": false,
       "isReconfigurable": false,
+      "isOverridable": false,
       "displayType": "password",
       "displayType": "password",
       "isVisible": true,
       "isVisible": true,
+    //"domain": "global",
       "serviceName": "OOZIE",
       "serviceName": "OOZIE",
       "category": "Oozie Server"
       "category": "Oozie Server"
     },
     },
-    */
     {
     {
       "id": "puppet var",
       "id": "puppet var",
       "name": "oozie_data_dir",
       "name": "oozie_data_dir",

+ 160 - 16
ambari-web/app/data/custom_configs.js

@@ -21,28 +21,172 @@ module.exports =
   [
   [
     {
     {
       "id": "conf-site",
       "id": "conf-site",
-      "name": "capacity-scheduler",
-      "displayName": "Custom Capacity Scheduler Configs",
-      "value": "",
-      "defaultValue": require('data/capacity-scheduler_default'),
-      "description": "Enter in key=value format to set capacity-scheduler.xml  parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
-      "displayType": "custom",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.capacity",
+      "displayName": "Capacity",
+      "value": '',
+      "defaultValue": '',
+      "description": "Percentage of the number of slots in the cluster that are made to be available for jobs in this queue. The sum of capacities for all queues should be less than or equal 100.",
       "isVisible": true,
       "isVisible": true,
-      "isRequired": false,
+      "isRequired": true,
       "serviceName": "MAPREDUCE",
       "serviceName": "MAPREDUCE",
-      "category": "Capacity Scheduler"
+      "category": "CapacityScheduler",
+      "unit": "%",
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
     },
     },
     {
     {
       "id": "conf-site",
       "id": "conf-site",
-      "name": "mapred-queue-acls",
-      "displayName": "Custom MapReduce Queue Configs",
-      "value": "",
-      "defaultValue": require('data/mapred-queue-acl_default'),
-      "description": "Enter in key=value format to set mapred-queue-acls.xml parameters not exposed through this page.<br> New line is the delimiter for every key-value pair.",
-      "displayType": "custom",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.maximum-capacity",
+      "displayName": "Max Capacity",
+      "value": '',
+      "defaultValue": 100,
+      "displayType": "int",
+      "description": "Defines a limit beyond which a queue cannot use the capacity of the cluster." +
+        "This provides a means to limit how much excess capacity a queue can use. By default, there is no limit." +
+        "The Max Capacity of a queue can only be greater than or equal to its minimum capacity. " +
+        "This property could be to curtail certain jobs which are long running in nature from occupying more than a certain " +
+        "percentage of the cluster, which in the absence of pre-emption, could lead to capacity guarantees of other queues being affected. " +
+        "One important thing to note is that maximum-capacity is a percentage , so based on the cluster's capacity it would change. " +
+        "So if large no of nodes or racks get added to the cluster, Max Capacity in absolute terms would increase accordingly. ",
       "isVisible": true,
       "isVisible": true,
-      "isRequired": false,
+      "isRequired": true,
       "serviceName": "MAPREDUCE",
       "serviceName": "MAPREDUCE",
-      "category": "Capacity Scheduler"
+      "category": "CapacityScheduler",
+      "unit": "%",
+      "valueRange": [0, 100],
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.minimum-user-limit-percent",
+      "displayName": "Min User Limit",
+      "value": '',
+      "defaultValue": 100,
+      "displayType": "int",
+      "description": "Each queue enforces a limit on the percentage of resources allocated to a user at any given time, " +
+        "if there is competition for them. This user limit can vary between a minimum and maximum value. " +
+        "The former depends on the number of users who have submitted jobs, and the latter is set to this property value. " +
+        "For example, suppose the value of this property is 25. If two users have submitted jobs to a queue, no single user " +
+        "can use more than 50% of the queue resources. If a third user submits a job, no single user can use more than 33% of " +
+        "the queue resources. With 4 or more users, no user can use more than 25% of the queue's resources. " +
+        "A value of 100 implies no user limits are imposed.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "unit": "%",
+      "valueRange": [1, 100],
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.user-limit-factor",
+      "displayName": "User Limit Factor",
+      "value": '',
+      "defaultValue": 1,
+      "displayType": "int",
+      "description": "The multiple of the queue capacity which can be configured to allow a single user to acquire more slots. " +
+        "By default this is set to 1 which ensure that a single user can never take more than the queue's configured capacity " +
+        "irrespective of how idle the cluster is.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.supports-priority",
+      "displayName": "Supports Priority",
+      "value": false,
+      "defaultValue": false,
+      "displayType": "checkbox",
+      "description": "If true, priorities of jobs will be taken into account in scheduling decisions.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.queue.<queue-name>.acl-submit-job",
+      "displayName": "",
+      "value": '',
+      "defaultValue": '',
+      "description": "",
+      "isVisible": false,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "isQueue": true,
+      "filename": 'mapred-queue-acls.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.queue.<queue-name>.acl-administer-jobs",
+      "displayName": "",
+      "value": '',
+      "defaultValue": '',
+      "description": "",
+      "isVisible": false,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "isQueue": true,
+      "filename": 'mapred-queue-acls.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.maximum-initialized-active-tasks",
+      "displayName": "Max initialized active tasks",
+      "value": '',
+      "defaultValue": 200000,
+      "displayType": "int",
+      "description": "The maximum number of tasks, across all jobs in the queue, which can be initialized concurrently. " +
+        "Once the queue's jobs exceed this limit they will be queued on disk.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.maximum-initialized-active-tasks-per-user",
+      "displayName": "Max initialized active tasks per user",
+      "value": '',
+      "defaultValue": 100000,
+      "displayType": "int",
+      "description": "The maximum number of tasks per-user, across all the of the user's jobs in the queue, which " +
+        "can be initialized concurrently. Once the user's jobs exceed this limit they will be queued on disk.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
+    },
+    {
+      "id": "conf-site",
+      "name": "mapred.capacity-scheduler.queue.<queue-name>.init-accept-jobs-factor",
+      "displayName": "Init accept jobs factor",
+      "value": '',
+      "defaultValue": 10,
+      "displayType": "int",
+      "description": "The multiple of (maximum-system-jobs * queue-capacity) used to determine the number of " +
+        "jobs which are accepted by the scheduler. The default value is 10. If number of jobs submitted to " +
+        "the queue exceeds this limit, job submission are rejected.",
+      "isVisible": true,
+      "isRequired": true,
+      "serviceName": "MAPREDUCE",
+      "category": "CapacityScheduler",
+      "isQueue": true,
+      "filename": 'capacity-scheduler.xml'
     }
     }
   ]
   ]

+ 0 - 44
ambari-web/app/data/mapred-queue-acl_default.js

@@ -1,44 +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 = [
-  {
-    name: 'mapred.queue.default.acl-submit-job',
-    value: ' ',
-    description: 'Comma separated list of user and group names that are allowed' +
-      'to submit jobs to the \'default\' queue. The user list and the group list' +
-      'are separated by a blank. For e.g. user1,user2 group1,group2.' +
-      'If set to the special value \'*\', it means all users are allowed to' +
-      'submit jobs. If set to \' \'(i.e. space), no user will be allowed to submit' +
-      'jobs.' +
-      '\n' +
-      'It is only used if authorization is enabled in Map/Reduce by setting the' +
-      'configuration property mapred.acls.enabled to true.' +
-      '\n' +
-      'Irrespective of this ACL configuration, the user who started the cluster and' +
-      'cluster administrators configured via' +
-      'mapreduce.cluster.administrators can submit jobs.'
-  },
-  {
-    name: 'mapred.queue.default.acl-administer-jobs',
-    value: ' ',
-    description: 'Comma separated list of user and group names that are allowed' +
-      'to view job details, kill jobs or modify job\'s priority for all the jobs' +
-      'in the \'default\' queue.'
-  }
-];
-

+ 56 - 0
ambari-web/app/data/mock/step14PolledData/tasks_poll1.js

@@ -0,0 +1,56 @@
+module.exports = {
+  "href": "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests": {
+    "id": 1
+  },
+  "tasks": [
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks": {
+        "id": "1",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "QUEUED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "DATANODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks": {
+        "id": "2",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "QUEUED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "NAMENODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks": {
+        "id": "3",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "QUEUED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "SECONDARY_NAMENODE",
+        "stderr": "",
+        "host_name": "host2",
+        "stage_id": "1"
+      }
+    }
+  ]
+}

+ 56 - 0
ambari-web/app/data/mock/step14PolledData/tasks_poll2.js

@@ -0,0 +1,56 @@
+module.exports = {
+  "href": "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests": {
+    "id": 1
+  },
+  "tasks": [
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks": {
+        "id": "1",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "IN_PROGRESS",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "DATANODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks": {
+        "id": "2",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "QUEUED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "NAMENODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks": {
+        "id": "3",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "QUEUED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "SECONDARY_NAMENODE",
+        "stderr": "",
+        "host_name": "host2",
+        "stage_id": "1"
+      }
+    }
+  ]
+}

+ 56 - 0
ambari-web/app/data/mock/step14PolledData/tasks_poll3.js

@@ -0,0 +1,56 @@
+module.exports = {
+  "href": "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests": {
+    "id": 1
+  },
+  "tasks": [
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks": {
+        "id": "1",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "COMPLETED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "DATANODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks": {
+        "id": "2",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "IN_PROGRESS",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "NAMENODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks": {
+        "id": "3",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "QUEUED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "SECONDARY_NAMENODE",
+        "stderr": "",
+        "host_name": "host2",
+        "stage_id": "1"
+      }
+    }
+  ]
+}

+ 56 - 0
ambari-web/app/data/mock/step14PolledData/tasks_poll4.js

@@ -0,0 +1,56 @@
+module.exports = {
+  "href": "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests": {
+    "id": 1
+  },
+  "tasks": [
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks": {
+        "id": "1",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "COMPLETED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "DATANODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks": {
+        "id": "2",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "COMPLETED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "NAMENODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks": {
+        "id": "3",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "IN_PROGRESS",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "SECONDARY_NAMENODE",
+        "stderr": "",
+        "host_name": "host2",
+        "stage_id": "1"
+      }
+    }
+  ]
+}

+ 56 - 0
ambari-web/app/data/mock/step14PolledData/tasks_poll5.js

@@ -0,0 +1,56 @@
+module.exports = {
+  "href": "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests": {
+    "id": 1
+  },
+  "tasks": [
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks": {
+        "id": "1",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "COMPLETED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "DATANODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks": {
+        "id": "2",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "COMPLETED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "NAMENODE",
+        "stderr": "",
+        "host_name": "localhost.localdomain",
+        "stage_id": "1"
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks": {
+        "id": "3",
+        "attempt_cnt": "0",
+        "exit_code": "999",
+        "stdout": "",
+        "status": "COMPLETED",
+        "command": "INSTALL",
+        "start_time": "-1",
+        "role": "SECONDARY_NAMENODE",
+        "stderr": "",
+        "host_name": "host2",
+        "stage_id": "1"
+      }
+    }
+  ]
+}

+ 15 - 5
ambari-web/app/data/review_configs.js

@@ -119,12 +119,12 @@ module.exports = [
           Ember.Object.create({
           Ember.Object.create({
             display_name: 'Server',
             display_name: 'Server',
             component_value: ''
             component_value: ''
-          })
+          }),
           // TODO: uncomment when ready to integrate with database other than Derby
           // TODO: uncomment when ready to integrate with database other than Derby
-          // Ember.Object.create({
-          //   display_name: 'Database',
-          //   component_value: ''
-          // })
+          Ember.Object.create({
+             display_name: 'Database',
+             component_value: ''
+          })
         ]
         ]
       }),
       }),
       Ember.Object.create({
       Ember.Object.create({
@@ -169,6 +169,16 @@ module.exports = [
 
 
           })
           })
         ]
         ]
+      }),
+      Ember.Object.create({
+        service_name: 'HUE',
+        display_name: 'Hue',
+        service_components: [
+          Ember.Object.create({
+            display_name: 'Server',
+            component_value: ''
+          })
+        ]
       })
       })
 
 
     ]
     ]

+ 8 - 0
ambari-web/app/data/service_components.js

@@ -257,5 +257,13 @@ module.exports = new Ember.Set([
     isMaster: false,
     isMaster: false,
     isClient: true,
     isClient: true,
     description: ''
     description: ''
+  },
+  {
+    service_name: 'HUE',
+    component_name: 'HUE_SERVER',
+    display_name: 'Hue Server',
+    isMaster: true,
+    isClient: false,
+    description: ''
   }
   }
 ]);
 ]);

+ 27 - 7
ambari-web/app/data/service_configs.js

@@ -17,7 +17,7 @@
  */
  */
 
 
 var App = require('app');
 var App = require('app');
-require('models/service_config')
+require('models/service_config');
 
 
 var configProperties = App.ConfigProperties.create();
 var configProperties = App.ConfigProperties.create();
 
 
@@ -27,14 +27,15 @@ module.exports = [
     displayName: 'HDFS',
     displayName: 'HDFS',
     filename: 'hdfs-site',
     filename: 'hdfs-site',
     configCategories: [
     configCategories: [
-      App.ServiceConfigCategory.create({ name: 'NameNode', displayName : 'NameNode'}),
-      App.ServiceConfigCategory.create({ name: 'SNameNode', displayName : 'Secondary Name Node'}),
-      App.ServiceConfigCategory.create({ name: 'DataNode', displayName : 'DataNode'}),
+      App.ServiceConfigCategory.create({ name: 'NameNode', displayName : 'NameNode', hostComponentNames : ['NAMENODE']}),
+      App.ServiceConfigCategory.create({ name: 'SNameNode', displayName : 'Secondary Name Node', hostComponentNames : ['SECONDARY_NAMENODE']}),
+      App.ServiceConfigCategory.create({ name: 'DataNode', displayName : 'DataNode', hostComponentNames : ['DATANODE']}),
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'}),
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'AdvancedCoreSite', displayName : 'Custom core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true}),
       App.ServiceConfigCategory.create({ name: 'AdvancedCoreSite', displayName : 'Custom core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true}),
       App.ServiceConfigCategory.create({ name: 'AdvancedHDFSSite', displayName : 'Custom hdfs-site.xml', siteFileName: 'hdfs-site.xml', canAddProperty: true})
       App.ServiceConfigCategory.create({ name: 'AdvancedHDFSSite', displayName : 'Custom hdfs-site.xml', siteFileName: 'hdfs-site.xml', canAddProperty: true})
     ],
     ],
+    sites: ['global', 'core-site', 'hdfs-site'],
     configs: configProperties.filterProperty('serviceName', 'HDFS')
     configs: configProperties.filterProperty('serviceName', 'HDFS')
   },
   },
 
 
@@ -43,13 +44,14 @@ module.exports = [
     displayName: 'MapReduce',
     displayName: 'MapReduce',
     filename: 'mapred-site',
     filename: 'mapred-site',
     configCategories: [
     configCategories: [
-      App.ServiceConfigCategory.create({ name: 'JobTracker', displayName : 'JobTracker'}),
-      App.ServiceConfigCategory.create({ name: 'TaskTracker', displayName : 'TaskTracker'}),
+      App.ServiceConfigCategory.create({ name: 'JobTracker', displayName : 'JobTracker', hostComponentNames : ['JOBTRACKER']}),
+      App.ServiceConfigCategory.create({ name: 'TaskTracker', displayName : 'TaskTracker', hostComponentNames : ['TASKTRACKER']}),
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'}),
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
-      App.ServiceConfigCategory.create({ name: 'Capacity Scheduler', displayName : 'Capacity Scheduler'}),
+      App.ServiceConfigCategory.create({ name: 'CapacityScheduler', displayName : 'Capacity Scheduler', isCustomView: true, siteFileName: 'capacity-scheduler.xml', siteFileNames: ['capacity-scheduler.xml', 'mapred-queue-acls.xml'], canAddProperty: true}),
       App.ServiceConfigCategory.create({ name: 'AdvancedMapredSite', displayName : 'Custom mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true})
       App.ServiceConfigCategory.create({ name: 'AdvancedMapredSite', displayName : 'Custom mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true})
     ],
     ],
+    sites: ['global', 'core-site', 'mapred-site', 'capacity-scheduler', 'mapred-queue-acls'],
     configs: configProperties.filterProperty('serviceName', 'MAPREDUCE')
     configs: configProperties.filterProperty('serviceName', 'MAPREDUCE')
   },
   },
 
 
@@ -62,6 +64,7 @@ module.exports = [
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'AdvancedHiveSite', displayName : 'Custom hive-site.xml', siteFileName: 'hive-site.xml', canAddProperty: true})
       App.ServiceConfigCategory.create({ name: 'AdvancedHiveSite', displayName : 'Custom hive-site.xml', siteFileName: 'hive-site.xml', canAddProperty: true})
     ],
     ],
+    sites: ['global', 'hive-site'],
     configs: configProperties.filterProperty('serviceName', 'HIVE')
     configs: configProperties.filterProperty('serviceName', 'HIVE')
   },
   },
 
 
@@ -73,6 +76,7 @@ module.exports = [
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'AdvancedWebHCatSite', displayName : 'Custom webhcat-site.xml', siteFileName: 'webhcat-site.xml', canAddProperty: true})
       App.ServiceConfigCategory.create({ name: 'AdvancedWebHCatSite', displayName : 'Custom webhcat-site.xml', siteFileName: 'webhcat-site.xml', canAddProperty: true})
     ],
     ],
+    sites: ['global', 'webhcat-site'],
     configs: configProperties.filterProperty('serviceName', 'WEBHCAT')
     configs: configProperties.filterProperty('serviceName', 'WEBHCAT')
   },
   },
 
 
@@ -87,6 +91,7 @@ module.exports = [
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'AdvancedHbaseSite', displayName : 'Custom hbase-site.xml', siteFileName: 'hbase-site.xml', canAddProperty: true})
       App.ServiceConfigCategory.create({ name: 'AdvancedHbaseSite', displayName : 'Custom hbase-site.xml', siteFileName: 'hbase-site.xml', canAddProperty: true})
     ],
     ],
+    sites: ['global', 'hbase-site'],
     configs: configProperties.filterProperty('serviceName', 'HBASE')
     configs: configProperties.filterProperty('serviceName', 'HBASE')
   },
   },
 
 
@@ -97,6 +102,7 @@ module.exports = [
       App.ServiceConfigCategory.create({ name: 'ZooKeeper Server', displayName : 'ZooKeeper Server'}),
       App.ServiceConfigCategory.create({ name: 'ZooKeeper Server', displayName : 'ZooKeeper Server'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'})
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'})
     ],
     ],
+    sites: ['global'],
     configs: configProperties.filterProperty('serviceName', 'ZOOKEEPER')
     configs: configProperties.filterProperty('serviceName', 'ZOOKEEPER')
   },
   },
 
 
@@ -109,6 +115,7 @@ module.exports = [
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
       App.ServiceConfigCategory.create({ name: 'AdvancedOozieSite', displayName : 'Custom oozie-site.xml', siteFileName: 'oozie-site.xml', canAddProperty: true})
       App.ServiceConfigCategory.create({ name: 'AdvancedOozieSite', displayName : 'Custom oozie-site.xml', siteFileName: 'oozie-site.xml', canAddProperty: true})
     ],
     ],
+    sites: ['global', 'oozie-site'],
     configs: configProperties.filterProperty('serviceName', 'OOZIE')
     configs: configProperties.filterProperty('serviceName', 'OOZIE')
   },
   },
 
 
@@ -118,9 +125,21 @@ module.exports = [
     configCategories: [
     configCategories: [
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'})
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'})
     ],
     ],
+    sites: ['global'],
     configs: configProperties.filterProperty('serviceName', 'NAGIOS')
     configs: configProperties.filterProperty('serviceName', 'NAGIOS')
   },
   },
 
 
+  {
+    serviceName: 'HUE',
+    displayName: 'Hue',
+    filename: 'hue-site',
+    configCategories: [
+      App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'})
+    ],
+    sites: ['hue-site'],
+    configs: configProperties.filterProperty('serviceName', 'HUE')
+  },
+
   {
   {
     serviceName: 'MISC',
     serviceName: 'MISC',
     displayName: 'Misc',
     displayName: 'Misc',
@@ -128,6 +147,7 @@ module.exports = [
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'}),
       App.ServiceConfigCategory.create({ name: 'General', displayName : 'General'}),
       App.ServiceConfigCategory.create({ name: 'Users and Groups', displayName : 'Users and Groups'})
       App.ServiceConfigCategory.create({ name: 'Users and Groups', displayName : 'Users and Groups'})
     ],
     ],
+    sites: ['global'],
     configs: configProperties.filterProperty('serviceName', 'MISC')
     configs: configProperties.filterProperty('serviceName', 'MISC')
   }
   }
 
 

+ 7 - 0
ambari-web/app/data/services.js

@@ -101,4 +101,11 @@ module.exports = [
     isSelected: true,
     isSelected: true,
     isHidden: true
     isHidden: true
   },
   },
+  {
+    serviceName: 'HUE',
+    displayName: 'Hue',
+    isDisabled: false,
+    isSelected: true,
+    isHidden: false
+  }
 ]
 ]

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

@@ -33,6 +33,7 @@ require('router');
 
 
 require('utils/ajax');
 require('utils/ajax');
 require('utils/updater');
 require('utils/updater');
+require('utils/config');
 
 
 require('mappers/server_data_mapper');
 require('mappers/server_data_mapper');
 require('mappers/status_mapper');
 require('mappers/status_mapper');

+ 25 - 1
ambari-web/app/mappers/cluster_mapper.js

@@ -25,6 +25,31 @@ App.clusterMapper = App.QuickDataMapper.create({
         var result = json;
         var result = json;
         result = this.parseIt(result, this.config);
         result = this.parseIt(result, this.config);
         App.store.load(this.get('model'), result);
         App.store.load(this.get('model'), result);
+        
+        var cluster = App.Cluster.find(result.id);
+        var clusterDesiredConfigs = [];
+        // Create desired_configs_array
+        if(json.Clusters.desired_configs){
+          for(var site in json.Clusters.desired_configs){
+            var tag = json.Clusters.desired_configs[site].tag;
+            var configObj = App.ConfigSiteTag.create({
+              site: site,
+              tag: tag,
+              hostOverrides: {}
+            });
+            if(json.Clusters.desired_configs[site].host_overrides!=null){
+              var hostOverridesArray = {};
+              json.Clusters.desired_configs[site].host_overrides.forEach(function(override){
+                var hostname = override.host_name;
+                var tag = override.tag;
+                hostOverridesArray[hostname] = tag;
+              });
+              configObj.set('hostOverrides', hostOverridesArray);
+            }
+            clusterDesiredConfigs.push(configObj);
+          }
+        }
+        cluster.set('desiredConfigs', clusterDesiredConfigs);
       }
       }
     },
     },
     config : {
     config : {
@@ -36,5 +61,4 @@ App.clusterMapper = App.QuickDataMapper.create({
       $racks: [1],
       $racks: [1],
       max_hosts_per_rack: 'Clusters.max_hosts_per_rack'
       max_hosts_per_rack: 'Clusters.max_hosts_per_rack'
     }
     }
-
 });
 });

+ 78 - 15
ambari-web/app/mappers/dataset_mapper.js

@@ -17,15 +17,15 @@
  */
  */
 
 
 App.dataSetMapper = App.QuickDataMapper.create({
 App.dataSetMapper = App.QuickDataMapper.create({
-  model: App.DataSet,
+  model: App.Dataset,
   Jobs_model: App.DataSetJob,
   Jobs_model: App.DataSetJob,
   config: {
   config: {
     id: 'id', // approach 2 : to be calculated (TBC1)
     id: 'id', // approach 2 : to be calculated (TBC1)
     name: 'Feeds.name', // from json
     name: 'Feeds.name', // from json
     source_cluster_name: 'Feeds.clusters.cluster[0].name', // approach1 : from json
     source_cluster_name: 'Feeds.clusters.cluster[0].name', // approach1 : from json
-    target_cluster_name: 'target_cluster_name', // approach 2 : to be calculated (TBC2)
+    $target_cluster: 'none', // will be loaded outside parser ( TBC2 ),
     source_dir: 'Feeds.locations.location.path',
     source_dir: 'Feeds.locations.location.path',
-    schedule: 'Feeds.frequency',
+    $schedule_id: 'none', // will be loaded outside parser
     dataset_jobs: 'dataset_jobs', // TBC3 ( 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
     // all below are unknown at present and may be blank
@@ -40,12 +40,66 @@ App.dataSetMapper = App.QuickDataMapper.create({
   jobs_config: {
   jobs_config: {
     $dataset_id: 'none', // will be loaded outside parser
     $dataset_id: 'none', // will be loaded outside parser
     id: 'Instances.id',
     id: 'Instances.id',
-    start_date: 'start_date_str',
-    end_date: 'end_date_str',
+    start_date: 'start_date',
+    end_date: 'end_date',
     duration: 'duration'
     duration: 'duration'
     //data: 'Instances.details'
     //data: 'Instances.details'
   },
   },
 
 
+  schedule_config: {
+    $dataset_id: 'none', // will be loaded outside parser
+    id: 'id',
+    start_date : 'start_date',
+    end_date :  'end_date',
+    start_time : 'start_time',
+    end_time : 'end_time',
+    timezone : 'timezone',
+    frequency : 'frequency'
+  },
+
+  loadSchedule: function (datasetItemFromJson) {
+    var schedule = {};
+    schedule.id = datasetItemFromJson.id;
+    var source_cluster = datasetItemFromJson.Feeds.clusters.cluster.findProperty("type", "source");
+    var start_date = new Date(source_cluster.validity.start);
+    var end_date = new Date(source_cluster.validity.end);
+
+    var d = new Date();
+    console.debug(d.toString());
+    var start_mm = start_date.getMonth() + 1; // In future may consider using getUTCMonth()
+    var start_dd = start_date.getDay();
+    var start_yyyy = start_date.getFullYear();
+    var end_mm = end_date.getMonth() + 1;
+    var end_dd = end_date.getDay();
+    var end_yyyy = end_date.getFullYear();
+
+    schedule.start_date = start_mm + "/" + start_dd + "/" + start_yyyy;
+    schedule.end_date = end_mm + "/" + end_dd + "/" + end_yyyy;
+
+    var start_hh = start_date.getHours();
+    var start_mi = start_date.getMinutes();
+    var start_ampm = (start_hh < 12 ? 'AM' : 'PM');
+    var end_hh = end_date.getHours();
+    var end_mi = end_date.getMinutes();
+    var end_ampm = (end_hh < 12 ? 'AM' : 'PM');
+
+    if (start_hh) {
+      start_hh %= 12;
+    }
+
+    if (end_hh) {
+      end_hh %= 12;
+    }
+
+    schedule.start_time = start_hh + ":" + start_mi + ":" + start_ampm;
+    schedule.end_time = end_hh + ":" + end_mi + ":" + end_ampm;
+
+    schedule.frequency = datasetItemFromJson.Feeds.frequency;
+    schedule.timezone = datasetItemFromJson.Feeds.timezone;
+    schedule.dataset_id = datasetItemFromJson.id;
+
+    App.store.load(App.Dataset.Schedule, schedule);
+  },
   map: function (json) {
   map: function (json) {
     if (!this.get('model')) {
     if (!this.get('model')) {
       return;
       return;
@@ -59,9 +113,6 @@ App.dataSetMapper = App.QuickDataMapper.create({
           var re = new RegExp(" ", "g");
           var re = new RegExp(" ", "g");
           item.id = item.Feeds.name.replace(re, "_");
           item.id = item.Feeds.name.replace(re, "_");
 
 
-          // TBC2
-          item.target_cluster_name = (item.Feeds.clusters.cluster.findProperty("type", "target")).name;
-
           // TBC3
           // TBC3
           item.dataset_jobs = [];
           item.dataset_jobs = [];
 
 
@@ -107,14 +158,29 @@ App.dataSetMapper = App.QuickDataMapper.create({
           item.target_dir = '';
           item.target_dir = '';
 
 
           var newitem = this.parseIt(item, this.config);
           var newitem = this.parseIt(item, this.config);
+
+          // TBC2 - but shd be loaded after parsing
+          var target_cluster_name = (item.Feeds.clusters.cluster.findProperty("type", "target")).name;
+          var target_cluster_id = (item.Feeds.clusters.cluster.findProperty("type", "target")).name;
+          var re = new RegExp(" ","g");
+
+          newitem.target_cluster_id = target_cluster_id.replace(re,"_");
+
+          newitem.schedule_id = newitem.id;
+
+          this.loadSchedule(item);
+
           dataset_results.push(newitem);
           dataset_results.push(newitem);
         } catch (ex) {
         } catch (ex) {
           console.debug('Exception occured : ' + ex);
           console.debug('Exception occured : ' + ex);
         }
         }
       }, this);
       }, this);
-      console.debug('Before load: App.DataSet.find().content : ' + App.DataSet.find().content);
+
+
+
+      console.debug('Before load: App.Dataset.find().content : ' + App.Dataset.find().content);
       App.store.loadMany(this.get('model'), dataset_results);
       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
         // Child records
@@ -123,12 +189,9 @@ App.dataSetMapper = App.QuickDataMapper.create({
           item.instances.forEach(function (instance) {
           item.instances.forEach(function (instance) {
             instance.Instances.start = new Date(instance.Instances.start); // neeed to be calulated end -start
             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
             instance.Instances.end = new Date(instance.Instances.end); // neeed to be calulated end -start
-
-
             instance.duration = instance.Instances.end - instance.Instances.start;
             instance.duration = instance.Instances.end - instance.Instances.start;
-
-            instance.start_date_str = instance.Instances.start.toString();
-            instance.end_date_str = instance.Instances.end.toString();
+            instance.start_date = instance.Instances.start;
+            instance.end_date = instance.Instances.end;
 
 
             var result = this.parseIt(instance, this.jobs_config);
             var result = this.parseIt(instance, this.jobs_config);
             result.dataset_id = item.id;
             result.dataset_id = item.id;

+ 30 - 2
ambari-web/app/mappers/service_mapper.js

@@ -30,7 +30,8 @@ App.servicesMapper = App.QuickDataMapper.create({
     'NAGIOS',
     'NAGIOS',
     'ZOOKEEPER',
     'ZOOKEEPER',
     'PIG',
     'PIG',
-    'SQOOP'
+    'SQOOP',
+    'HUE'
   ],
   ],
   sortByOrder: function (sortOrder, array) {
   sortByOrder: function (sortOrder, array) {
     var sorted = [];
     var sorted = [];
@@ -117,6 +118,7 @@ App.servicesMapper = App.QuickDataMapper.create({
     work_status: 'HostRoles.state',
     work_status: 'HostRoles.state',
     desired_status: 'HostRoles.desired_state',
     desired_status: 'HostRoles.desired_state',
     component_name: 'HostRoles.component_name',
     component_name: 'HostRoles.component_name',
+    ha_status: 'HostRoles.ha_status',
     host_id: 'HostRoles.host_name',
     host_id: 'HostRoles.host_name',
     $service_id: 'none' /* will be set outside of parse function */
     $service_id: 'none' /* will be set outside of parse function */
   },
   },
@@ -176,10 +178,12 @@ App.servicesMapper = App.QuickDataMapper.create({
 
 
       // Host components
       // Host components
       result = [];
       result = [];
+      var hostComponentToActualConfigsMap = {};
       json.items.forEach(function(item){
       json.items.forEach(function(item){
         item.components.forEach(function(component){
         item.components.forEach(function(component){
           var service = component.ServiceComponentInfo.service_name;
           var service = component.ServiceComponentInfo.service_name;
           component.host_components.forEach(function(host_component){
           component.host_components.forEach(function(host_component){
+            hostComponentToActualConfigsMap[host_component.id] = host_component.HostRoles.actual_configs;
             var comp = this.parseIt(host_component, this.config3);
             var comp = this.parseIt(host_component, this.config3);
             comp.service_id = service;
             comp.service_id = service;
             result.push(comp);
             result.push(comp);
@@ -192,8 +196,32 @@ App.servicesMapper = App.QuickDataMapper.create({
       }, this);
       }, this);
 
 
       App.store.loadMany(this.get('model3'), result);
       App.store.loadMany(this.get('model3'), result);
+      for(var hostComponentId in hostComponentToActualConfigsMap){
+        var hostComponentObj = App.HostComponent.find(hostComponentId);
+        var actualConfigs = [];
+        // Create actual_configs
+        for(var site in hostComponentToActualConfigsMap[hostComponentId]){
+          var tag = hostComponentToActualConfigsMap[hostComponentId][site].tag;
+          var configObj = App.ConfigSiteTag.create({
+            site: site,
+            tag: tag,
+            hostOverrides: {}
+          });
+          var overrides = hostComponentToActualConfigsMap[hostComponentId][site].host_overrides;
+          if(overrides!=null){
+            var hostOverridesArray = {};
+            overrides.forEach(function(override){
+              var hostname = override.host_name;
+              var tag = override.tag;
+              hostOverridesArray[hostname] = tag;
+            });
+            configObj.set('hostOverrides', hostOverridesArray);
+          }
+          actualConfigs.push(configObj);
+        }
+        hostComponentObj.set('actualConfigs', actualConfigs);
+      }
     }
     }
-
     console.log('out service mapper.  Took ' + (new Date().getTime() - start) + 'ms');
     console.log('out service mapper.  Took ' + (new Date().getTime() - start) + 'ms');
   },
   },
 
 

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

@@ -36,7 +36,7 @@ App.targetClusterMapper = App.QuickDataMapper.create({
         try {
         try {
           item.name_node_web_url = (item.Clusters.interfaces.interface.findProperty("type", "readonly")).endpoint;
           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.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.oozie_server_url = (item.Clusters.interfaces.interface.findProperty("type","workflow")).endpoint;
           item.id = item.Clusters.name;
           item.id = item.Clusters.name;
 
 
           var re = new RegExp(" ", "g");
           var re = new RegExp(" ", "g");

+ 132 - 12
ambari-web/app/messages.js

@@ -39,6 +39,7 @@ Em.I18n.translations = {
   'more':'more',
   'more':'more',
   'yes':'Yes',
   'yes':'Yes',
   'no':'No',
   'no':'No',
+  'add': 'Add',
 
 
 
 
   'common.learnMore':'Learn more',
   'common.learnMore':'Learn more',
@@ -79,6 +80,7 @@ Em.I18n.translations = {
   'common.metrics':'Metrics',
   'common.metrics':'Metrics',
   'common.timeRange':'Time Range',
   'common.timeRange':'Time Range',
   'common.name':'Name',
   'common.name':'Name',
+  'common.value':'Value',
   'common.ipAddress':'IP Address',
   'common.ipAddress':'IP Address',
   'common.cpu':'CPU',
   'common.cpu':'CPU',
   'common.ram':'RAM',
   'common.ram':'RAM',
@@ -97,6 +99,7 @@ Em.I18n.translations = {
   'common.maximum':'Maximum',
   'common.maximum':'Maximum',
   'common.start':'Start',
   'common.start':'Start',
   'common.stop':'Stop',
   'common.stop':'Stop',
+  'common.pause':'Pause',
   'common.decommission':'Decommission',
   'common.decommission':'Decommission',
   'common.recommission':'Recommission',
   'common.recommission':'Recommission',
   'common.failure': 'Failure',
   'common.failure': 'Failure',
@@ -114,8 +117,30 @@ Em.I18n.translations = {
   'common.upgrade': 'Upgrade',
   'common.upgrade': 'Upgrade',
   'common.security':'Security',
   'common.security':'Security',
   'common.cluster':'Cluster',
   'common.cluster':'Cluster',
+  'common.add': 'Add',
+  'common.edit': 'Edit',
+  'common.delete': 'Delete',
+  'common.empty': 'Empty',
   'common.exception':'Exception',
   'common.exception':'Exception',
   'common.undo':'Undo',
   'common.undo':'Undo',
+  'common.details':'Details',
+  'common.stats':'Stats',
+  'common.abort': 'Abort',
+  'common.misc': 'Misc',
+
+  'requestInfo.installComponents':'Installing Host Components',
+  'requestInfo.installServices':'Installing Services',
+  'requestInfo.stopAllServices':'Stop All Services',
+  'requestInfo.startAllServices':'Start All Services',
+  'requestInfo.startHostComponent':'Start component',
+  'requestInfo.upgradeHostComponent':'Upgrade component',
+  'requestInfo.stopHostComponent':'Stop component',
+  'requestInfo.installHostComponent':'Install component',
+  'requestInfo.installingHostComponent':'Installing new component',
+  'requestInfo.stopService':'Stop Service',
+  'requestInfo.startService':'Start Service',
+  'requestInfo.serviceStartCheck':'Check Started Services',
+
 
 
   'hostPopup.noServicesToShow':'No services to show',
   'hostPopup.noServicesToShow':'No services to show',
   'hostPopup.noHostsToShow':'No hosts to show',
   'hostPopup.noHostsToShow':'No hosts to show',
@@ -205,7 +230,7 @@ Em.I18n.translations = {
   'installer.step2.header':'Install Options',
   'installer.step2.header':'Install Options',
   'installer.step2.body':'Enter the list of hosts to be included in the cluster and provide your SSH key.',
   'installer.step2.body':'Enter the list of hosts to be included in the cluster and provide your SSH key.',
   'installer.step2.targetHosts':'Target Hosts',
   'installer.step2.targetHosts':'Target Hosts',
-  'installer.step2.targetHosts.info':'Enter a list of host names, one per line',
+  'installer.step2.targetHosts.info':'Enter a list of hosts using the Fully Qualified Domain Name (FQDN), one per line',
   'installer.step2.hostPattern.tooltip.title':'Pattern Expressions',
   'installer.step2.hostPattern.tooltip.title':'Pattern Expressions',
   'installer.step2.hostPattern.tooltip.content':'You can use pattern expressions to specify a number of target hosts. For example, to specify host01.domain thru host10.domain, enter host[01-10].domain in the target hosts textarea.',
   'installer.step2.hostPattern.tooltip.content':'You can use pattern expressions to specify a number of target hosts. For example, to specify host01.domain thru host10.domain, enter host[01-10].domain in the target hosts textarea.',
   'installer.step2.hostName.error.required':'You must specify at least one host name',
   'installer.step2.hostName.error.required':'You must specify at least one host name',
@@ -305,8 +330,9 @@ Em.I18n.translations = {
   'installer.step5.reassign.header':'Select Target Host',
   'installer.step5.reassign.header':'Select Target Host',
   'installer.step5.attention':' hosts not running master services',
   'installer.step5.attention':' hosts not running master services',
   'installer.step5.body':'Assign master components to hosts you want to run them on.',
   'installer.step5.body':'Assign master components to hosts you want to run them on.',
-  'installer.step5.body.hive':'<i class="icon-asterisks">&#10037</i> HiveServer2, Hive Metastore, and WebHCat Server will be co-hosted on the same server.',
+  'installer.step5.body.hive':'<i class="icon-asterisks">&#10037</i> HiveServer2, Hive Metastore, and WebHCat Server will be hosted on the same server.',
   'installer.step5.hostInfo':'%@ (%@, %@ cores)',
   'installer.step5.hostInfo':'%@ (%@, %@ cores)',
+  'installer.step5.hiveGroup':'HiveServer2, WebHCat Server, MySQL Server',
 
 
   'installer.step6.header':'Assign Slaves and Clients',
   'installer.step6.header':'Assign Slaves and Clients',
   'installer.step6.body':'Assign slave and client components to hosts you want to run them on.<br/>Hosts that are assigned master components are shown with <i class=icon-asterisks>&#10037</i>. <br/>&quot;Client&quot; will install ',
   'installer.step6.body':'Assign slave and client components to hosts you want to run them on.<br/>Hosts that are assigned master components are shown with <i class=icon-asterisks>&#10037</i>. <br/>&quot;Client&quot; will install ',
@@ -338,6 +364,8 @@ Em.I18n.translations = {
   'installer.step9.host.status.warning':'Warnings encountered',
   'installer.step9.host.status.warning':'Warnings encountered',
   'installer.step9.host.status.failed':'Failures encountered',
   'installer.step9.host.status.failed':'Failures encountered',
   'installer.step9.host.status.nothingToInstall':'Waiting (Nothing to install)',
   'installer.step9.host.status.nothingToInstall':'Waiting (Nothing to install)',
+  'installer.step9.hosts.status.label.inProgress':'In Progress',
+  'installer.step9.hosts.status.label.warning':'Warning',
   'installer.step9.hostLog.popup.header':'Tasks. executed on ',
   'installer.step9.hostLog.popup.header':'Tasks. executed on ',
   'installer.step9.hostLog.popup.categories.all':'All',
   'installer.step9.hostLog.popup.categories.all':'All',
   'installer.step9.hostLog.popup.categories.pending':'Queued / Pending',
   'installer.step9.hostLog.popup.categories.pending':'Queued / Pending',
@@ -379,7 +407,7 @@ Em.I18n.translations = {
   'installer.step9.serviceStatus.abort.completed':' aborted successfully',
   'installer.step9.serviceStatus.abort.completed':' aborted successfully',
   'installer.step9.serviceStatus.abort.failed':' failed to abort',
   'installer.step9.serviceStatus.abort.failed':' failed to abort',
   'installer.step9.serviceStatus.upgrade.pending':'Preparing to upgrade ',
   'installer.step9.serviceStatus.upgrade.pending':'Preparing to upgrade ',
-  'installer.step9.serviceStatus.upgrade.queued':'Waiting to upgarde ',
+  'installer.step9.serviceStatus.upgrade.queued':'Waiting to upgrade ',
   'installer.step9.serviceStatus.upgrade.inProgress':'Upgrading ',
   'installer.step9.serviceStatus.upgrade.inProgress':'Upgrading ',
   'installer.step9.serviceStatus.upgrade.completed':' upgraded successfully',
   'installer.step9.serviceStatus.upgrade.completed':' upgraded successfully',
   'installer.step9.serviceStatus.upgrade.failed':' failed to upgrade',
   'installer.step9.serviceStatus.upgrade.failed':' failed to upgrade',
@@ -430,6 +458,8 @@ Em.I18n.translations = {
   'installer.step14.status.success': 'Successfully reassigned {0}',
   'installer.step14.status.success': 'Successfully reassigned {0}',
   'installer.step14.status.failed': 'Failed to reassign {0}',
   'installer.step14.status.failed': 'Failed to reassign {0}',
   'installer.step14.status.info': 'Reassigning {0}. \nPlease wait while all tasks will be completed.',
   'installer.step14.status.info': 'Reassigning {0}. \nPlease wait while all tasks will be completed.',
+  'installer.step14.retry': 'You can click on the Retry or Abort button to retry failed task or abort changes',
+  'installer.step14.abortError': 'Error in aborting changes.',
 
 
   'installer.stackUpgrade.header':'Stack Upgrade Wizard',
   'installer.stackUpgrade.header':'Stack Upgrade Wizard',
   'installer.stackUpgrade.step1.newVersion':'New Version',
   'installer.stackUpgrade.step1.newVersion':'New Version',
@@ -453,15 +483,18 @@ Em.I18n.translations = {
   "You can click on the Retry button to retry upgrading the failed components. Alternatively you can proceed and retry upgrade on individual components in the Host Detail page.",
   "You can click on the Retry button to retry upgrading the failed components. Alternatively you can proceed and retry upgrade on individual components in the Host Detail page.",
   'installer.stackUpgrade.step3.status.failed':"Failed to upgrade hosts. Click on each host to see what might have gone wrong.\n After fixing the problem, click the Retry button",
   'installer.stackUpgrade.step3.status.failed':"Failed to upgrade hosts. Click on each host to see what might have gone wrong.\n After fixing the problem, click the Retry button",
   'installer.stackUpgrade.step3.host.nothingToUpgrade':'Waiting (Nothing to upgrade)',
   'installer.stackUpgrade.step3.host.nothingToUpgrade':'Waiting (Nothing to upgrade)',
-  'installer.stackUpgrade.step3.service.upgraded':'{0} upgraded',
-  'installer.stackUpgrade.step3.service.upgrading':'{0} upgrade in progress',
-  'installer.stackUpgrade.step3.service.pending':'{0} upgrade pending',
-  'installer.stackUpgrade.step3.service.failedUpgrade':'{0} failed to upgrade',
+  'installer.stackUpgrade.step3.service.upgraded':'Services upgraded',
+  'installer.stackUpgrade.step3.service.upgrading':'Services upgrade in progress',
+  'installer.stackUpgrade.step3.service.pending':'Services upgrade pending',
+  'installer.stackUpgrade.step3.service.failedUpgrade':'Services failed to upgrade',
   'installer.stackUpgrade.step3.service.stopped':'All Services stopped',
   'installer.stackUpgrade.step3.service.stopped':'All Services stopped',
   'installer.stackUpgrade.step3.service.stopping':'All Services stopping',
   'installer.stackUpgrade.step3.service.stopping':'All Services stopping',
   'installer.stackUpgrade.step3.service.stopFail':'All Services failed to stop',
   'installer.stackUpgrade.step3.service.stopFail':'All Services failed to stop',
+  'installer.stackUpgrade.step3.service.stopPending':'All Services stop pending',
   'installer.stackUpgrade.step3.retry.upgrade':'Retry Upgrade',
   'installer.stackUpgrade.step3.retry.upgrade':'Retry Upgrade',
   'installer.stackUpgrade.step3.retry.services':'Retry stopping services',
   'installer.stackUpgrade.step3.retry.services':'Retry stopping services',
+  'installer.stackUpgrade.step3.upgrade.header':'All Services upgrade',
+  'installer.stackUpgrade.step3.stop.header':'All Services stop',
 
 
   'form.create':'Create',
   'form.create':'Create',
   'form.save':'Save',
   'form.save':'Save',
@@ -560,6 +593,9 @@ Em.I18n.translations = {
   'admin.cluster.upgradeAvailable':'Upgrade available',
   'admin.cluster.upgradeAvailable':'Upgrade available',
   'admin.cluster.upgradeUnavailable':'Upgrade unavailable',
   'admin.cluster.upgradeUnavailable':'Upgrade unavailable',
 
 
+  'admin.misc.header': 'Service user accounts',
+  'admin.misc.nothingToShow': 'No user accounts to display',
+
   'services.service.start':'Start',
   'services.service.start':'Start',
   'services.service.stop':'Stop',
   'services.service.stop':'Stop',
   'services.service.summary.version':'Version',
   'services.service.summary.version':'Version',
@@ -602,6 +638,7 @@ Em.I18n.translations = {
   'services.service.actions.run.compaction':'Run Compaction',
   'services.service.actions.run.compaction':'Run Compaction',
   'services.service.actions.run.smoke':'Run Smoke Test',
   'services.service.actions.run.smoke':'Run Smoke Test',
   'services.service.actions.reassign.master':'Reassign {0}',
   'services.service.actions.reassign.master':'Reassign {0}',
+  'services.service.actions.reassign.master.hive':'Reassign HiveServer2, WebHCat Server, MySQL Server',
   'services.service.actions.maintenance':'Maintenance',
   'services.service.actions.maintenance':'Maintenance',
   'services.service.summary.unknown':'unknown',
   'services.service.summary.unknown':'unknown',
   'services.service.summary.notRunning':'Not Running',
   'services.service.summary.notRunning':'Not Running',
@@ -692,19 +729,29 @@ Em.I18n.translations = {
   'services.service.info.summary.nagios.noAlerts':'No alerts',
   'services.service.info.summary.nagios.noAlerts':'No alerts',
   'services.service.info.summary.nagios.alerts':'Nagios service required for viewing alerts',
   'services.service.info.summary.nagios.alerts':'Nagios service required for viewing alerts',
 
 
-  'services.service.config.startService':'Start Service',
+  'services.service.config.restartService':'Restart Service',
+  'services.service.config.restartService.TooltipMessage':'<b>Restart Service</b><br>Stale configuration used by {0} components on {1} hosts:{2}',
   'services.service.config.saveConfig':'Service configuration applied successfully',
   'services.service.config.saveConfig':'Service configuration applied successfully',
   'services.service.config.stopService':'Stop Service',
   'services.service.config.stopService':'Stop Service',
   'services.service.config.msgServiceStop':'Stop the service and wait till it stops completely. Thereafter you can apply configuration changes',
   'services.service.config.msgServiceStop':'Stop the service and wait till it stops completely. Thereafter you can apply configuration changes',
   'services.service.config.msgHDFSMapRServiceStop':'Stop HDFS and MapReduce. Wait till both of them stops completely. Thereafter you can apply configuration changes',
   'services.service.config.msgHDFSMapRServiceStop':'Stop HDFS and MapReduce. Wait till both of them stops completely. Thereafter you can apply configuration changes',
   'services.service.config.failCreateConfig' : 'Failure in creating service configuration',
   'services.service.config.failCreateConfig' : 'Failure in creating service configuration',
   'services.service.config.failSaveConfig':'Failure in applying service configuration',
   'services.service.config.failSaveConfig':'Failure in applying service configuration',
+  'services.service.config.failSaveConfigHostExceptions':'Failure in applying service configuration host exceptions',
+  'services.service.config.addPropertyWindow.errorMessage':'This is required',
+  'services.service.config.addPropertyWindow.error.derivedKey':'Cannot add a known derived property',
 
 
   'services.add.header':'Add Service Wizard',
   'services.add.header':'Add Service Wizard',
   'services.reassign.header':'Reassign Master Wizard',
   'services.reassign.header':'Reassign Master Wizard',
   'services.service.add':'Add Service',
   'services.service.add':'Add Service',
+  'services.service.startAll':'Start All',
+  'services.service.stopAll':'Stop All',
 
 
   /** services page constants **/
   /** services page constants **/
+
+  'service.hbase.activeMaster': 'Active Master',
+  'service.hbase.passiveMasters': 'and {0} Standby Masters',
+
   'services.hive.client': 'Hive Client',
   'services.hive.client': 'Hive Client',
   'services.hive.clients': 'Hive Clients',
   'services.hive.clients': 'Hive Clients',
 
 
@@ -712,6 +759,8 @@ Em.I18n.translations = {
   'services.oozie.clients': 'Oozie Clients',
   'services.oozie.clients': 'Oozie Clients',
   'services.oozie.webUi': 'Oozie Web UI',
   'services.oozie.webUi': 'Oozie Web UI',
 
 
+  'services.hue.webUi': 'Hue Web UI',
+
   'services.ganglia.webUi': 'Ganglia Web UI',
   'services.ganglia.webUi': 'Ganglia Web UI',
   'services.ganglia.monitors': 'Ganglia Monitors',
   'services.ganglia.monitors': 'Ganglia Monitors',
 
 
@@ -719,9 +768,43 @@ Em.I18n.translations = {
   'services.zookeeper.title': '{0} ZooKeepers',
   'services.zookeeper.title': '{0} ZooKeepers',
   'services.zookeeper.postfix': 'running',
   'services.zookeeper.postfix': 'running',
 
 
+  'services.mapReduce.config.addQueue':'Add Queue',
+  'services.mapReduce.config.editQueue':'Edit Queue',
+  'services.mapReduce.config.capacitySchedulerXml':'Custom capacity-scheduler.xml',
+  'services.mapReduce.config.queue.header':'Queues',
+  'services.mapReduce.config.queue.name':'Queue Name',
+  'services.mapReduce.config.queue.groups':'Groups',
+  'services.mapReduce.config.queue.capacity':'Capacity',
+  'services.mapReduce.config.queue.maxCapacity':'Max Capacity',
+  'services.mapReduce.config.queue.minUserLimit':'Min User Limit',
+  'services.mapReduce.config.queue.userLimitFactor':'User Limit Factor',
+  'services.mapReduce.config.queue.supportsPriority': 'Supports priority',
+  'services.mapReduce.config.queue.adminUsers':'Admin Users',
+  'services.mapReduce.config.queue.adminGroups':'Admin Groups',
+  'services.mapReduce.config.queue.maxActiveTasks':'Max active initialized tasks',
+  'services.mapReduce.config.queue.maxActiveTasksPerUser':'Max active initialized tasks per user',
+  'services.mapReduce.config.queue.initAcceptJobsFactor':'Init accept jobs factor',
+  'services.mapReduce.extraConfig.queue.name':'Queue name',
+  'services.mapReduce.description.queue.name':'Name of the queue',
+  'services.mapReduce.description.queue.submit.user':"Comma separated list of usernames that are allowed to submit jobs to the queue. " +
+    "If set to the special value '*', it means all users are allowed to submit jobs.",
+  'services.mapReduce.description.queue.admin.user':"Comma separated list of usernames that are allowed to delete jobs or modify job's priority for " +
+    "jobs not owned by the current user in the queue.  If set to the special value '*', it means all users are " +
+    "allowed to do this operation.",
+  'services.mapReduce.description.queue.submit.group':'Comma separated list of group names that are allowed to submit jobs to the queue.',
+  'services.mapReduce.description.queue.admin.group':"Comma separated list of group names that are allowed to delete jobs or modify job's priority " +
+    "for jobs not owned by the current user in the queue.",
+
+  'services.hbase.master.error':'None of the HBase masters is active',
+
   'hosts.host.add':'Add New Hosts',
   'hosts.host.add':'Add New Hosts',
   'hosts.host.back':'Back to Hosts',
   'hosts.host.back':'Back to Hosts',
   'hosts.table.noHosts':'No hosts to display',
   'hosts.table.noHosts':'No hosts to display',
+  
+  'hosts.selectHostsDialog.title': 'Select Exception Hosts',
+  'hosts.selectHostsDialog.message': 'Select hosts where the exception has to be applied',
+  'hosts.selectHostsDialog.filter.placeHolder': 'Filter...',
+  'hosts.selectHostsDialog.selectedHostsLink': '{0} out of {1} hosts selected',
 
 
   'hosts.host.metrics.cpu':'CPU Usage',
   'hosts.host.metrics.cpu':'CPU Usage',
   'hosts.host.metrics.cpu.displayNames.cpu_wio':'CPU I/O Idle',
   'hosts.host.metrics.cpu.displayNames.cpu_wio':'CPU I/O Idle',
@@ -768,6 +851,7 @@ Em.I18n.translations = {
   'hosts.host.healthStatus.heartBeatNotReceived':'The server has not received a heartbeat from this host for more than 3 minutes.',
   'hosts.host.healthStatus.heartBeatNotReceived':'The server has not received a heartbeat from this host for more than 3 minutes.',
   'hosts.host.healthStatus.mastersDown':"The following master components are down:\n",
   'hosts.host.healthStatus.mastersDown':"The following master components are down:\n",
   'hosts.host.healthStatus.slavesDown':"The following slave components are down:\n",
   'hosts.host.healthStatus.slavesDown':"The following slave components are down:\n",
+  'hosts.host.healthStatus.allUp':'All components are up',
   'hosts.host.healthStatusCategory.green': "Healthy",
   'hosts.host.healthStatusCategory.green': "Healthy",
   'hosts.host.healthStatusCategory.red': "Master Down",
   'hosts.host.healthStatusCategory.red': "Master Down",
   'hosts.host.healthStatusCategory.orange': "Slave Down",
   'hosts.host.healthStatusCategory.orange': "Slave Down",
@@ -953,23 +1037,59 @@ Em.I18n.translations = {
   'apps.isRunning.popup.title':'Is running',
   'apps.isRunning.popup.title':'Is running',
   'apps.isRunning.popup.content':'Job is running now',
   'apps.isRunning.popup.content':'Job is running now',
 
 
+  'mirroring.dataset.createNewDataset':'Create New Dataset',
+  'mirroring.dataset.newDataset':'New Dataset',
+  'mirroring.dataset.editDataset':'Edit Dataset',
+  'mirroring.dataset.selectTargetClusters':'Select Target Cluster...',
+  'mirroring.dataset.name':'Name',
+  'mirroring.dataset.save': 'Save & Run',
+  'mirroring.dataset.sourceDir':'Source Cluster Directory',
+  'mirroring.dataset.target':'Target',
+  'mirroring.dataset.source':'Source',
+  'mirroring.dataset.avgData':'Avg. Data',
+  'mirroring.dataset.dateCreated':'Date Created',
+  'mirroring.dataset.targetDir':'Target Cluster Directory',
+  'mirroring.dataset.schedule':'Schedule',
+  'mirroring.dataset.schedule.to':'to',
+  'mirroring.dataset.schedule.repeatEvery':'Repeat every ',
+  'mirroring.dataset.addTargetCluster':'Add Target Cluster',
+  'mirroring.dataset.toggle.active':'Activate',
+  'mirroring.dataset.toggle.suspended':'Suspend',
+
+  'mirroring.targetcluster.addCluster':'Add Cluster',
+  'mirroring.targetcluster.testConnection':'Test Connection',
+  'mirroring.targetcluster.enterClusterName':'Name of the Target Cluster',
+
   'mirroring.table.noDatasets':'No datasets to display',
   'mirroring.table.noDatasets':'No datasets to display',
   'mirroring.table.datasetSource':'Dataset Source',
   'mirroring.table.datasetSource':'Dataset Source',
   'mirroring.table.lastSuccess':'Last Success',
   'mirroring.table.lastSuccess':'Last Success',
   'mirroring.table.lastFail':'Last Fail',
   'mirroring.table.lastFail':'Last Fail',
   'mirroring.table.lastDuration':'Last Duration',
   'mirroring.table.lastDuration':'Last Duration',
   'mirroring.table.avgData':'Avg Data',
   'mirroring.table.avgData':'Avg Data',
+  'mirroring.table.noJobs':'No jobs to display',
+  'mirroring.table.jobId':'Job ID',
+  'mirroring.table.start':'Start',
+  'mirroring.table.end':'End',
+  'mirroring.table.duration':'Duration',
+  'mirroring.table.data':'Data',
+
+  'mirroring.sidebar.header.history': 'History',
+  'mirroring.sidebar.header.clusters': 'Target Clusters',
+  'mirroring.sidebar.popup.clusters.header': 'Cluster management',
+  'mirroring.sidebar.popup.clusters.body': 'Here will be some content',
+
 
 
   'menu.item.dashboard':'Dashboard',
   'menu.item.dashboard':'Dashboard',
   'menu.item.heatmaps':'Heatmaps',
   'menu.item.heatmaps':'Heatmaps',
   'menu.item.services':'Services',
   'menu.item.services':'Services',
   'menu.item.hosts':'Hosts',
   'menu.item.hosts':'Hosts',
-  'menu.item.jobs':'Jobs',
   'menu.item.mirroring':'Mirroring',
   'menu.item.mirroring':'Mirroring',
+  'menu.item.jobs':'Jobs',
   'menu.item.admin':'Admin',
   'menu.item.admin':'Admin',
 
 
   'common.combobox.placeholder': 'Filter...',
   'common.combobox.placeholder': 'Filter...',
-  'common.combobox.dropdown.1': 'Modified properties',
-  'common.combobox.dropdown.2': 'Properties needing restart',
+  'common.combobox.dropdown.1': 'Overridden properties',
+  'common.combobox.dropdown.2': 'Modified properties',
+  'common.combobox.dropdown.3': 'Properties needing restart'
 
 
-};
+};

+ 6 - 1
ambari-web/app/models/cluster.js

@@ -25,7 +25,12 @@ App.Cluster = DS.Model.extend({
   version: DS.attr('string'),
   version: DS.attr('string'),
   hosts: DS.hasMany('App.Host'),
   hosts: DS.hasMany('App.Host'),
   racks: DS.hasMany('App.Rack'),
   racks: DS.hasMany('App.Rack'),
-  maxHostsPerRack: DS.attr('number')
+  maxHostsPerRack: DS.attr('number'),
+  /**
+   * Array containing desired configs. New array
+   * should be set by instances of class.
+   */
+  desiredConfigs: null
 });
 });
 
 
 App.Cluster.FIXTURES = [/*
 App.Cluster.FIXTURES = [/*

+ 4 - 1
ambari-web/app/models/cluster_states.js

@@ -19,7 +19,10 @@ var App = require('app');
 
 
 App.clusterStatus = Ember.Object.create({
 App.clusterStatus = Ember.Object.create({
   clusterName: '',
   clusterName: '',
-  validStates: ['CLUSTER_NOT_CREATED_1', 'CLUSTER_DEPLOY_PREP_2', 'CLUSTER_INSTALLING_3', 'SERVICE_STARTING_3', 'CLUSTER_INSTALLED_4',  'CLUSTER_STARTED_5', 'ADD_HOSTS_DEPLOY_PREP_2', 'ADD_HOSTS_INSTALLING_3', 'ADD_HOSTS_INSTALLED_4', 'ADD_HOSTS_COMPLETED_5'],
+  validStates: ['CLUSTER_NOT_CREATED_1', 'CLUSTER_DEPLOY_PREP_2', 'CLUSTER_INSTALLING_3', 'SERVICE_STARTING_3', 'CLUSTER_INSTALLED_4',  'CLUSTER_STARTED_5',
+    'ADD_HOSTS_DEPLOY_PREP_2', 'ADD_HOSTS_INSTALLING_3', 'ADD_HOSTS_INSTALLED_4', 'ADD_HOSTS_COMPLETED_5',
+    'ADD_SERVICES_DEPLOY_PREP_2', 'ADD_SERVICES_INSTALLING_3', 'ADD_SERVICES_INSTALLED_4', 'ADD_SERVICES_COMPLETED_5',
+    'STOPPING_SERVICES', 'STACK_UPGRADING', 'STACK_UPGRADE_FAILED', 'STACK_UPGRADED', 'STACK_UPGRADE_COMPLETED'],
   clusterState: 'CLUSTER_NOT_CREATED_1',
   clusterState: 'CLUSTER_NOT_CREATED_1',
   wizardControllerName: null,
   wizardControllerName: null,
   localdb: null,
   localdb: null,

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