public class MRAsyncDiskService extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
static String |
TOBEDELETED |
| Constructor and Description |
|---|
MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
String[] nonCanonicalVols) |
MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
TaskController taskController,
String[] nonCanonicalVols)
Create a AsyncDiskServices with a set of volumes (specified by their
root directories).
|
MRAsyncDiskService(JobConf conf)
Initialize MRAsyncDiskService based on conf.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long milliseconds)
Wait for the termination of the thread pools.
|
void |
cleanupAllVolumes()
Move all files/directories inside volume into TOBEDELETED, and then
delete them.
|
void |
cleanupDirsInAllVolumes(String[] dirsToDelete)
Move specified directories/files in each volume into TOBEDELETED, and then
delete them.
|
boolean |
moveAndDeleteAbsolutePath(String absolutePathName)
Move the path name to a temporary location and then delete it.
|
boolean |
moveAndDeleteFromEachVolume(String pathName)
Move the path name on each volume to a temporary location and then
delete them.
|
boolean |
moveAndDeleteRelativePath(String volume,
String pathName)
Move the path name on one volume to a temporary location and then
delete them.
|
void |
shutdown()
Gracefully start the shut down of all ThreadPools.
|
List<Runnable> |
shutdownNow()
Shut down all ThreadPools immediately.
|
public static final org.apache.commons.logging.Log LOG
public static final String TOBEDELETED
public MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
TaskController taskController,
String[] nonCanonicalVols)
throws IOException
localFileSystem - The localFileSystem used for deletions.nonCanonicalVols - The roots of the file system volumes, which may
be absolte paths, or paths relative to the ${user.dir} system property
("cwd").IOExceptionpublic MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
String[] nonCanonicalVols)
throws IOException
IOExceptionpublic MRAsyncDiskService(JobConf conf) throws IOException
conf - local file system and local dirs will be read from confIOExceptionpublic void shutdown()
public boolean awaitTermination(long milliseconds)
throws InterruptedException
milliseconds - The number of milliseconds to waitInterruptedExceptionpublic boolean moveAndDeleteRelativePath(String volume, String pathName) throws IOException
volume - The disk volumepathName - The path name relative to volume root.IOException - If the move failedpublic boolean moveAndDeleteFromEachVolume(String pathName) throws IOException
pathName - The path name relative to each volume rootIOException - If any of the move failedpublic void cleanupDirsInAllVolumes(String[] dirsToDelete) throws IOException
dirsToDelete - IOExceptionpublic void cleanupAllVolumes()
throws IOException
IOExceptionpublic boolean moveAndDeleteAbsolutePath(String absolutePathName) throws IOException
absolutePathName - The path name from root "/"IOException - If the move failedCopyright © 2009 The Apache Software Foundation