org.apache.hadoop.mapreduce.server.tasktracker
Class Localizer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.server.tasktracker.Localizer

public class Localizer
extends Object

NOTE: This class is internal only and not intended for users!!


Nested Class Summary
static class Localizer.PermissionsHandler
          NOTE: This class is internal only class and not intended for users!!
 
Constructor Summary
Localizer(FileSystem fileSys, String[] lDirs)
          Create a Localizer instance
 
Method Summary
 void initializeAttemptDirs(String user, String jobId, String attemptId)
          Create taskDirs on all the disks.
 void initializeJobDirs(String user, JobID jobId)
          Prepare the job directories for a given job.
 void initializeJobLogDir(JobID jobId)
          Create job log directory and set appropriate permissions for the directory.
 void initializeUserDirs(String user)
          Initialize the local directories for a particular user on this TT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Localizer

public Localizer(FileSystem fileSys,
                 String[] lDirs)
Create a Localizer instance

Parameters:
fileSys -
lDirs -
Method Detail

initializeUserDirs

public void initializeUserDirs(String user)
                        throws IOException
Initialize the local directories for a particular user on this TT. This involves creation and setting permissions of the following directories

Parameters:
user -
Throws:
IOException

initializeJobDirs

public void initializeJobDirs(String user,
                              JobID jobId)
                       throws IOException
Prepare the job directories for a given job. To be called by the job localization code, only if the job is not already localized.
Here, we set 700 permissions on the job directories created on all disks. This we do so as to avoid any misuse by other users till the time TaskController.initializeJob(java.lang.String, java.lang.String, org.apache.hadoop.fs.Path, org.apache.hadoop.fs.Path, org.apache.hadoop.mapred.TaskUmbilicalProtocol, java.net.InetSocketAddress) is run at a later time to set proper private permissions on the job directories.

Parameters:
user -
jobId -
Throws:
IOException

initializeAttemptDirs

public void initializeAttemptDirs(String user,
                                  String jobId,
                                  String attemptId)
                           throws IOException
Create taskDirs on all the disks. Otherwise, in some cases, like when LinuxTaskController is in use, child might wish to balance load across disks but cannot itself create attempt directory because of the fact that job directory is writable only by the TT.

Parameters:
user -
jobId -
attemptId -
Throws:
IOException

initializeJobLogDir

public void initializeJobLogDir(JobID jobId)
Create job log directory and set appropriate permissions for the directory.

Parameters:
jobId -


Copyright © 2009 The Apache Software Foundation