You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ni...@apache.org on 2008/03/05 17:14:46 UTC

svn commit: r633904 - in /hadoop/core/trunk: CHANGES.txt src/contrib/hod/hodlib/Common/util.py src/contrib/hod/hodlib/Hod/hadoop.py src/contrib/hod/hodlib/Hod/hod.py

Author: nigel
Date: Wed Mar  5 08:14:45 2008
New Revision: 633904

URL: http://svn.apache.org/viewvc?rev=633904&view=rev
Log:
HADOOP-2911. Make the information printed by the HOD allocate and info commands less verbose and clearer.  Contributed by VinodKumar.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/contrib/hod/hodlib/Common/util.py
    hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hadoop.py
    hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hod.py

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=633904&r1=633903&r2=633904&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Mar  5 08:14:45 2008
@@ -151,6 +151,9 @@
 
     HADOOP-2730. HOD documentation update.
     (Vinod Kumar Vavilapalli via ddas)
+
+    HADOOP-2911. Make the information printed by the HOD allocate and
+    info commands less verbose and clearer. (Vinod Kumar via nigel)
     
   BUG FIXES
 

Modified: hadoop/core/trunk/src/contrib/hod/hodlib/Common/util.py
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/hod/hodlib/Common/util.py?rev=633904&r1=633903&r2=633904&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/hod/hodlib/Common/util.py (original)
+++ hadoop/core/trunk/src/contrib/hod/hodlib/Common/util.py Wed Mar  5 08:14:45 2008
@@ -23,7 +23,7 @@
 reEscapeSeq = re.compile(reEscapeSeq)
 
 HOD_INTERRUPTED_CODE = 127
-HOD_INTERRUPTED_MESG = "Hod Interrupted. Cleaning up and exitting"
+HOD_INTERRUPTED_MESG = "Hod interrupted. Cleaning up and exiting"
 
 class AlarmException(Exception):
     def __init__(self, msg=''):

Modified: hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hadoop.py
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hadoop.py?rev=633904&r1=633903&r2=633904&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hadoop.py (original)
+++ hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hadoop.py Wed Mar  5 08:14:45 2008
@@ -439,16 +439,16 @@
         except HodInterruptException, h:
           self.__log.info(HOD_INTERRUPTED_MESG)
           self.delete_job(self.jobId)
-          self.__log.info("Job %s qdelled." % self.jobId)
+          self.__log.info("Job %s removed from queue." % self.jobId)
           raise h
 
         if jobStatus:
-          self.__log.info("Hod Job successfully submitted. JobId : %s." \
+          self.__log.info("Cluster Id %s" \
                                                               % self.jobId)
           try:
             self.ringmasterXRS = self.__get_ringmaster_client()
             
-            self.__log.info("Ringmaster at : %s." % self.ringmasterXRS )
+            self.__log.debug("Ringmaster at : %s" % self.ringmasterXRS )
             ringClient = None
             if self.ringmasterXRS:
               ringClient =  hodXRClient(self.ringmasterXRS)
@@ -457,13 +457,13 @@
                 self.__init_hadoop_service('hdfs', ringClient)
                 
               if hdfsStatus:
-                self.__log.info("HDFS UI on http://%s" % self.hdfsInfo)
+                self.__log.info("HDFS UI at http://%s" % self.hdfsInfo)
   
                 mapredStatus, mapredAddr, self.mapredInfo = \
                   self.__init_hadoop_service('mapred', ringClient)
   
                 if mapredStatus:
-                  self.__log.info("Mapred UI on http://%s" % self.mapredInfo)
+                  self.__log.info("Mapred UI at http://%s" % self.mapredInfo)
   
                   if self.__cfg['hod'].has_key('update-worker-info') \
                     and self.__cfg['hod']['update-worker-info']:
@@ -519,6 +519,7 @@
                             hdfsAddr, mapredAddr, clientParams,\
                             serverParams, finalServerParams,\
                             clusterFactor)
+                  self.__log.info("hadoop-site.xml at %s" % clusterDir)
                   # end of hadoop-site.xml generation
                 else:
                   status = 8
@@ -527,7 +528,7 @@
             else:
               status = 6
             if status != 0:
-              self.__log.info("Cleaning up job id %s, as cluster could not be allocated." % self.jobId)
+              self.__log.info("Cleaning up cluster id %s, as cluster could not be allocated." % self.jobId)
               if ringClient is None:
                 self.delete_job(self.jobId)
               else:
