瀏覽代碼

AMBARI-978. Refactor App Browser Code. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1406443 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父節點
當前提交
9c6e8bc39c

+ 2 - 0
AMBARI-666-CHANGES.txt

@@ -362,6 +362,8 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
+  AMBARI-978. Refactor App Browser code. (yusaku)
+
   AMBARI-977. Refactor Wizard and Cluster Management code. (yusaku)
 
   AMBARI-941. More refactoring of Wizards in Ambari Web. (yusaku)

+ 1163 - 0
ambari-web/app/assets/data/dashboard/services.json

@@ -0,0 +1,1163 @@
+{
+  "href" : "http://ambari/clusters/mycluster/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=*,components/*,components/host_components/*",
+  "items" : [
+    {
+      "href" : "http://ambari/clusters/mycluster/services/HBASE",
+      "Services" : {
+        "display_name" : "HBase",
+        "description" : "Apache HDFS-based Non-relational Distributed Database",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": false, \"editable\": true, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "HBASE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_MASTER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HBASE_MASTER",
+            "service_name" : "HBASE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/HBASE_MASTER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "5",
+                "component_name" : "HBASE_MASTER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_MASTER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "HBASE_MASTER",
+                    "service_name" : "HBASE"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_REGIONSERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HBASE_REGIONSERVER",
+            "service_name" : "HBASE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/HBASE_REGIONSERVER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "24",
+                "component_name" : "HBASE_REGIONSERVER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_REGIONSERVER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "HBASE_REGIONSERVER",
+                    "service_name" : "HBASE"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HBASE_CLIENT",
+            "service_name" : "HBASE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/HBASE_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "29",
+                "component_name" : "HBASE_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "HBASE_CLIENT",
+                    "service_name" : "HBASE"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/PIG",
+      "Services" : {
+        "display_name" : "Pig",
+        "description" : "Platform for Analyzing Large Data Sets",
+        "attributes" : "{ \"runnable\": false, \"mustInstall\": false, \"editable\": true, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "INSTALLED",
+        "service_name" : "PIG"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/PIG/components/PIG_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "PIG_CLIENT",
+            "service_name" : "PIG"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/PIG_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "30",
+                "component_name" : "PIG_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/PIG/components/PIG_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "PIG_CLIENT",
+                    "service_name" : "PIG"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/TEMPLETON",
+      "Services" : {
+        "display_name" : "Templeton",
+        "description" : "Webservice APIs for Apache Hadoop",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": false, \"editable\": true, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "TEMPLETON"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/TEMPLETON/components/TEMPLETON_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "TEMPLETON_CLIENT",
+            "service_name" : "TEMPLETON"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/TEMPLETON_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "34",
+                "component_name" : "TEMPLETON_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/TEMPLETON/components/TEMPLETON_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "TEMPLETON_CLIENT",
+                    "service_name" : "TEMPLETON"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/TEMPLETON/components/TEMPLETON_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "TEMPLETON_SERVER",
+            "service_name" : "TEMPLETON"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/TEMPLETON_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "8",
+                "component_name" : "TEMPLETON_SERVER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/TEMPLETON/components/TEMPLETON_SERVER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "TEMPLETON_SERVER",
+                    "service_name" : "TEMPLETON"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER",
+      "Services" : {
+        "display_name" : "ZooKeeper",
+        "description" : "Centralized Service for Configuration Management and Distribution Synchronization",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": false, \"editable\": false, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "ZOOKEEPER"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER/components/ZOOKEEPER_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "ZOOKEEPER_SERVER",
+            "service_name" : "ZOOKEEPER"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/ZOOKEEPER_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "4",
+                "component_name" : "ZOOKEEPER_SERVER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER/components/ZOOKEEPER_SERVER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "ZOOKEEPER_SERVER",
+                    "service_name" : "ZOOKEEPER"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER/components/ZOOKEEPER_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "ZOOKEEPER_CLIENT",
+            "service_name" : "ZOOKEEPER"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/ZOOKEEPER_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "28",
+                "component_name" : "ZOOKEEPER_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER/components/ZOOKEEPER_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "ZOOKEEPER_CLIENT",
+                    "service_name" : "ZOOKEEPER"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE",
+      "Services" : {
+        "display_name" : "MapReduce",
+        "description" : "Apache Hadoop Distributed Processing Framework",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": true, \"editable\": false, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "MAPREDUCE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/JOBTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "JOBTRACKER",
+            "service_name" : "MAPREDUCE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/JOBTRACKER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "3",
+                "component_name" : "JOBTRACKER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "metrics" : {
+                "rpc" : {
+                  "rpcAuthorizationSuccesses" : 8,
+                  "SentBytes" : 187411672,
+                  "rpcAuthorizationFailures" : 0,
+                  "ReceivedBytes" : 570755511,
+                  "NumOpenConnections" : 0,
+                  "callQueueLen" : 0,
+                  "RpcQueueTime_num_ops" : 1751188,
+                  "rpcAuthenticationSuccesses" : 0,
+                  "RpcProcessingTime_num_ops" : 1751188,
+                  "RpcProcessingTime_avg_time" : 0.30303030303030304,
+                  "rpcAuthenticationFailures" : 0,
+                  "RpcQueueTime_avg_time" : 1.6969696969696975
+                },
+                "rpcdetailed" : {
+                  "getProtocolVersion_avg_time" : 0.0,
+                  "getProtocolVersion_num_ops" : 11
+                },
+                "jvm" : {
+                  "memHeapCommittedM" : 185.1875,
+                  "logFatal" : 0,
+                  "threadsBlocked" : 0,
+                  "gcCount" : 165,
+                  "threadsWaiting" : 59,
+                  "logWarn" : 0,
+                  "logError" : 0,
+                  "memNonHeapCommittedM" : 38.722656,
+                  "memNonHeapUsedM" : 25.408173,
+                  "gcTimeMillis" : 3812,
+                  "logInfo" : 3,
+                  "threadsNew" : 0,
+                  "memHeapUsedM" : 150.10947,
+                  "threadsTerminated" : 0,
+                  "threadsTimedWaiting" : 10,
+                  "threadsRunnable" : 6
+                },
+                "metricssystem" : {
+                  "dropped_pub_all" : 0,
+                  "num_sources" : 6,
+                  "publish_max_time" : 543.0,
+                  "publish_num_ops" : 55219,
+                  "snapshot_stdev_time" : 0.37796447300922725,
+                  "snapshot_num_ops" : 386539,
+                  "publish_stdev_time" : 0.0,
+                  "num_sinks" : 1,
+                  "publish_imin_time" : 0.0,
+                  "snapshot_min_time" : 0.0,
+                  "snapshot_imin_time" : 0.0,
+                  "snapshot_imax_time" : 1.0,
+                  "publish_avg_time" : 0.0,
+                  "publish_min_time" : 0.0,
+                  "snapshot_max_time" : 694.0,
+                  "publish_imax_time" : 1.401298464324817E-45,
+                  "snapshot_avg_time" : 0.14285714285714285
+                }
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/JOBTRACKER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "JOBTRACKER",
+                    "service_name" : "MAPREDUCE"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "MAPREDUCE_CLIENT",
+            "service_name" : "MAPREDUCE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/MAPREDUCE_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "27",
+                "component_name" : "MAPREDUCE_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "MAPREDUCE_CLIENT",
+                    "service_name" : "MAPREDUCE"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/TASKTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "TASKTRACKER",
+            "service_name" : "MAPREDUCE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/TASKTRACKER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "22",
+                "component_name" : "TASKTRACKER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "metrics" : {
+                "rpc" : {
+                  "rpcAuthorizationSuccesses" : 14,
+                  "SentBytes" : 11141,
+                  "rpcAuthorizationFailures" : 0,
+                  "ReceivedBytes" : 40426,
+                  "NumOpenConnections" : 0,
+                  "callQueueLen" : 0,
+                  "RpcQueueTime_num_ops" : 93,
+                  "rpcAuthenticationSuccesses" : 0,
+                  "RpcProcessingTime_num_ops" : 93,
+                  "RpcProcessingTime_avg_time" : 0.4,
+                  "rpcAuthenticationFailures" : 0,
+                  "RpcQueueTime_avg_time" : 0.0
+                },
+                "rpcdetailed" : {
+                  "getProtocolVersion_avg_time" : 0.0,
+                  "getProtocolVersion_num_ops" : 14
+                },
+                "jvm" : {
+                  "memHeapCommittedM" : 27.3125,
+                  "logFatal" : 0,
+                  "threadsBlocked" : 0,
+                  "gcCount" : 46316,
+                  "threadsWaiting" : 15,
+                  "logWarn" : 0,
+                  "logError" : 0,
+                  "memNonHeapCommittedM" : 33.75,
+                  "memNonHeapUsedM" : 23.388573,
+                  "gcTimeMillis" : 367178,
+                  "logInfo" : 3,
+                  "threadsNew" : 0,
+                  "memHeapUsedM" : 23.116539,
+                  "threadsTerminated" : 0,
+                  "threadsTimedWaiting" : 7,
+                  "threadsRunnable" : 6
+                },
+                "metricssystem" : {
+                  "dropped_pub_all" : 0,
+                  "num_sources" : 6,
+                  "publish_max_time" : 808.0,
+                  "publish_num_ops" : 55201,
+                  "snapshot_stdev_time" : 0.0,
+                  "snapshot_num_ops" : 386413,
+                  "publish_stdev_time" : 0.0,
+                  "num_sinks" : 1,
+                  "publish_imin_time" : 0.0,
+                  "snapshot_min_time" : 0.0,
+                  "snapshot_imin_time" : 0.0,
+                  "snapshot_imax_time" : 1.401298464324817E-45,
+                  "publish_avg_time" : 0.0,
+                  "publish_min_time" : 0.0,
+                  "snapshot_max_time" : 656.0,
+                  "publish_imax_time" : 1.401298464324817E-45,
+                  "snapshot_avg_time" : 0.0
+                }
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/TASKTRACKER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "TASKTRACKER",
+                    "service_name" : "MAPREDUCE"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/SQOOP",
+      "Services" : {
+        "display_name" : "Sqoop",
+        "description" : "Tool for transferring bulk data between Apache Hadoop and structured datastores such as relational databases",
+        "attributes" : "{ \"runnable\": false, \"mustInstall\": false, \"editable\": true, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "INSTALLED",
+        "service_name" : "SQOOP"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/SQOOP/components/SQOOP_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "SQOOP_CLIENT",
+            "service_name" : "SQOOP"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/SQOOP_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "31",
+                "component_name" : "SQOOP_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/SQOOP/components/SQOOP_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "SQOOP_CLIENT",
+                    "service_name" : "SQOOP"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/HDFS",
+      "Services" : {
+        "display_name" : "HDFS",
+        "description" : "Apache Hadoop Distributed File System",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": true, \"editable\": false, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "HDFS"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/DATANODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "DATANODE",
+            "service_name" : "HDFS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/DATANODE",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "23",
+                "component_name" : "DATANODE",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "metrics" : {
+                "rpc" : {
+                  "rpcAuthorizationSuccesses" : 4,
+                  "SentBytes" : 1350,
+                  "rpcAuthorizationFailures" : 0,
+                  "ReceivedBytes" : 2006,
+                  "NumOpenConnections" : 0,
+                  "callQueueLen" : 0,
+                  "RpcQueueTime_num_ops" : 7,
+                  "rpcAuthenticationSuccesses" : 0,
+                  "RpcProcessingTime_num_ops" : 7,
+                  "RpcProcessingTime_avg_time" : 1.0,
+                  "rpcAuthenticationFailures" : 0,
+                  "RpcQueueTime_avg_time" : 0.0
+                },
+                "rpcdetailed" : {
+                  "getProtocolVersion_avg_time" : 0.0,
+                  "getProtocolVersion_num_ops" : 2
+                },
+                "jvm" : {
+                  "memHeapCommittedM" : 84.3125,
+                  "logFatal" : 0,
+                  "threadsBlocked" : 0,
+                  "gcCount" : 1229,
+                  "threadsWaiting" : 8,
+                  "logWarn" : 0,
+                  "logError" : 0,
+                  "memNonHeapCommittedM" : 23.375,
+                  "memNonHeapUsedM" : 21.495056,
+                  "gcTimeMillis" : 8111,
+                  "logInfo" : 3,
+                  "threadsNew" : 0,
+                  "memHeapUsedM" : 28.507965,
+                  "threadsTerminated" : 0,
+                  "threadsTimedWaiting" : 8,
+                  "threadsRunnable" : 12
+                },
+                "metricssystem" : {
+                  "dropped_pub_all" : 0,
+                  "num_sources" : 5,
+                  "publish_max_time" : 501.0,
+                  "publish_num_ops" : 55260,
+                  "snapshot_stdev_time" : 0.408248290463863,
+                  "snapshot_num_ops" : 331565,
+                  "publish_stdev_time" : 0.0,
+                  "num_sinks" : 1,
+                  "publish_imin_time" : 1.0,
+                  "snapshot_min_time" : 0.0,
+                  "snapshot_imin_time" : 0.0,
+                  "snapshot_imax_time" : 1.0,
+                  "publish_avg_time" : 1.0,
+                  "publish_min_time" : 0.0,
+                  "snapshot_max_time" : 585.0,
+                  "publish_imax_time" : 1.0,
+                  "snapshot_avg_time" : 0.16666666666666669
+                }
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HDFS/components/DATANODE",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "DATANODE",
+                    "service_name" : "HDFS"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/HDFS_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HDFS_CLIENT",
+            "service_name" : "HDFS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/HDFS_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "26",
+                "component_name" : "HDFS_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HDFS/components/HDFS_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "HDFS_CLIENT",
+                    "service_name" : "HDFS"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/SNAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "SNAMENODE",
+            "service_name" : "HDFS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/SNAMENODE",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "2",
+                "component_name" : "SNAMENODE",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HDFS/components/SNAMENODE",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "SNAMENODE",
+                    "service_name" : "HDFS"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/NAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "NAMENODE",
+            "service_name" : "HDFS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/NAMENODE",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "1",
+                "component_name" : "NAMENODE",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "metrics" : {
+                "rpc" : {
+                  "rpcAuthorizationSuccesses" : 56734,
+                  "SentBytes" : 71919973,
+                  "rpcAuthorizationFailures" : 0,
+                  "ReceivedBytes" : 82615006,
+                  "NumOpenConnections" : 0,
+                  "callQueueLen" : 0,
+                  "RpcQueueTime_num_ops" : 407816,
+                  "rpcAuthenticationSuccesses" : 0,
+                  "RpcProcessingTime_num_ops" : 407816,
+                  "RpcProcessingTime_avg_time" : 0.0,
+                  "rpcAuthenticationFailures" : 0,
+                  "RpcQueueTime_avg_time" : 0.0
+                },
+                "dfs" : {
+                  "namenode" : {
+                    "AddBlockOps" : 178,
+                    "FileInfoOps" : 91688,
+                    "CreateFileOps" : 181,
+                    "GetListingOps" : 73730,
+                    "Transactions_num_ops" : 973,
+                    "GetBlockLocations" : 45,
+                    "Syncs_avg_time" : 4.0,
+                    "blockReport_num_ops" : 137,
+                    "Syncs_num_ops" : 587,
+                    "FilesInGetListingOps" : 188175,
+                    "Transactions_avg_time" : 0.0,
+                    "FilesCreated" : 314,
+                    "blockReport_avg_time" : 1.0
+                  }
+                },
+                "rpcdetailed" : {
+                  "addBlock_avg_time" : 0.0,
+                  "rollFsImage_num_ops" : 26,
+                  "getListing_num_ops" : 82658,
+                  "renewLease_avg_time" : 0.0,
+                  "sendHeartbeat_num_ops" : 183761,
+                  "create_avg_time" : 2.0,
+                  "fsync_num_ops" : 8,
+                  "blockReport_num_ops" : 154,
+                  "create_num_ops" : 181,
+                  "getEditLogSize_num_ops" : 1837,
+                  "rollEditLog_num_ops" : 26,
+                  "rollFsImage_avg_time" : 237.0,
+                  "getBlockLocations_num_ops" : 45,
+                  "getFileInfo_avg_time" : 0.0,
+                  "addBlock_num_ops" : 178,
+                  "getProtocolVersion_avg_time" : 0.0,
+                  "getListing_avg_time" : 0.33333333333333337,
+                  "rollEditLog_avg_time" : 36.0,
+                  "getBlockLocations_avg_time" : 0.0,
+                  "blockReceived_avg_time" : 0.0,
+                  "renewLease_num_ops" : 18186,
+                  "getEditLogSize_avg_time" : 0.0,
+                  "getFileInfo_num_ops" : 101504,
+                  "sendHeartbeat_avg_time" : 0.0,
+                  "complete_avg_time" : 12.0,
+                  "fsync_avg_time" : 0.0,
+                  "complete_num_ops" : 183,
+                  "blockReceived_num_ops" : 177,
+                  "getProtocolVersion_num_ops" : 18437,
+                  "blockReport_avg_time" : 1.0
+                },
+                "jvm" : {
+                  "memHeapCommittedM" : 432.0625,
+                  "logFatal" : 0,
+                  "threadsBlocked" : 0,
+                  "gcCount" : 194029,
+                  "threadsWaiting" : 104,
+                  "logWarn" : 0,
+                  "logError" : 0,
+                  "memNonHeapCommittedM" : 36.847656,
+                  "memNonHeapUsedM" : 23.048737,
+                  "gcTimeMillis" : 218543395,
+                  "logInfo" : 3,
+                  "threadsNew" : 0,
+                  "memHeapUsedM" : 93.0164,
+                  "threadsTerminated" : 0,
+                  "threadsTimedWaiting" : 8,
+                  "threadsRunnable" : 10
+                },
+                "metricssystem" : {
+                  "dropped_pub_all" : 0,
+                  "num_sources" : 6,
+                  "publish_max_time" : 2320.0,
+                  "publish_num_ops" : 55266,
+                  "snapshot_stdev_time" : 0.37796447300922725,
+                  "snapshot_num_ops" : 386868,
+                  "publish_stdev_time" : 0.0,
+                  "num_sinks" : 1,
+                  "publish_imin_time" : 0.0,
+                  "snapshot_min_time" : 0.0,
+                  "snapshot_imin_time" : 0.0,
+                  "snapshot_imax_time" : 1.0,
+                  "publish_avg_time" : 0.0,
+                  "publish_min_time" : 0.0,
+                  "snapshot_max_time" : 2770.0,
+                  "publish_imax_time" : 1.401298464324817E-45,
+                  "snapshot_avg_time" : 0.14285714285714288
+                }
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HDFS/components/NAMENODE",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "NAMENODE",
+                    "service_name" : "HDFS"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/NAGIOS",
+      "Services" : {
+        "display_name" : "Nagios",
+        "description" : "Nagios-based Monitoring for HDP",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": true, \"editable\": false, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "NAGIOS"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/NAGIOS/components/NAGIOS_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "NAGIOS_SERVER",
+            "service_name" : "NAGIOS"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/NAGIOS_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "10",
+                "component_name" : "NAGIOS_SERVER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/NAGIOS/components/NAGIOS_SERVER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "NAGIOS_SERVER",
+                    "service_name" : "NAGIOS"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/HIVE",
+      "Services" : {
+        "display_name" : "Hive/HCatalog",
+        "description" : "Hive - Data Warehouse system for Apache Hadoop, HCatalog - Table and Storage Management service for data created using Apache Hadoop",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": false, \"editable\": true, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "HIVE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HIVE_SERVER",
+            "service_name" : "HIVE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/HIVE_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "7",
+                "component_name" : "HIVE_SERVER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_SERVER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "HIVE_SERVER",
+                    "service_name" : "HIVE"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HIVE_CLIENT",
+            "service_name" : "HIVE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/HIVE_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "33",
+                "component_name" : "HIVE_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "HIVE_CLIENT",
+                    "service_name" : "HIVE"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_MYSQL",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HIVE_MYSQL",
+            "service_name" : "HIVE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/HIVE_MYSQL",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "35",
+                "component_name" : "HIVE_MYSQL",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_MYSQL",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "HIVE_MYSQL",
+                    "service_name" : "HIVE"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/GANGLIA",
+      "Services" : {
+        "display_name" : "Ganglia",
+        "description" : "Ganglia-based Metrics Collection for HDP",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": true, \"editable\": false, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "GANGLIA"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/GANGLIA/components/GANGLIA_MONITOR_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "GANGLIA_MONITOR_SERVER",
+            "service_name" : "GANGLIA"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/GANGLIA_MONITOR_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "9",
+                "component_name" : "GANGLIA_MONITOR_SERVER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/GANGLIA/components/GANGLIA_MONITOR_SERVER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "GANGLIA_MONITOR_SERVER",
+                    "service_name" : "GANGLIA"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/GANGLIA/components/GANGLIA_MONITOR",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "GANGLIA_MONITOR",
+            "service_name" : "GANGLIA"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/GANGLIA_MONITOR",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "25",
+                "component_name" : "GANGLIA_MONITOR",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/GANGLIA/components/GANGLIA_MONITOR",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "GANGLIA_MONITOR",
+                    "service_name" : "GANGLIA"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/OOZIE",
+      "Services" : {
+        "display_name" : "Oozie",
+        "description" : "Workflow/Coordination system to manage Apache Hadoop jobs",
+        "attributes" : "{ \"runnable\": true, \"mustInstall\": false, \"editable\": true, \"noDisplay\": false }"
+      },
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "state" : "STARTED",
+        "service_name" : "OOZIE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/OOZIE/components/OOZIE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "OOZIE_SERVER",
+            "service_name" : "OOZIE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/OOZIE_SERVER",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "6",
+                "component_name" : "OOZIE_SERVER",
+                "state" : "STARTED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/OOZIE/components/OOZIE_SERVER",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "OOZIE_SERVER",
+                    "service_name" : "OOZIE"
+                  }
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/OOZIE/components/OOZIE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "OOZIE_CLIENT",
+            "service_name" : "OOZIE"
+          },
+          "host_components" : [
+            {
+              "href" : "http://ambari/clusters/mycluster/hosts/ip-10-38-5-128.ec2.internal/host_components/OOZIE_CLIENT",
+              "HostRoles" : {
+                "cluster_name" : "mycluster",
+                "role_id" : "32",
+                "component_name" : "OOZIE_CLIENT",
+                "state" : "INSTALLED",
+                "host_name" : "ip-10-38-5-128.ec2.internal"
+              },
+              "component" : [
+                {
+                  "href" : "http://ambari/clusters/mycluster/services/OOZIE/components/OOZIE_CLIENT",
+                  "ServiceComponentInfo" : {
+                    "cluster_name" : "mycluster",
+                    "component_name" : "OOZIE_CLIENT",
+                    "service_name" : "OOZIE"
+                  }
+                }
+              ]
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 320 - 0
ambari-web/app/assets/data/dashboard/servicesHealth.json

@@ -0,0 +1,320 @@
+{
+  "href" : "http://ambari/clusters/mycluster/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/ServiceComponentInfo/state",
+  "items" : [
+    {
+      "href" : "http://ambari/clusters/mycluster/services/NAGIOS",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "NAGIOS"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/NAGIOS/components/NAGIOS_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "NAGIOS_SERVER",
+            "service_name" : "NAGIOS"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/TEMPLETON",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "TEMPLETON"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/TEMPLETON/components/TEMPLETON_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "TEMPLETON_CLIENT",
+            "service_name" : "TEMPLETON"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/TEMPLETON/components/TEMPLETON_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "TEMPLETON_SERVER",
+            "service_name" : "TEMPLETON"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/HDFS",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "HDFS"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/DATANODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "DATANODE",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/NAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "NAMENODE",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/SNAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "SNAMENODE",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HDFS/components/HDFS_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "HDFS_CLIENT",
+            "service_name" : "HDFS"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/SQOOP",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "SQOOP"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/SQOOP/components/SQOOP_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "SQOOP_CLIENT",
+            "service_name" : "SQOOP"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/PIG",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "PIG"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/PIG/components/PIG_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "PIG_CLIENT",
+            "service_name" : "PIG"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/HBASE",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "HBASE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_REGIONSERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "HBASE_REGIONSERVER",
+            "service_name" : "HBASE"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_MASTER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "HBASE_MASTER",
+            "service_name" : "HBASE"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HBASE/components/HBASE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "HBASE_CLIENT",
+            "service_name" : "HBASE"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "ZOOKEEPER"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER/components/ZOOKEEPER_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "ZOOKEEPER_CLIENT",
+            "service_name" : "ZOOKEEPER"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/ZOOKEEPER/components/ZOOKEEPER_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "ZOOKEEPER_SERVER",
+            "service_name" : "ZOOKEEPER"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "MAPREDUCE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "MAPREDUCE_CLIENT",
+            "service_name" : "MAPREDUCE"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/JOBTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "JOBTRACKER",
+            "service_name" : "MAPREDUCE"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/MAPREDUCE/components/TASKTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "TASKTRACKER",
+            "service_name" : "MAPREDUCE"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/HIVE",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "HIVE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_MYSQL",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "HIVE_MYSQL",
+            "service_name" : "HIVE"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "HIVE_CLIENT",
+            "service_name" : "HIVE"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/HIVE/components/HIVE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "HIVE_SERVER",
+            "service_name" : "HIVE"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/GANGLIA",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "GANGLIA"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/GANGLIA/components/GANGLIA_MONITOR_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "GANGLIA_MONITOR_SERVER",
+            "service_name" : "GANGLIA"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/GANGLIA/components/GANGLIA_MONITOR",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "GANGLIA_MONITOR",
+            "service_name" : "GANGLIA"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://ambari/clusters/mycluster/services/OOZIE",
+      "ServiceInfo" : {
+        "cluster_name" : "mycluster",
+        "service_name" : "OOZIE"
+      },
+      "components" : [
+        {
+          "href" : "http://ambari/clusters/mycluster/services/OOZIE/components/OOZIE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "INSTALLED",
+            "component_name" : "OOZIE_CLIENT",
+            "service_name" : "OOZIE"
+          }
+        },
+        {
+          "href" : "http://ambari/clusters/mycluster/services/OOZIE/components/OOZIE_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "mycluster",
+            "state" : "STARTED",
+            "component_name" : "OOZIE_SERVER",
+            "service_name" : "OOZIE"
+          }
+        }
+      ]
+    }
+  ]
+}

+ 1 - 1
ambari-web/app/controllers/installer.js

@@ -315,7 +315,7 @@ App.InstallerController = Em.Controller.extend({
       hostsInfo.localRepoPath = '';
     }
 
-    hostsInfo.sshKey = 'random';
+    hostsInfo.sshKey = '';
     hostsInfo.passphrase = '';
     hostsInfo.confirmPassphrase = '';
 

+ 40 - 0
ambari-web/app/controllers/main/apps_controller.js

@@ -23,6 +23,7 @@ App.MainAppsController = Em.ArrayController.extend({
   name:'mainAppsController',
   content:App.Run.find(),
   apps:App.App.find(),
+  staredRuns: [],
   routeHome:function () {
     App.router.transitionTo('main.dashboard');
     var view = Ember.View.views['main_menu'];
@@ -30,6 +31,45 @@ App.MainAppsController = Em.ArrayController.extend({
       this.set('active', this.get('content.routing') == 'dashboard' ? "active" : "");
     });
   },
+  getRunById: function(id) {
+    var r;
+    this.get('content').forEach(function(item){
+      if (item.get('id') == id) {
+        r = item;
+      }
+    });
+    return r;
+  },
+  issetStaredRun: function(id) {
+    r = false;
+    this.get('staredRuns').forEach(function(item){
+      if (item.get('id') == id) {
+        r = true;
+      }
+    });
+    return r;
+  },
+  starClick: function() {
+    console.log(event);
+    event.srcElement.classList.toggle('stared');
+    var id = parseInt(event.srcElement.parentNode.childNodes[1].innerText);
+    if (!this.issetStaredRun(id)) {
+      this.get('staredRuns').push(this.getRunById(id));
+    }
+    else {
+      var key = this.get('staredRuns').indexOf(this.getRunById(id));
+      if (key != -1) {
+        this.get('staredRuns').splice(key, 1);
+      }
+    }
+    this.set('staredRunsLength', this.get('staredRuns').length);
+    return false;
+  },
+  clearStars: function() {
+    this.set('staredRuns', []);
+    this.set('staredRunsLength', 0);
+    $('.icon-star').removeClass('stared');
+  },
   /**
    * Row, which is expanded at the moment, will update this property.
    * Used to collapse rows, which are not used at the moment

+ 1 - 7
ambari-web/app/controllers/wizard/step3_controller.js

@@ -169,12 +169,6 @@ App.WizardStep3Controller = Em.Controller.extend({
     });
   },
 
-  startBootstrap: function () {
-    this.set('isSubmitDisabled', true);
-    this.set('bootHosts', this.get('content'));
-    this.doBootstrap();
-  },
-
   retryHost: function (hostInfo) {
     this.retryHosts([hostInfo]);
   },
@@ -187,7 +181,7 @@ App.WizardStep3Controller = Em.Controller.extend({
   },
 
   startBootstrap: function () {
-    this.set('isSubmitDisabled', true);
+    // this.set('isSubmitDisabled', true);
     this.set('bootHosts', this.get('hosts'));
     this.doBootstrap();
   },

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

@@ -421,7 +421,7 @@ App.WizardStep9Controller = Em.Controller.extend({
     this.hosts.forEach(function (_content) {
       var actionsPerHost = tasksData.filterProperty('Tasks.host_name', _content.name); // retrieved from polled Data
       if (actionsPerHost.length === 0) {
-        alert('For testing with mockData follow the sequence: hit referesh,"mockData btn", "pollData btn", again "pollData btn"');
+        //alert('For testing with mockData follow the sequence: hit referesh,"mockData btn", "pollData btn", again "pollData btn"');
         //exit();
       }
       if (actionsPerHost !== null && actionsPerHost !== undefined && actionsPerHost.length !== 0) {

+ 38 - 14
ambari-web/app/models/run.js

@@ -28,6 +28,8 @@ App.Run = DS.Model.extend({
   lastUpdateTime:DS.attr('string'),
   numJobsTotal:DS.attr('number'),
   numJobsCompleted:DS.attr('number'),
+  input: DS.attr('number'),
+  output: DS.attr('number'),
   appId:DS.attr('number'),
   jobs:DS.hasMany('App.Job')
 });
@@ -39,10 +41,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag: {"1":["2","3"],"2":["3","4"],"4":["2","5"]}}',
     user_name:'user3',
-    start_time:1347629541501,
+    start_time:1347539541501,
     last_update_time:'1347639541501',
     num_jobs_total:5,
     num_jobs_completed:0,
+    input: 11,
+    output: 30,
     app_id:1,
     jobs:[1, 2, 3, 4, 5]
   },
@@ -52,10 +56,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag:{"4":["5","1"],"3":["6"],"6":["4"],"1":["5"]}}',
     user_name:'user1',
-    start_time:1347629951502,
+    start_time:1347339951502,
     last_update_time:'1347439951502',
     num_jobs_total:5,
     num_jobs_completed:2,
+    input: 10,
+    output: 30,
     app_id:4,
     jobs:[4, 5, 1, 3, 6]
   },
@@ -64,11 +70,13 @@ App.Run.FIXTURES = [
     run_id:'pig_5',
     parent_run_id:null,
     workflow_context:'{dag:{"6":["7","8"],"9":["8"],"10":["6"],"9":["7"]}}',
-    user_name:'user1',
-    start_time:1347629841503,
+    user_name:'user2',
+    start_time:1341539841503,
     last_update_time:'1341639841503',
     num_jobs_total:5,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:1,
     jobs:[6, 7, 8, 9, 10]
   },
@@ -78,10 +86,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag:{"8":["9","10"],"9":["10"]}}',
     user_name:'user1',
-    start_time:1347629541504,
+    start_time:1347539591504,
     last_update_time:'1347639591504',
     num_jobs_total:3,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:2,
     jobs:[8, 9, 10]
   },
@@ -90,11 +100,13 @@ App.Run.FIXTURES = [
     run_id:'pig_5',
     parent_run_id:null,
     workflow_context:'{dag:{"8":["9","10"],"8":["10","9"]}}',
-    user_name:'user1',
-    start_time:1347629541505,
+    user_name:'user5',
+    start_time:1347531541505,
     last_update_time:'1347631541505',
     num_jobs_total:3,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:2,
     jobs:[8, 9, 10]
   },
@@ -104,10 +116,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag:{"8":["9","10"],"9":["10","8"]}}',
     user_name:'user1',
-    start_time:1347629541506,
+    start_time:1342439541506,
     last_update_time:'1342639541506',
     num_jobs_total:3,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:2,
     jobs:[8, 9, 10]
   },
@@ -116,11 +130,13 @@ App.Run.FIXTURES = [
     run_id:'pig_5',
     parent_run_id:null,
     workflow_context:'{dag:{"1":["3","5"],"5":["7"],"3":["1"]}}',
-    user_name:'user1',
-    start_time:1347629541507,
+    user_name:'jsmith',
+    start_time:1347539541507,
     last_update_time:'1347639541507',
     num_jobs_total:4,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:4,
     jobs:[1, 3, 5, 7]
   },
@@ -130,10 +146,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag:{"1":["3","5"],"5":["7"],"3":["1"]}}',
     user_name:'user1',
-    start_time:1347629541508,
+    start_time:1347539541508,
     last_update_time:'1347639541508',
     num_jobs_total:4,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:3,
     jobs:[1, 3, 5, 7]
   },
@@ -143,10 +161,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag:{"1":["3","5"],"5":["7"],"3":["1"]}}',
     user_name:'user1',
-    start_time:1347629541509,
+    start_time:1347539541509,
     last_update_time:'1347639541509',
     num_jobs_total:4,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:3,
     jobs:[1, 3, 5, 7]
   },
@@ -156,10 +176,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag:{"1":["3","5"],"5":["7"],"3":["1"]}}',
     user_name:'user1',
-    start_time:1347629541510,
+    start_time:1347539541510,
     last_update_time:'1347639541510',
     num_jobs_total:4,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:3,
     jobs:[1, 3, 5, 7]
   },
@@ -169,10 +191,12 @@ App.Run.FIXTURES = [
     parent_run_id:null,
     workflow_context:'{dag:{"1":["3","5"],"5":["7"],"3":["1"]}}',
     user_name:'user1',
-    start_time:1347629541511,
+    start_time:1347539541511,
     last_update_time:'1347639541511',
     num_jobs_total:4,
     num_jobs_completed:0,
+    input: 10,
+    output: 30,
     app_id:3,
     jobs:[1, 3, 5, 7]
   }

+ 12 - 4
ambari-web/app/styles/apps.less

@@ -1,8 +1,4 @@
 #apps{
-  .breadcrumbs {
-    padding-bottom: 16px;
-    margin-left: 16px;
-  }
   .table thead th{
     vertical-align:top;
   }
@@ -13,6 +9,18 @@
   td.avg-star{
     border-left:1px solid #DDD;
   }
+  .dropdown-menu label.checkbox {
+    margin-left: 10px;
+  }
+  .dropdown-menu label.checkbox {
+    margin-left: 10px;
+  }
+  span.icon-star{
+    color: gray;
+    &.stared {
+      color: inherit;
+    }
+  }
   .a {
     width:25px;
     height: 25px;

+ 16 - 16
ambari-web/app/templates/main/apps.hbs

@@ -16,9 +16,9 @@
 * limitations under the License.
 -->
 <div id="apps">
-  <div class="breadcrumbs">
-    <a href='#' {{action "routeHome" target="controller"}}><i class="icon-home"></i></a>&nbsp;&#47;&nbsp;
-    <strong>Apps</strong>
+  <div class="breadcrumb">
+    <li><a href='#' {{action "routeHome" target="controller"}}><i class="icon-home"></i></a><span class="divider">/</span></li>
+    <li class="active">Apps</li>
   </div>
   <table class="table table-bordered table-stripe avg-table" >
             <tbody>
@@ -34,28 +34,28 @@
             </tr>
             <tr class="avg-info">
               <td>Avg</td>
-              <td>43</td>
-              <td>200</td>
-              <td>10 mb</td>
-              <td>00:00:58</td>
-              <td>2012-07-22</td>
-              <td>2012-07-24</td>
+              <td>{{view.stared.jobs.avg}}</td>
+              <td>{{view.stared.input.avg}}</td>
+              <td>{{view.stared.output.avg}}</td>
+              <td>{{view.stared.duration.avg}}</td>
+              <td>{{view.stared.times.oldest}}</td>
+              <td>{{view.stared.times.youngest}}</td>
             </tr>
              <tr class="compare-info">
 
               <td>Min / Max</td>
-              <td>3 / 128</td>
-              <td>10kb / 248mb</td>
-              <td>5kb / 18mb</td>
-              <td>00:00:10 / 00:01:20</td>
+              <td>{{view.stared.jobs.min}} / {{view.stared.jobs.max}}</td>
+              <td>{{view.stared.input.min}} / {{view.stared.input.max}}</td>
+              <td>{{view.stared.output.min}} / {{view.stared.output.max}}</td>
+              <td>{{view.stared.duration.min}} / {{view.stared.duration.max}}</td>
               <td></td>
               <td></td>
              </tr>
             </tbody>
   </table>
     <div id="filter_info" class="row">
-      <div class="span3">Show: <a href="javascript:void(0)">Filtered ({{view.filtered}})</a>&nbsp;&#124;&nbsp;<a href="javascript:void(0)">Starred (20)</a></div>
-      <div class="span2"><a href="#" {{action "clearFilters" target="view"}}>Clear filters</a>&nbsp;&#124;&nbsp;<a href="javascript:void(0)">Clear stars</a></div>
+      <div class="span3">Show: <a href="javascript:void(0)">Filtered ({{view.filtered}})</a>&nbsp;&#124;&nbsp;<a href="javascript:void(0)">Starred ({{view.stared.count}})</a></div>
+      <div class="span2"><a href="#" {{action "clearFilters" target="view"}}>Clear filters</a>&nbsp;&#124;&nbsp;<a href="#" {{action "clearStars" target="controller"}}>Clear stars</a></div>
     </div>
     <div>
     </div>
@@ -76,7 +76,7 @@
           <th>{{view view.appidFilterView}}</th>
           <th>{{view view.nameFilterView}}</th>
           <th>{{view view.typeSelectView}}</th>
-          <th>{{view view.userFilterView}}</th>
+          <th>{{view view.userFilterView}}<input id="user_filter" type="hidden"></th>
           <th>{{view view.jobsFilterView}}</th>
           <th>{{view view.inputFilterView}}</th>
           <th>{{view view.outputFilterView}}</th>

+ 4 - 4
ambari-web/app/templates/main/apps/list_row.hbs

@@ -16,12 +16,12 @@
 * limitations under the License.
 -->
 
-<td><i class="icon-star"></i>&nbsp;<a href="javascript:void(0)">ID&nbsp;{{run.appId}}</a></td>
+<td><a href='#' {{action "starClick" target="controller"}}"><span class="icon-star"></span><span class="hidden">{{run.id}}</span></a>&nbsp;<a href="javascript:void(0)">ID&nbsp;{{run.appId}}</a></td>
 <td>{{run.appName}}</td>
 <td>{{run.type}}</td>
 <td>{{run.userName}}</td>
 <td>{{run.numJobsTotal}}</td>
-<td>10MB</td>
-<td>30MB</td>
-<td>00:15:32</td>
+<td>{{run.input}}</td>
+<td>{{run.output}}</td>
+<td>{{run.duration}}</td>
 <td>{{run.lastUpdateTime}}</td>

+ 169 - 0
ambari-web/app/utils/data_table.js

@@ -41,6 +41,175 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, {
     return b - a;
   }
 });
+
+jQuery.extend(jQuery.fn.dataTableExt.oApi, {
+    "fnFilterClear":function ( oSettings )
+    {
+        /* Remove global filter */
+        oSettings.oPreviousSearch.sSearch = "";
+
+        /* Remove the text of the global filter in the input boxes */
+        if ( typeof oSettings.aanFeatures.f != 'undefined' )
+        {
+            var n = oSettings.aanFeatures.f;
+            for ( var i=0, iLen=n.length ; i<iLen ; i++ )
+            {
+                $('input', n[i]).val( '' );
+            }
+        }
+
+        /* Remove the search text for the column filters - NOTE - if you have input boxes for these
+         * filters, these will need to be reset
+         */
+        for ( var i=0, iLen=oSettings.aoPreSearchCols.length ; i<iLen ; i++ )
+        {
+            oSettings.aoPreSearchCols[i].sSearch = "";
+        }
+
+        /* Redraw */
+        oSettings.oApi._fnReDraw( oSettings );
+    }
+});
+
+jQuery.extend(jQuery.fn.dataTableExt.oApi, {
+    "fnGetColumnData":function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) {
+        // check that we have a column id
+        if ( typeof iColumn == "undefined" ) return [];
+
+        // by default we only wany unique data
+        if ( typeof bUnique == "undefined" ) bUnique = true;
+
+        // by default we do want to only look at filtered data
+        if ( typeof bFiltered == "undefined" ) bFiltered = true;
+
+        // by default we do not wany to include empty values
+        if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true;
+
+        // list of rows which we're going to loop through
+        var aiRows;
+
+        // use only filtered rows
+        if (bFiltered == true) aiRows = oSettings.aiDisplay;
+        // use all rows
+        else aiRows = oSettings.aiDisplayMaster; // all row numbers
+
+        // set up data array
+        var asResultData = new Array();
+
+        for (var i=0,c=aiRows.length; i<c; i++) {
+            iRow = aiRows[i];
+            var sValue = this.fnGetData(iRow, iColumn);
+
+            // ignore empty values?
+            if (bIgnoreEmpty == true && sValue.length == 0) continue;
+
+            // ignore unique values?
+            else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue;
+
+            // else push the value onto the result data array
+            else asResultData.push(sValue);
+        }
+
+        return asResultData;
+    }
+});
+
+jQuery.extend($.fn.dataTableExt.afnFiltering.push(
+    function( oSettings, aData, iDataIndex ) {
+        var inputFilters = [
+            {iColumn:'3', elementId: 'user_filter', type:'multiple'},
+            {iColumn:'4', elementId: 'jobs_filter', type:'number' },
+            {iColumn:'5', elementId: 'input_filter', type:'number' },
+            {iColumn:'6', elementId: 'output_filter', type:'number' },
+            {iColumn:'7', elementId: 'duration_filter', type:'number' },
+            {iColumn:'8', elementId: 'rundate_filter', type:'date' }
+        ];
+        var match = true;
+        for(i = 0; i < inputFilters.length; i++){
+            switch(inputFilters[i].type){
+                case 'date':
+                    if(jQuery('#'+inputFilters[i].elementId).val() !== 'Any' && match) {
+                        dateFilter(jQuery('#'+inputFilters[i].elementId).val(), aData[inputFilters[i].iColumn]);
+                    }
+                break;
+                case 'number':
+                    if(jQuery('#'+inputFilters[i].elementId).val() && match){
+                        numberFilter(jQuery('#'+inputFilters[i].elementId).val(), aData[inputFilters[i].iColumn]);
+                    }
+                    break;
+                case 'multiple':
+                    if(jQuery('#'+inputFilters[i].elementId).val() && match){
+                        multipleFilter(jQuery('#'+inputFilters[i].elementId).val(), aData[inputFilters[i].iColumn]);
+                    }
+            }
+        }
+        function multipleFilter(condition, rowValue){
+            var options = condition.split(',');
+            match = false;
+            rowValue = (jQuery(rowValue).text()) ? jQuery(rowValue).text() : rowValue;
+            for(var i = 0; i < options.length; i++) {
+                if (options[i] === rowValue) match = true;
+            }
+        }
+
+        function dateFilter(condition, rowValue) {
+            var nowTime = new Date().getTime();
+            var oneDayPast = nowTime - 86400000;
+            var twoDaysPast = nowTime - 172800000;
+            var sevenDaysPast = nowTime - 604800000;
+            var fourteenDaysPast = nowTime - 1209600000;
+            var thirtyDaysPast = nowTime - 2592000000;
+            rowValue = (jQuery(rowValue).text()) ? jQuery(rowValue).text() : rowValue;
+            rowValue = new Date(rowValue).getTime();
+            match = false;
+            switch (condition) {
+                case 'Any':
+                    match = true;
+                    break;
+                case 'Past 1 Day':
+                    if (nowTime > rowValue && rowValue > oneDayPast) match = true;
+                    break;
+                case 'Past 2 Days':
+                    if (nowTime > rowValue && rowValue > twoDaysPast) match = true;
+                    break;
+                case 'Past 7 Days':
+                    if (nowTime > rowValue && rowValue > sevenDaysPast) match = true;
+                    break;
+                case 'Past 14 Days':
+                    if (nowTime > rowValue && rowValue > fourteenDaysPast) match = true;
+                    break;
+                case 'Past 30 Days':
+                    if (nowTime > rowValue && rowValue > thirtyDaysPast) match = true;
+                    break;
+            }
+        }
+        function numberFilter(rangeExp, rowValue){
+            var compareChar = rangeExp.charAt(0);
+            var compareValue = parseInt(rangeExp.substr(1, rangeExp.length - 1));
+            rowValue = (jQuery(rowValue).text()) ? jQuery(rowValue).text() : rowValue;
+            match = false;
+            switch (compareChar) {
+                case '<':
+                    if(compareValue > rowValue) match = true;
+                    break;
+                case '>':
+                    if(compareValue < rowValue) match = true;
+                    break;
+                case '=':
+                    if(compareValue == rowValue) match = true;
+                    break;
+                default:
+                    match = false;
+            }
+        }
+        return match;
+    }
+)
+);
+
+
+
+
 jQuery.extend(jQuery.fn.dataTableExt.oApi, {
     "fnFilterClear":function ( oSettings )
     {

+ 33 - 3
ambari-web/app/utils/date.js

@@ -28,7 +28,7 @@ module.exports = {
   /**
    * Convert timestamp to date-string 'DAY_OF_THE_WEEK, MONTH DAY, YEAR HOURS:MINUTES'
    * @param timestamp
-   * @return date-string
+   * @return string date
    */
   dateFormat:function (timestamp) {
     if (!validator.isValidInt(timestamp)) return timestamp;
@@ -37,10 +37,28 @@ module.exports = {
     var days = this.dateDays;
     return days[date.getDay()] + ', ' + months[date.getMonth()] + ' ' + this.dateFormatZeroFirst(date.getDate()) + ', ' + date.getFullYear() + ' ' + this.dateFormatZeroFirst(date.getHours()) + ':' + this.dateFormatZeroFirst(date.getMinutes());
   },
+  /**
+   * Convert date-string 'DAY_OF_THE_WEEK, MONTH DAY, YEAR HOURS:MINUTES' to timestamp
+   * @param date_string
+   * @return {String}
+   */
+  dateUnformat: function(date_string) {
+    var date = date_string.substring(4);
+    var month = date.substring(1, 4);
+    var day = date.substring(5, 7);
+    var year = date.substring(9, 13);
+    var hours = date.substring(14, 16);
+    var minutes = date.substring(17, 19);
+
+    var months = this.dateMonths;
+    month = months.indexOf(month) + 1;
+    if (month < 10) month = '0' + month;
+    return year + month + day + hours + minutes;
+  },
   /**
    * Convert time in seconds to 'HOURS:MINUTES:SECONDS'
-   * @param seconds
-   * @return formatted date-string
+   * @param timestamp_interval
+   * @return string formatted date
    */
   dateFormatInterval:function (timestamp_interval) {
     if (!validator.isValidInt(timestamp_interval)) return timestamp_interval;
@@ -50,5 +68,17 @@ module.exports = {
     var divisor_for_seconds = divisor_for_minutes % 60;
     var seconds = Math.ceil(divisor_for_seconds);
     return (hours < 10 ? '0' : '') + hours + ':' + (minutes < 10 ? '0' : '') + minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
+  },
+  /**
+   * Convert 'HOURS:MINUTES:SECONDS' to time in seconds
+   * @param formattedDate date string
+   * @return time in seconds
+   */
+  dateUnformatInterval: function(formattedDate) {
+    var d = formattedDate.split(':');
+    for (var k in d) {
+      d[k] = parseInt(d[k]);
+    }
+    return d[0]*3600+d[1]*60+d[2];
   }
 }

+ 0 - 3
ambari-web/app/views.js

@@ -101,9 +101,6 @@ require('views/main/charts/heatmap/heatmap_host');
 require('views/main/charts/heatmap/heatmap_host_detail');
 require('views/main/apps_view');
 require('views/main/apps/item_view');
-require('views/main/apps/runs/jobs_view');
-require('views/main/apps/runs/jobs/dag_view');
-require('views/main/apps/runs/jobs/menu_view');
 require('views/installer');
 require('views/wizard/controls_view');
 require('views/wizard/step1_view');

+ 208 - 36
ambari-web/app/views/main/apps_view.js

@@ -27,6 +27,7 @@ App.MainAppsView = Em.View.extend({
       var app = App.store.find(App.App, item.get('appId'));
       item.set('appName', app.get('appName'));
       item.set('type', app.get('type'));
+      item.set('duration', date.dateFormatInterval(((item.get('lastUpdateTime') - item.get('startTime'))/1000)));
       item.set('lastUpdateTime', date.dateFormat(item.get('lastUpdateTime')));
       item.set('numJobsTotal' ,item.get('jobs').get('content').length);
       item.get('jobs').forEach(function(item){
@@ -35,16 +36,111 @@ App.MainAppsView = Em.View.extend({
     });
     return content;
   }.property('App.router.mainAppsController.content'),
-  /*types: function(){
+  users: function(){
     var result = new Array();
     this.get('content').forEach(function(item){
-      result.push(item.get('type'));
+       result.push(item.get('userName'));
     });
-    result = $.unique(result);
-    return result;
-  }.property('content'),*/
+    return jQuery.unique(result);
+  }.property('content'),
   oTable:null,
   filtered:null,
+  stared: function() {
+    var content =  this.get('controller.staredRuns');
+    var avgJobs = 0.0, minJobs = 0, maxJobs = 0, avgInput = 0, minInput = 0, maxInput = 0, avgOutput = 0, minOutput = 0, maxOutput = 0, avgDuration = 0.0, minDuration = 0, maxDuration = 0, oldest = 0, youngest = 0;
+    if (content.length > 0) {
+      minJobs = content[0].get('numJobsTotal');
+      minInput = content[0].get('input');
+      minOutput = content[0].get('output');
+      oldest = date.dateUnformat(content[0].get('lastUpdateTime'));
+      youngest = date.dateUnformat(content[0].get('lastUpdateTime'));
+      minDuration = date.dateUnformatInterval(content[0].get('duration'));
+    }
+    content.forEach(function(item) {
+      avgJobs += item.get('numJobsTotal') / content.length;
+      avgInput += item.get('input') / content.length;
+      avgOutput += item.get('output') / content.length;
+      avgDuration += date.dateUnformatInterval(item.get('duration')) / content.length;
+      if (item.get('numJobsTotal') < minJobs) {
+        minJobs = item.get('numJobsTotal');
+      }
+      else {
+        if (item.get('numJobsTotal') > maxJobs) {
+          maxJobs = item.get('numJobsTotal');
+        }
+      }
+      if (item.get('input') < minInput) {
+        minInput = item.get('input');
+      }
+      else {
+        if (item.get('input') > maxInput) {
+          maxInput = item.get('input');
+        }
+      }
+      if (item.get('output') < minOutput) {
+        minOutput = item.get('output');
+      }
+      else {
+        if (item.get('output') > maxOutput) {
+          maxOutput = item.get('output');
+        }
+      }
+      if (date.dateUnformatInterval(item.get('duration')) < minDuration) {
+        minDuration = date.dateUnformatInterval(item.get('duration'));
+      }
+      else {
+        if (date.dateUnformatInterval(item.get('duration')) > maxDuration) {
+          maxDuration = date.dateUnformatInterval(item.get('duration'));
+        }
+      }
+      if (date.dateUnformat(item.get('lastUpdateTime')) < oldest) {
+        oldest = date.dateUnformat(item.get('lastUpdateTime'));
+      }
+      else {
+        if (date.dateUnformat(item.get('lastUpdateTime')) > youngest) {
+          youngest = date.dateUnformat(item.get('lastUpdateTime'));
+        }
+      }
+    });
+    oldest = oldest != 0 ? oldest.substring(0, 4) + '-' + oldest.substring(4, 6) + '-' + oldest.substring(6, 8) : '';
+    youngest = youngest != 0 ? youngest.substring(0, 4) + '-' + youngest.substring(4, 6) + '-' + youngest.substring(6, 8) : '';
+    ret = {
+      'count': this.get('controller.staredRuns').length,
+      'jobs': {
+        'avg': avgJobs.toFixed(2),
+        'min': minJobs,
+        'max': maxJobs
+      },
+      'input': {
+        'avg': avgInput.toFixed(2),
+        'min': minInput,
+        'max': maxInput
+      },
+      'output': {
+        'avg': avgOutput.toFixed(2),
+        'min': minOutput,
+        'max': maxOutput
+      },
+      'duration': {
+        'avg': date.dateFormatInterval(Math.round(avgDuration)),
+        'min': date.dateFormatInterval(minDuration),
+        'max': date.dateFormatInterval(maxDuration)
+      },
+      'times': {
+        'oldest': oldest,
+        'youngest': youngest
+      }
+    };
+    return ret;
+  }.property('controller.staredRunsLength'),
+  /*starsStats: function() {
+    var content =  this.get('controller.staredRuns');
+    var avgJobs = 0.0, minJobs = 0, maxJobs = 0, avgInput = 0, minInput = 0, maxInput = 0, avgOutput = 0, minOutput = 0, maxOutput = 0;
+    content.forEach(function(item) {
+      avgJobs += item.get('numJobsTotal') / content.length;
+    });
+    this.set('avgJobs', 1);
+  }.property('controller.staredRunsLength'),*/
   clearFilters:function(event){
     this._childViews.forEach(function(item){
       if(item.get('tagName') === 'input') {
@@ -89,8 +185,49 @@ App.MainAppsView = Em.View.extend({
     });
     this.set('oTable', oTable);
     this.set('filtered', oTable.fnSettings().fnRecordsDisplay());
+
+  },
+  /**
+   * reset all filters in dataTable
+   *
+   * @param event
+   */
+  clearFilters:function(event){
+    this._childViews.forEach(function(item){
+    if(item.get('tagName') === 'input') {
+      item.set('value','');
+    }
+    if(item.get('tagName') === 'select') {
+      item.set('value','Any');
+    }
+    if(item.get('multiple')) {
+      item.get('clearFilter')(item);
+    }
+    });
+    this.get('oTable').fnFilterClear();
+    this.set('filtered',this.get('oTable').fnSettings().fnRecordsDisplay());
+  },
+  /**
+   * apply each filter to dataTable
+   *
+   * @param {parentView}
+   * @param {iColumn} number of column by which filter
+   * @param {value}
+   */
+  applyFilter:function(parentView, iColumn, value){
+      value = (value) ? value : '';
+      parentView.get('oTable').fnFilter(value, iColumn);
+      parentView.set('filtered',parentView.get('oTable').fnSettings().fnRecordsDisplay());
   },
-//Column filter views
+  /**
+   * refresh average info in top block when filtered changes
+   */
+  averageRefresh:function(){
+
+  }.observes('filtered'),
+  /**
+   * dataTable filter views
+   */
   typeSelectView: Em.Select.extend({
     classNames:['input-small'],
     selected: 'Any',
@@ -172,8 +309,7 @@ App.MainAppsView = Em.View.extend({
     placeholder: 'Any ',
     elementId: 'output_filter',
     filtering:function(){
-      this._parentView.get('oTable').fnFilter('' ,6);
-      this._parentView.set('filtered',this._parentView.get('oTable').fnSettings().fnRecordsDisplay());
+        this.get('parentView').get('applyFilter')(this.get('parentView'), 6);
     }.observes('value')
   }),
   durationFilterView: Em.TextField.extend({
@@ -182,11 +318,66 @@ App.MainAppsView = Em.View.extend({
     placeholder: 'Any ',
     elementId: 'duration_filter',
     filtering:function(){
-      this._parentView.get('oTable').fnFilter('' ,7);
-      this._parentView.set('filtered',this._parentView.get('oTable').fnSettings().fnRecordsDisplay());
+      this.get('parentView').get('applyFilter')(this.get('parentView'), 7);
     }.observes('value')
   }),
-
+  userFilterView: Em.View.extend({
+    classNames:['btn-group'],
+    classNameBindings: ['open'],
+    multiple:true,
+    open: false,
+    isApplyDisabled:true,
+    users:function(){
+      var users = new Array();
+      for(var i = 0; i < this.get('parentView').get('users').length; i++)
+        users.push(Ember.Object.create({
+          name:this.get('parentView').get('users')[i],
+          checked:false
+        }));
+      return users;
+    }.property('parentView.users'),
+    template: Ember.Handlebars.compile(
+      '<button class="btn btn-info" '+
+      '{{action "clickFilterButton" target="view"}}>'+
+      'User&nbsp;<span class="caret"></span></button>'+
+      '<ul class="dropdown-menu filter-components">'+
+      '<li><label class="checkbox">' +
+      '{{view Ember.Checkbox checkedBinding="view.allComponentsChecked"}} All</label></li>'+
+      '{{#each user in view.users}}<li><label class="checkbox">' +
+      '{{view Ember.Checkbox checkedBinding="user.checked"}}{{user.name}}'+
+      '</label></li>{{/each}}</ul>'+
+      '<button {{bindAttr disabled="view.isApplyDisabled"}}'+
+      'class="btn" {{action "applyFilter" target="view"}}>'+
+      'Apply</button>'
+    ),
+    allComponentsChecked:false,
+    toggleAllComponents: function(){
+      var checked = this.get('allComponentsChecked');
+      this.get('users').forEach(function(item){
+        item.set('checked',checked);
+      });
+    }.observes('allComponentsChecked'),
+    clickFilterButton:function(event){
+      this.set('open', !this.get('open'));
+      this.set('isApplyDisabled', !this.get('isApplyDisabled'));
+    },
+    clearFilter:function(self){
+      self.set('allComponentsChecked', true);
+      self.set('allComponentsChecked', false);
+      jQuery('#user_filter').val([]);
+      self.get('parentView').get('oTable').fnFilter('', 3);
+    },
+    applyFilter:function(){
+      var chosenUsers = new Array();
+      this.set('open', !this.get('open'));
+      this.set('isApplyDisabled', !this.get('isApplyDisabled'));
+      this.get('users').forEach(function(item){
+          if(item.get('checked')) chosenUsers.push(item.get('name'));
+      });
+      jQuery('#user_filter').val(chosenUsers);
+      this.get('parentView').get('applyFilter')(this.get('parentView'), 3);
+    }
+  }),
   /**
    * This Container View is used to render static table row(appTableRow) and additional dynamic content
    */
@@ -198,7 +389,7 @@ App.MainAppsView = Em.View.extend({
     id: function(){
       return this.get('run.id');
     }.property("run.id"),
-
+    currentId: null,
     /**
      * Variable for dynamic view
      */
@@ -208,10 +399,11 @@ App.MainAppsView = Em.View.extend({
      * Show additional content appropriated for this row
      */
     expand : function(){
-      var view = Ember.TextArea.create();
+      var view = App.MainAppsItemView.create();
       this.set('contentView', view);
       this.get('childViews').pushObject(view);
-      this.set('controller.expandedRowId', this.get('id'));
+      this.set('currentId', this.get('id'));
+      //this.set('controller.expandedRowId', this.get('id'));
     },
 
     /**
@@ -228,6 +420,7 @@ App.MainAppsView = Em.View.extend({
   }),
 
   appTableRow: Em.View.extend({
+    templateName : require('templates/main/apps/list_row'),
     classNames:['app-table-row'],
     classNameBindings: ['rowClass'],
     tagName: "tr",
@@ -245,31 +438,10 @@ App.MainAppsView = Em.View.extend({
 
       this.get('parentView').expand();
 
-      if(!target.next().hasClass("under-row")){
-        $(".under-row").remove();
-        this.drawUnderRow(target);
-      }else{
-        $(".under-row").remove();
-      }
     },
     rowClass: function () {
       return this.get('rowOpened') ? "row-opened" : "row-closed";
-    }.property('rowOpened'),
-    drawUnderRow:function(elem){
-     $("" +
-      "<tr class='under-row'>" +
-        "<td colspan='9'>" +
-          'DAG & BAR placeholder'
-         + "</td>" +
-      "</tr>").insertAfter(elem);
-      /*this.Appview = App.MainAppsRunsJobsView.create();
-      this.Appview.appendTo('#hhhh');*/
-    },
-    deleteUnderRow: function(elem){
-      elem.prev().remove();
-    },
-
-    templateName : require('templates/main/apps/list_row')
+    }.property('rowOpened')
 
   })