org.apache.hadoop.mapred
Class UserLogCleaner
java.lang.Object
java.lang.Thread
org.apache.hadoop.mapred.UserLogCleaner
- All Implemented Interfaces:
- Runnable
public class UserLogCleaner
- extends Thread
This is used only in UserLogManager, to manage cleanup of user logs.
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
UserLogCleaner
public UserLogCleaner(UserLogManager userLogManager,
Configuration conf)
throws IOException
- Throws:
IOException
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
deleteJobLogs
public void deleteJobLogs(JobID jobid)
throws IOException
- Throws:
IOException
addOldUserLogsForDeletion
public void addOldUserLogsForDeletion(File loc,
Configuration conf)
throws IOException
- Adds the job log directories for deletion with default retain hours.
Deletes all other directories, if any.
- Parameters:
loc - location of log directoryconf -
- Throws:
IOException
clearOldUserLogs
public void clearOldUserLogs(Configuration conf)
throws IOException
- Clears all the logs in userlogs directory. This is usually called on
reinit/restart of the TaskTracker.
- Parameters:
conf -
- Throws:
IOException
markJobLogsForDeletion
public void markJobLogsForDeletion(long jobCompletionTime,
int retainHours,
JobID jobid)
- Adds job user-log directory to cleanup thread to delete logs after user-log
retain hours.
- Parameters:
jobCompletionTime - job completion time in millisretainHours - the user-log retain hours for the jobjobid - JobID for which user logs should be deleted
unmarkJobFromLogDeletion
public void unmarkJobFromLogDeletion(JobID jobid)
- Remove job from user log deletion.
- Parameters:
jobid -
Copyright © 2009 The Apache Software Foundation