public class MRAsyncDiskService
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
static java.lang.String |
TOBEDELETED |
| Constructor and Description |
|---|
MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
java.lang.String[] nonCanonicalVols) |
MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
TaskController taskController,
java.lang.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(java.lang.String[] dirsToDelete)
Move specified directories/files in each volume into TOBEDELETED, and then
delete them.
|
boolean |
moveAndDeleteAbsolutePath(java.lang.String absolutePathName)
Move the path name to a temporary location and then delete it.
|
boolean |
moveAndDeleteFromEachVolume(java.lang.String pathName)
Move the path name on each volume to a temporary location and then
delete them.
|
boolean |
moveAndDeleteRelativePath(java.lang.String volume,
java.lang.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.
|
java.util.List<java.lang.Runnable> |
shutdownNow()
Shut down all ThreadPools immediately.
|
public static final org.apache.commons.logging.Log LOG
public static final java.lang.String TOBEDELETED
public MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
TaskController taskController,
java.lang.String[] nonCanonicalVols)
throws java.io.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").java.io.IOExceptionpublic MRAsyncDiskService(org.apache.hadoop.fs.FileSystem localFileSystem,
java.lang.String[] nonCanonicalVols)
throws java.io.IOException
java.io.IOExceptionpublic MRAsyncDiskService(JobConf conf) throws java.io.IOException
conf - local file system and local dirs will be read from confjava.io.IOExceptionpublic void shutdown()
public java.util.List<java.lang.Runnable> shutdownNow()
public boolean awaitTermination(long milliseconds)
throws java.lang.InterruptedException
milliseconds - The number of milliseconds to waitjava.lang.InterruptedExceptionpublic boolean moveAndDeleteRelativePath(java.lang.String volume,
java.lang.String pathName)
throws java.io.IOException
volume - The disk volumepathName - The path name relative to volume root.java.io.IOException - If the move failedpublic boolean moveAndDeleteFromEachVolume(java.lang.String pathName)
throws java.io.IOException
pathName - The path name relative to each volume rootjava.io.IOException - If any of the move failedpublic void cleanupDirsInAllVolumes(java.lang.String[] dirsToDelete)
throws java.io.IOException
dirsToDelete - java.io.IOExceptionpublic void cleanupAllVolumes()
throws java.io.IOException
java.io.IOExceptionpublic boolean moveAndDeleteAbsolutePath(java.lang.String absolutePathName)
throws java.io.IOException
absolutePathName - The path name from root "/"java.io.IOException - If the move failedCopyright © 2009 The Apache Software Foundation