Browse Source

AMBARI-481. Units of various config values not displayed on review and deploy page (Contributed by Yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347302 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 years ago
parent
commit
e4994a73f3
5 changed files with 48 additions and 62 deletions
  1. 2 0
      CHANGES.txt
  2. 23 48
      hmc/css/common.css
  3. 9 9
      hmc/db/schema.dump
  4. 5 3
      hmc/js/configureServicesUtils.js
  5. 9 2
      hmc/js/reviewAndDeploy.js

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-481. Units of various config values not displayed on review and deploy page (Yusaku via Vikram)
+
   AMBARI-480. Reduce Page Load Time By Combining HMC JS Files (Varun via Vikram)
 
   AMBARI-479. Add nodes after install does not allow re-bootstrap if user closes browser after bootstrap and before starting services (Vikram)

+ 23 - 48
hmc/css/common.css

@@ -1,9 +1,12 @@
-header, footer, aside, nav, article, section {display: block;}
+header, footer, aside, nav, article, section {
+  display: block;
+}
+
 header {
 	margin:10px 0;
-        height:100px;
-        background-color:white;
-        font-size:300%;
+  height:100px;
+  background-color:white;
+  font-size:300%;
 }
 
 body { 
@@ -77,20 +80,9 @@ select {
 }
 
 #installationWizardDivId {
-
- /* The following three lines to auto-adjust height
-  min-height:500px;
-  height:auto !important;
-  height:500px; 
-  */
-
-  /*
-  overflow: auto;
-  */
   margin-left:auto;
   margin-right:auto;
-  /*max-height:500px;*/
-  border:1px; /*solid;*/
+  border:1px;
   background-color:#FFF;
   padding:20px 20px 20px;
   width:940px;
@@ -110,12 +102,10 @@ select {
 }
 
 #installationMainFormsDivId {
-  /* border:1px solid; */
   display:block;
 }
 
 #displayLogsContentDivId {
-  /* scroll box */
   height: 500px;
   width: 600px;
   padding: 5px;
@@ -131,11 +121,7 @@ table {
   font-size:1em;
   cellspacing:10px;
   cellpadding:10px;
-  /*
-  background-color:#F4F4F4;
-  */
-  border:1px solid #DBDBDB ;
-
+  border:1px solid #DBDBDB;
 }
 
 caption {
@@ -150,7 +136,7 @@ thead {
   font-weight:bold;
   color:white;
   background-color:#65B642;
-  border-bottom:1px solid #7A7A7A ;
+  border-bottom:1px solid #7A7A7A;
 }
 
 thead tr {
@@ -165,12 +151,6 @@ th {
 }
 
 tr {
-  /* 
-  height:30px;
-  opacity:0.75;
-  */
-
-  /* Color transition */
   transition: background-color 0.5s cubic-bezier(.09, .99, .37, .98);
   -moz-transition: background-color 0.5s cubic-bezier(.09, .99, .37, .98);    /* FF3.7+ */
   -o-transition: background-color 0.5s cubic-bezier(.09, .99, .37, .98) ;      /* Opera 10.5 */
@@ -186,18 +166,6 @@ td {
   padding:10px;
 }
 
-/*
-.formElement {
-  margin:3px;
-  overflow:auto;
-  border:1px solid #F0F0E8;
-}
-
-.formElement:hover {
-  border:1px solid #B2B299;
-}
-*/
-
 .contextualHelp {
   margin-left:10px;
   width:300px;
@@ -282,21 +250,28 @@ div.formElement {
 	padding-top:4px;
 }
 
-#deployDynamicRenderDivId input[readonly] {
+#deployDynamicRenderDivId input {
 	display:block!important;
+	float:left;
 }
 
 #labelForSelectAllId {
 	font-size:12px!important;
 }
 
-input.unit-MB,
-input.unit-B,
-input.unit-hours,
-input.unit-ms {
-	width:100px;
+#configureClusterAdvancedCoreDivId input {
+  float:left;
+}
+
+input.unit, input[readonly].unit {
+	width:80px;
 }
 
+label.unit {
+  margin-top:3px;
+  margin-left:4px;
+  width:auto!important;  
+}
 
 a.btn {
 	color:#333;

+ 9 - 9
hmc/db/schema.dump

@@ -260,7 +260,7 @@ INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, de
 --                                         gsCluster.properties keys
 
 -- maps to hadoop_heap_size in gsCluster.properties in MB
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "hadoop_heapsize", "1024", "Hadoop maximum Java heap size", "Maximum Java heap size for daemons such as Balancer (Java option -Xmx)", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit": "MB" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "hadoop_heapsize", "1024", "Hadoop maximum Java heap size", "Maximum Java heap size for daemons such as Balancer (Java option -Xmx)", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit": "MB", "type":"int" }' );
 
 -- maps to namenode_javaheap in gsCluster.properties in MB
 INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "namenode_heapsize", "1024", "NameNode Java heap size", "Initial and maximum Java heap size for NameNode (Java options -Xms and -Xmx)", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"MB" }' );
@@ -284,10 +284,10 @@ INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, de
 INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "jtnode_heapsize", "1024", "JobTracker maximum Java heap size", "Maximum Java heap size for JobTracker in MB (Java option -Xmx)", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"MB" }' );
 
 -- maps to mapred_map_tasks_max in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "mapred_map_tasks_max", "4", "Number of Map slots per node", "Number of slots that Map tasks that run simultaneously can occupy on a TaskTracker", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "mapred_map_tasks_max", "4", "Number of Map slots per node", "Number of slots that Map tasks that run simultaneously can occupy on a TaskTracker", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 -- maps to mapred_red_tasks_max in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "mapred_red_tasks_max", "2", "Number of Reduce slots per node", "Number of slots that Reduce tasks that run simultaneously can occupy on a TaskTracker.", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "mapred_red_tasks_max", "2", "Number of Reduce slots per node", "Number of slots that Reduce tasks that run simultaneously can occupy on a TaskTracker.", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 -- maps to mapred_cluster_map_mem_mb in gscluster.
 INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "mapred_cluster_map_mem_mb", "-1", "Cluster's Map slot size (virtual memory)", "The virtual memory size of a single Map slot in the MapReduce framework", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"MB" }' );
