org.apache.hadoop.util
Class AsyncDiskService

java.lang.Object
  extended by org.apache.hadoop.util.AsyncDiskService

public class AsyncDiskService
extends Object


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
AsyncDiskService(String[] volumes)
          Create a AsyncDiskServices with a set of volumes (specified by their root directories).
 
Method Summary
 boolean awaitTermination(long milliseconds)
          Wait for the termination of the thread pools.
 void execute(String root, Runnable task)
          Execute the task sometime in the future, using ThreadPools.
 void shutdown()
          Gracefully start the shut down of all ThreadPools.
 List<Runnable> shutdownNow()
          Shut down all ThreadPools immediately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

AsyncDiskService

public AsyncDiskService(String[] volumes)
                 throws IOException
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.
Throws:
IOException
Method Detail

execute

public void execute(String root,
                    Runnable task)
Execute the task sometime in the future, using ThreadPools.


shutdown

public void shutdown()
Gracefully start the shut down of all ThreadPools.


awaitTermination

public boolean awaitTermination(long milliseconds)
                         throws InterruptedException
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

shutdownNow

public List<Runnable> shutdownNow()
Shut down all ThreadPools immediately.



Copyright © 2009 The Apache Software Foundation