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.Modifier and Type | Field and Description |
---|---|
static int |
DIRECTORIES_PER_LEVEL |
Constructor and Description |
---|
LocalCacheDirectoryManager(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
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.
|
public static final int DIRECTORIES_PER_LEVEL
public LocalCacheDirectoryManager(Configuration conf)
public String getRelativePathForLocalization()
String
relative path for localizationpublic void decrementFileCountForPath(String relPath)
Copyright © 2013 Apache Software Foundation. All rights reserved.