org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer
Class LocalCacheDirectoryManager

java.lang.Object
  extended by org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalCacheDirectoryManager

public class LocalCacheDirectoryManager
extends Object

LocalCacheDirectoryManager is used for managing hierarchical directories for local cache. It will allow to restrict the number of files in a directory to YarnConfiguration.NM_LOCAL_CACHE_MAX_FILES_PER_DIRECTORY which includes 36 sub-directories (named from 0 to 9 and a to z). Root directory is represented by an empty string. It internally maintains a vacant directory queue. As soon as the file count for the directory reaches its limit; new files will not be created in it until at least one file is deleted from it. New sub directories are not created unless a getRelativePathForLocalization() request is made and nonFullDirectories are empty. Note : this structure only returns relative localization path but doesn't create one on disk.


Field Summary
static int DIRECTORIES_PER_LEVEL
           
 
Constructor Summary
LocalCacheDirectoryManager(org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
 void decrementFileCountForPath(String relPath)
          This method will reduce the file count for the directory represented by path.
 String getRelativePathForLocalization()
          This method will return relative path from the first available vacant directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORIES_PER_LEVEL

public static final int DIRECTORIES_PER_LEVEL
See Also:
Constant Field Values
Constructor Detail

LocalCacheDirectoryManager

public LocalCacheDirectoryManager(org.apache.hadoop.conf.Configuration conf)
Method Detail

getRelativePathForLocalization

public String getRelativePathForLocalization()
This method will return relative path from the first available vacant directory.

Returns:
String relative path for localization

decrementFileCountForPath

public void decrementFileCountForPath(String relPath)
This method will reduce the file count for the directory represented by path. The root directory of this Local cache directory manager is represented by an empty string.



Copyright © 2014 Apache Software Foundation. All Rights Reserved.