@@ -545,7 +546,7 @@
               self.__log.info("Job Shutdown by informing ringmaster.")
             else:
               self.delete_job(self.jobId)
-              self.__log.info("Job %s qdelled directly." % self.jobId)
+              self.__log.info("Job %s removed from queue directly." % self.jobId)
             raise h
         else:
           self.__log.critical("No job found, ringmaster failed to run.")

Modified: hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hod.py
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hod.py?rev=633904&r1=633903&r2=633904&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hod.py (original)
+++ hadoop/core/trunk/src/contrib/hod/hodlib/Hod/hod.py Wed Mar  5 08:14:45 2008
@@ -219,7 +219,7 @@
         except ValueError:
           print self.__hodhelp.help_allocate()
           self.__log.critical(
-          "%s operation requires a single argument. n nodes, or n-m nodes." % 
+          "%s operation requires a pos_int value for n(nodecount)." % 
           operation)
           self.__opCode = 3
         else:
@@ -231,7 +231,7 @@
             if hodInterrupt.isSet(): 
               self.__cleanup()
               raise HodInterruptException()
-            self.__log.info("Service Registry Started.")
+            self.__log.debug("Service Registry started.")
             try:
               allocateStatus = self.__cluster.allocate(clusterDir, min, max)    
             except HodInterruptException, h:
@@ -336,8 +336,8 @@
         clusterInfo = self.__clusterState.read()
         clusterStatus = self.__cluster.check_cluster(clusterInfo)
         if clusterStatus == 12:
-          self.__log.info(clusterDir)
           self.__print_cluster_info(clusterInfo)
+          self.__log.info("hadoop-site.xml at %s" % clusterDir)
         elif clusterStatus == 10:
           self.__log.critical("%s cluster is dead" % clusterDir)
         elif clusterStatus == 13:
@@ -350,6 +350,7 @@
             self.__log.critical("Cluster %s not allocated." % clusterDir)
           else:
             self.__print_cluster_info(clusterInfo)
+            self.__log.info("hadoop-site.xml at %s" % clusterDir)
             
           self.__opCode = clusterStatus
       else:
@@ -363,11 +364,19 @@
  
   def __print_cluster_info(self, clusterInfo):
     keys = clusterInfo.keys()
-    keys.sort()
-    for key in keys:
-      if key != 'env':
-        self.__log.info("%s\t%s" % (key, clusterInfo[key]))  
-            
+
+    _dict = { 
+              'jobid' : 'Cluster Id', 'min' : 'Nodecount',
+              'hdfs' : 'HDFS UI at' , 'mapred' : 'Mapred UI at'
+            }
+
+    for key in _dict.keys():
+      if clusterInfo.has_key(key):
+        self.__log.info("%s %s" % (_dict[key], clusterInfo[key]))
+
+    if clusterInfo.has_key('ring'):
+      self.__log.debug("%s\t%s" % ('Ringmaster at ', clusterInfo['ring']))
+    
     if self.__cfg['hod']['debug'] == 4:
       for var in clusterInfo['env'].keys():
         self.__log.debug("%s = %s" % (var, clusterInfo['env'][var]))
@@ -391,7 +400,7 @@
       if self.__opCode == 0:
         getattr(self, "_op_%s" % opList[0])(opList)
     except HodInterruptException, h:
-      self.__log.critical("op: %s failed because of an process interrupt." \
+      self.__log.critical("op: %s failed because of a process interrupt." \
                                                                 % operation)
       self.__opCode = HOD_INTERRUPTED_CODE
     except:
@@ -445,7 +454,7 @@
           time.sleep(self.__cfg['hod']['script-wait-time'])
           self.__log.debug('Slept for %d time. Now going to run the script' % self.__cfg['hod']['script-wait-time'])
         if hodInterrupt.isSet():
-          self.__log.debug('Interrupt set - not executing script')
+          self.__log.debug('Hod interrupted - not executing script')
         else:
           scriptRunner = hadoopScript(clusterDir, 
                                   self.__cfg['hod']['original-dir'])
@@ -461,7 +470,7 @@
       if self._is_cluster_allocated(clusterDir):
         self._op_deallocate(('deallocate', clusterDir))
     except HodInterruptException, h:
-      self.__log.critical("Script failed because of an process interrupt.")
+      self.__log.critical("Script failed because of a process interrupt.")
       self.__opCode = HOD_INTERRUPTED_CODE
     except:
       self.__log.critical("script: %s failed: %s" % (script,