public class LocalDirAllocator extends Object
Constructor and Description |
---|
LocalDirAllocator(String contextCfgItemName)
Create an allocator object
|
Modifier and Type | Method and Description |
---|---|
File |
createTmpFileForWrite(String pathStr,
long size,
Configuration conf)
Creates a temporary file in the local FS.
|
Path |
getLocalPathForWrite(String pathStr,
Configuration conf)
Get a path from the local FS.
|
Path |
getLocalPathForWrite(String pathStr,
long size,
Configuration conf)
Get a path from the local FS.
|
Path |
getLocalPathToRead(String pathStr,
Configuration conf)
Get a path from the local FS for reading.
|
boolean |
ifExists(String pathStr,
Configuration conf)
We search through all the configured dirs for the file's existence
and return true when we find
|
static boolean |
isContextValid(String contextCfgItemName)
Method to check whether a context is valid
|
public LocalDirAllocator(String contextCfgItemName)
contextCfgItemName
- public Path getLocalPathForWrite(String pathStr, Configuration conf) throws IOException
pathStr
- the requested path (this will be created on the first
available disk)conf
- the Configuration objectIOException
public Path getLocalPathForWrite(String pathStr, long size, Configuration conf) throws IOException
pathStr
- the requested path (this will be created on the first
available disk)size
- the size of the file that is going to be writtenconf
- the Configuration objectIOException
public Path getLocalPathToRead(String pathStr, Configuration conf) throws IOException
pathStr
- the requested file (this will be searched)conf
- the Configuration objectIOException
public File createTmpFileForWrite(String pathStr, long size, Configuration conf) throws IOException
pathStr
- prefix for the temporary filesize
- the size of the file that is going to be writtenconf
- the Configuration objectIOException
public static boolean isContextValid(String contextCfgItemName)
contextCfgItemName
- public boolean ifExists(String pathStr, Configuration conf)
pathStr
- the requested file (this will be searched)conf
- the Configuration objectIOException
Copyright © 2010 The Apache Software Foundation