瀏覽代碼

AMBARI-529. Fix Advanced Config: HDFS reserved space is in bytes. Too many bytes to count. (Contributed by Hitesh)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347201 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 年之前
父節點
當前提交
2564d76012
共有 4 個文件被更改,包括 12 次插入2 次删除
  1. 2 0
      CHANGES.txt
  2. 1 1
      hmc/db/schema.dump
  3. 4 0
      hmc/php/puppet/genmanifest/hostsConfig.php
  4. 5 1
      hmc/php/util/sequentialScriptRunner.php

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 
 Release 0.1.x - unreleased
 Release 0.1.x - unreleased
 
 
+  AMBARI-529. Fix Advanced Config: HDFS reserved space is in bytes. Too many bytes to count. (Hitesh via Vikram)
+
   AMBARI-530. HMC UI shows undefined for nodes after single node install (Yusaku via Vikram)
   AMBARI-530. HMC UI shows undefined for nodes after single node install (Yusaku via Vikram)
 
 
   AMBARI-532. add ganglia monitor to all masters (Mahadev via Vikram)
   AMBARI-532. add ganglia monitor to all masters (Mahadev via Vikram)

+ 1 - 1
hmc/db/schema.dump

@@ -268,7 +268,7 @@ 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 ( "namenode_opt_newsize", "200", "NameNode new generation size", "Default size of Java new generation for NameNode (Java option -XX:NewSize)", "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 ( "namenode_opt_newsize", "200", "NameNode new generation size", "Default size of Java new generation for NameNode (Java option -XX:NewSize)", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"MB" }' );
 
 
 -- maps to datanode_du_reserved in gscluster in bytes.
 -- maps to datanode_du_reserved in gscluster in bytes.
-INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "datanode_du_reserved", "1073741824", "Reserved space for HDFS", "Reserved space in bytes per volume", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"B" }' );
+INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "datanode_du_reserved", "1", "Reserved space for HDFS", "Reserved space in GB per volume", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"GB" }' );
 
 
 -- maps to dt_heapsize in gscluster in MB.
 -- maps to dt_heapsize in gscluster in MB.
 INSERT OR REPLACE INTO "ConfigProperties" ( key, default_value, display_name, description, service_name, display_type, display_attributes ) VALUES ( "dtnode_heapsize", "1024", "DataNode maximum Java heap size", "Maximum Java heap size for DataNode (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 ( "dtnode_heapsize", "1024", "DataNode maximum Java heap size", "Maximum Java heap size for DataNode (Java option -Xmx)", "HDFS" , "", '{ "isPassword": false, "noDisplay": false, "reconfigurable": true, "displayType": "text", "unit":"MB" }' );

+ 4 - 0
hmc/php/puppet/genmanifest/hostsConfig.php

@@ -78,6 +78,10 @@ class HostsConfigManifest {
            ($key == "snappy_enabled") || 
            ($key == "snappy_enabled") || 
            ($key == "wipeoff_data") ) {
            ($key == "wipeoff_data") ) {
         $manifest = $manifest . $value . "\n";
         $manifest = $manifest . $value . "\n";
+      } else if ($key == "datanode_du_reserved") {
+        // convert GB to bytes and round off to whole number
+        $newVal = round(intval($value) * 1024 * 1024 * 1024);
+        $manifest = $manifest . "\"" .  $newVal . "\"\n";
       } else {
       } else {
         $manifest = $manifest . "\"" .  $value . "\"\n";
         $manifest = $manifest . "\"" .  $value . "\"\n";
       }
       }

+ 5 - 1
hmc/php/util/sequentialScriptRunner.php

@@ -30,8 +30,12 @@ function updateProgressForStage($clusterName, $rootTxnId, $orchestratorTxnId,
   $numNodesSucceeded = 0;
   $numNodesSucceeded = 0;
   $additionalInfo = array();
   $additionalInfo = array();
 
 
+  $foundDir = FALSE;
   if (is_dir($commandOutputDir) && $dirHandle = opendir($commandOutputDir)) {
   if (is_dir($commandOutputDir) && $dirHandle = opendir($commandOutputDir)) {
-    $logger->log_debug($commandOutputDir . " exists finally ");
+    if (!$foundDir) {
+      $logger->log_debug($commandOutputDir . " exists finally ");
+    }
+    $foundDir = TRUE;
     while (false !== ($entry = readdir($dirHandle))) {
     while (false !== ($entry = readdir($dirHandle))) {
       if ($entry == "." || $entry == "..") {
       if ($entry == "." || $entry == "..") {
         continue;
         continue;