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/09/11 21:16:31 UTC
svn commit: r694428 - in /hadoop/core/branches/branch-0.18/src/contrib/hod:
CHANGES.txt bin/hod hodlib/Common/logger.py hodlib/Hod/hod.py
Author: nigel
Date: Thu Sep 11 12:16:28 2008
New Revision: 694428
URL: http://svn.apache.org/viewvc?rev=694428&view=rev
Log:
Merge of -r 693704:693705 from trunk to branch-0.18 to fix HADOOP-4060
Modified:
hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt
hadoop/core/branches/branch-0.18/src/contrib/hod/bin/hod
hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Common/logger.py
hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py
Modified: hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt?rev=694428&r1=694427&r2=694428&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/src/contrib/hod/CHANGES.txt Thu Sep 11 12:16:28 2008
@@ -1,6 +1,13 @@
HOD Change Log
-Release 0.18.0 - Unreleased
+Release 0.18.1 - Unreleased
+
+ INCOMPATIBLE CHANGES
+
+ HADOOP-4060. Modified HOD to rotate log files on the client side.
+ (Vinod Kumar Vavilapalli via yhemanth)
+
+Release 0.18.0 - 2008-08-19
INCOMPATIBLE CHANGES
Modified: hadoop/core/branches/branch-0.18/src/contrib/hod/bin/hod
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/contrib/hod/bin/hod?rev=694428&r1=694427&r2=694428&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/contrib/hod/bin/hod (original)
+++ hadoop/core/branches/branch-0.18/src/contrib/hod/bin/hod Thu Sep 11 12:16:28 2008
@@ -156,7 +156,10 @@
True, None, False, True, 'l'),
('script-wait-time', 'pos_int', 'Specifies the time to wait before running the script. Used with the hod.script option.',
- True, 10, False, True, 'W')),
+ True, 10, False, True, 'W'),
+
+ ('log-rollover-count', 'pos_int', 'Specifies the number of rolled-over log files of HOD client. A zero value disables rollover.',
+ True, 5, False, True, 'L')),
'resource_manager' : (
('id', 'string', 'Batch scheduler ID: torque|condor.',
Modified: hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Common/logger.py
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Common/logger.py?rev=694428&r1=694427&r2=694428&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Common/logger.py (original)
+++ hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Common/logger.py Thu Sep 11 12:16:28 2008
@@ -310,12 +310,18 @@
logFile = os.path.join(logDirectory, "%s-%s.log" % (
self.__appName, loggerName))
+ logFilePresent = False
+ if(os.path.exists(logFile)):
+ logFilePresent = True
+
if sys.version.startswith('2.4'):
fileHandler = hodRotatingFileHandler(logFile,
maxBytes=maxBytes, backupCount=backupCount)
else:
fileHandler = logging.handlers.RotatingFileHandler(logFile,
maxBytes=maxBytes, backupCount=backupCount)
+ if logFilePresent and backupCount:
+ fileHandler.doRollover()
fileHandler.setLevel(loggingLevel)
fileHandler.setFormatter(fileFormater)
Modified: hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py?rev=694428&r1=694427&r2=694428&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py (original)
+++ hadoop/core/branches/branch-0.18/src/contrib/hod/hodlib/Hod/hod.py Thu Sep 11 12:16:28 2008
@@ -169,8 +169,9 @@
return self.__log
def __setup_cluster_logger(self, directory):
- self.__baseLogger.add_file(logDirectory=directory, level=4,
- addToLoggerNames=(self.__user ,))
+ self.__baseLogger.add_file(logDirectory=directory, level=4,
+ backupCount=self.__cfg['hod']['log-rollover-count'],
+ addToLoggerNames=(self.__user ,))
def __setup_cluster_state(self, directory):
self.__clusterState = hodState(directory)