@@ -315,29 +315,29 @@ INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, de
 
 
 -- maps to io_sort_spill_percent in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "io_sort_spill_percent", "0.9", "Limit on buffer", "Percentage of sort buffer used for record collection (Expert-only configuration)", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "io_sort_spill_percent", "0.9", "Limit on buffer", "Percentage of sort buffer used for record collection (Expert-only configuration)", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 
 -- maps to mapreduce_userlog_retainhours in gscluster.
 INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "mapreduce_userlog_retainhours", "24", "Job log retention (hours)", "The maximum time, in hours, for which the user-logs are to be retained after the job completion.", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"hours" }' );
 
 -- maps to max_tasks_per_job in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "maxtasks_per_job", "-1", "Maximum number tasks for a Job", "Maximum number of tasks for a single Job", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "maxtasks_per_job", "-1", "Maximum number tasks for a Job", "Maximum number of tasks for a single Job", "MAPREDUCE" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 -- maps to dfs_datanode_failed_volume_tolerated in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "dfs_datanode_failed_volume_tolerated", "0", "DataNode volumes failure toleration", "The number of volumes that are allowed to fail before a datanode stops offering service", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "dfs_datanode_failed_volume_tolerated", "0", "DataNode volumes failure toleration", "The number of volumes that are allowed to fail before a datanode stops offering service", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 -- maps to tickTime in gscluster.
 INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "tickTime", "2000", "Length of single Tick", "The length of a single tick in milliseconds, which is the basic time unit used by ZooKeeper", "ZOOKEEPER" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"ms" }' );
 
 -- maps to initLimit in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "initLimit", "10", "Ticks to allow for sync at Init", "Amount of time, in ticks to allow followers to connect and sync to a leader", "ZOOKEEPER" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "initLimit", "10", "Ticks to allow for sync at Init", "Amount of time, in ticks to allow followers to connect and sync to a leader", "ZOOKEEPER" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 -- maps to syncLimit in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "syncLimit", "5", "Ticks to allow for sync at Runtime", "Amount of time, in ticks to allow followers to connect an", "ZOOKEEPER" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "syncLimit", "5", "Ticks to allow for sync at Runtime", "Amount of time, in ticks to allow followers to connect an", "ZOOKEEPER" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 -- maps to clientPort in gscluster.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "clientPort", "2181", "Port for running ZK Server", "Port for running ZooKeeper server", "ZOOKEEPER" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "clientPort", "2181", "Port for running ZK Server", "Port for running ZooKeeper server", "ZOOKEEPER" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"int" }' );
 
 
 -- maps to hbase_master_heapsize in gscluster in MB.

