incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vik...@apache.org
Subject svn commit: r1347029 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/js/clustersList.js hmc/php/frontend/fetchClusterServices.php
Date Wed, 06 Jun 2012 18:23:26 GMT
Author: vikram
Date: Wed Jun  6 18:23:26 2012
New Revision: 1347029

URL: http://svn.apache.org/viewvc?rev=1347029&view=rev
Log:
AMBARI-526. Display client nodes as part of cluster topology display. (Contributed by Varun)

Modified:
    incubator/ambari/branches/ambari-186/CHANGES.txt
    incubator/ambari/branches/ambari-186/hmc/js/clustersList.js
    incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchClusterServices.php

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1347029&r1=1347028&r2=1347029&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Wed Jun  6 18:23:26 2012
@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-526. Display client nodes as part of cluster topology display. (Varun via Vikram)
+
   AMBARI-359. invalid parameter java_needed during uninstall (Ramya via Vikram)
 
   AMBARI-265. Reconfig page close button (x) is not visible (Vinod via Vikram)

Modified: incubator/ambari/branches/ambari-186/hmc/js/clustersList.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/js/clustersList.js?rev=1347029&r1=1347028&r2=1347029&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/js/clustersList.js (original)
+++ incubator/ambari/branches/ambari-186/hmc/js/clustersList.js Wed Jun  6 18:23:26 2012
@@ -1,10 +1,6 @@
-function generateClusterHostRoleMappingMarkup( clusterServices ) {
+function generateClusterMastersHostRoleMappingMarkup( clusterServices ) {
 
-  var clusterHostRoleMappingMarkup = 
-  '<fieldset id=clustersHostRoleMappingFieldsetId>' +
-    '<legend>' +
-      'Locations Of Service Masters' + 
-    '</legend>';
+  var clusterMastersHostRoleMappingMarkup = '';
 
   for (var serviceName in clusterServices) {
     if (clusterServices.hasOwnProperty(serviceName)) {
@@ -16,7 +12,7 @@ function generateClusterHostRoleMappingM
         globalYui.Array.each( clusterServices[serviceName].components, function (serviceComponent)
{
           
           if (serviceComponent.isMaster) {
-            clusterHostRoleMappingMarkup += 
+            clusterMastersHostRoleMappingMarkup += 
               '<div class=formElement>' + 
                 '<label>' + serviceComponent.displayName + ': ' + '</label>'
+ 
                 serviceComponent.hostName +
@@ -28,7 +24,64 @@ function generateClusterHostRoleMappingM
     }
   }
 
-  clusterHostRoleMappingMarkup += 
+  return clusterMastersHostRoleMappingMarkup;
+}
+
+function generateClusterClientsHostRoleMappingMarkup( clusterServices ) {
+
+  var clusterClientsHostRoleMappingMarkup = '';
+  var finalHostMap = {};
+
+  /*
+  for (var serviceName in clusterServices) {
+    if (clusterServices.hasOwnProperty(serviceName)) {
+
+      if (clusterServices[serviceName].isEnabled == "1" && 
+          !clusterServices[serviceName].attributes.noDisplay) {
+
+        globalYui.Array.each( clusterServices[serviceName].components, function (serviceComponent)
{
+          
+          globalYui.log("AAA is " + serviceComponent.hostname);
+          globalYui.log("BBB is " + globalYui.Lang.dump(serviceComponent));
+          if (serviceComponent.isClient) {
+            globalYui.log("Final host array is " + globalYui.Lang.dump(finalHostMap));
+            // just add the client to the hostname object
+            if ( !( serviceComponent.hostName in finalHostMap ) ) {
+              finalHostMap[serviceComponent.hostName] = new Array();
+              finalHostMap[serviceComponent.hostName].push(serviceComponent.displayName);
+              globalYui.log("XXX is " + globalYui.Lang.dump(finalHostMap));
+            } else {
+              // FIXME fails to push display name to this array
+              globalYui.log("Service component array has " + globalYui.Lang.dump(finalHostMap[serviceComponent.hostName])
+ " YYY: " + serviceComponent.hostname);
+              globalYui.log("ZZZ is " + globalYui.Lang.dump(finalHostMap));
+              finalHostMap[serviceComponent.hostname].push(serviceComponent.displayName);
+            }
+          }
+
+        });
+      }
+    }
+  }
+  */
+
+  return clusterClientsHostRoleMappingMarkup;
+}
+
+function generateClusterHostRoleMappingMarkup( clusterServices ) {
+
+  var clusterHostRoleMappingMarkup = 
+  '<fieldset id=clusterMastersHostRoleMappingFieldsetId>' +
+    '<legend>' +
+      'Locations Of Service Masters' + 
+    '</legend>' + 
+    generateClusterMastersHostRoleMappingMarkup(clusterServices) + 
+  '</fieldset>' + 
+  '<br/>' +
+  '<fieldset id=clusterClientsHostRoleMappingFieldsetId>' +
+    '<legend>' +
+      'Locations Of Service Clients' + 
+    '</legend>' + 
+    generateClusterClientsHostRoleMappingMarkup(clusterServices) + 
   '</fieldset>';
 
   return clusterHostRoleMappingMarkup;

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchClusterServices.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchClusterServices.php?rev=1347029&r1=1347028&r2=1347029&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchClusterServices.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchClusterServices.php Wed Jun
 6 18:23:26 2012
@@ -45,16 +45,14 @@ function getAllComponentsForService ($se
   $componentResult = $dbAccessor->getAllServiceComponents($serviceName);
   if ($componentResult["result"] == 0) {
     foreach($componentResult["components"] as $componentName => $component) {
-      if($component["isMaster"] == 1) {
-        $hostsForComponentDBResult = $dbAccessor->getHostsForComponent($clusterName, $componentName);
-        if ($hostsForComponentDBResult["result"] != 0 ) {
-          $logger->log_error("Got error while getting hosts for component ".$hostsForComponentDBResult["error"]);
-          print json_encode($hostsForComponentDBResult);
-          return;
-        }
-        $allHosts = array_keys($hostsForComponentDBResult["hosts"]);
-        $component["hostName"] = $allHosts[0];
+      $hostsForComponentDBResult = $dbAccessor->getHostsForComponent($clusterName, $componentName);
+      if ($hostsForComponentDBResult["result"] != 0 ) {
+        $logger->log_error("Got error while getting hosts for component ".$hostsForComponentDBResult["error"]);
+        print json_encode($hostsForComponentDBResult);
+        return;
       }
+      $allHosts = array_keys($hostsForComponentDBResult["hosts"]);
+      $component["hostName"] = $allHosts[0];
       array_push($returnComponentsArray, $component);
     }
   } else {



Mime
View raw message