## 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.

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Thread
`Thread.State, Thread.UncaughtExceptionHandler`

Field Summary

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`UserLogCleaner(UserLogManager userLogManager, Configuration conf)`

Method Summary
`void` `addOldUserLogsForDeletion(File loc, Configuration conf)` Adds the job log directories for deletion with default retain hours.
`void` `clearOldUserLogs(Configuration conf)` Clears all the logs in userlogs directory.
`void` `deleteJobLogs(JobID jobid)`
`void` `markJobLogsForDeletion(long jobCompletionTime, int retainHours, JobID jobid)` Adds job user-log directory to cleanup thread to delete logs after user-log retain hours.
`void` `run()`
`void` `unmarkJobFromLogDeletion(JobID jobid)` Remove job from user log deletion.

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`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### UserLogCleaner

    public UserLogCleaner(UserLogManager userLogManager,
                          Configuration conf)
                   throws IOException

Throws:
  `IOException`

Method Detail

### 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 directory
    `conf` -
  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 millis
    `retainHours` - the user-log retain hours for the job
    `jobid` - 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