+ 5 - 3
hmc/js/configureServicesUtils.js

@@ -5,7 +5,9 @@ var globalPasswordsArray = [];
 
 function generateDivForService (option, type, service, property, unit, displayAttributes) {
 	
-  var unitString = (unit != null) ? unit : '';
+  var unitClass = (unit != null) ? 'unit' : '';
+  var unitLabel = (unit != null && unit != 'int') ? unit : '';
+  
   var readOnlyFlag= false;
   if (displayAttributes != null && displayAttributes.editable != null
       && !displayAttributes.editable) {
@@ -15,12 +17,12 @@ function generateDivForService (option, type, service, property, unit, displayAt
   var retString = '<div class="formElement">' +
     '<label for="' + service + '">' + option['displayName'] + '</label>' +
     //((unitString != '') ? '<div class="input-append">' : '') +
-    '<input class="unit-' + unit + '" type="' + type + '" id="' + property + '" name="' + service + '" value="' + option['value'] + '"';
+    '<input class="' + unitClass + '" type="' + type + '" id="' + property + '" name="' + service + '" value="' + option['value'] + '"';
   if (readOnlyFlag) {
     retString += ' readonly="readonly" ';
   }
 
-  retString += '> ' + unitString +
+  retString += '><label class="unit">' + unitLabel + '</label>' + 
     '<div class="contextualHelp">' + option['description'] + '</div>' +
     //((unitString != '') ? '</div>' : '') +
     '<div class="formInputErrorReason" id="' + property + 'ErrorReason' + '"></div>' +

+ 9 - 2
hmc/js/reviewAndDeploy.js

@@ -1,5 +1,7 @@
 function renderDeploySummary (deployInfo) {
   var deploySummary = "";
+  
+  var unit, unitClass, unitLabel;
 
   for (var serviceName in deployInfo.services) {
     var serviceHasToBeRendered = false;
@@ -48,10 +50,15 @@ function renderDeploySummary (deployInfo) {
             valueAttr = '';
           }
         }
-
+        
+        unit = perServiceInfo.properties[mPropertiesKey].unit;
+        unitClass = (unit != null) ? 'unit' : '';
+        unitLabel = (unit != null && unit != 'int') ? unit : '';        
+        
         propertySummary += '<div class="formElement">' +
                              '<label for=' + mPropertiesKey  + 'Id>' + perServiceInfo.properties[mPropertiesKey].displayName + '</label>' +
-                             '<input type=' + type + ' name=' + mPropertiesKey + 'Name id=' + mPropertiesKey + 'Id ' + readOnlyAttr + ' ' + valueAttr + '>' +
+                             '<input class="' + unitClass + '" type=' + type + ' name=' + mPropertiesKey + 'Name id=' + mPropertiesKey + 'Id ' + readOnlyAttr + ' ' + valueAttr + '>' +
+                             '<label class="unit">' + unitLabel + '</label>' +
                            '</div>';
       }
     }