Package org.apache.hadoop.util
Class AsyncDiskService
java.lang.Object
org.apache.hadoop.util.AsyncDiskService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAsyncDiskService(String[] volumes) Create a AsyncDiskServices with a set of volumes (specified by their root directories). -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long milliseconds) Wait for the termination of the thread pools.voidExecute the task sometime in the future, using ThreadPools.voidshutdown()Gracefully start the shut down of all ThreadPools.Shut down all ThreadPools immediately.
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
AsyncDiskService
Create a AsyncDiskServices with a set of volumes (specified by their root directories). The AsyncDiskServices uses one ThreadPool per volume to do the async disk operations.- Parameters:
volumes- The roots of the file system volumes.
-
-
Method Details
-
execute
Execute the task sometime in the future, using ThreadPools.- Parameters:
root- root.task- task.
-
shutdown
public void shutdown()Gracefully start the shut down of all ThreadPools. -
awaitTermination
Wait for the termination of the thread pools.- Parameters:
milliseconds- The number of milliseconds to wait- Returns:
- true if all thread pools are terminated without time limit
- Throws:
InterruptedException- if the thread is interrupted.
-
shutdownNow
Shut down all ThreadPools immediately.- Returns:
- Runnable List.
-