Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.AsyncDiskService


   * This test creates some ExampleTasks and runs them.
   */
  public void testAsyncDiskService() throws Throwable {
 
    String[] vols = new String[]{"/0", "/1"};
    AsyncDiskService service = new AsyncDiskService(vols);
   
    int total = 100;
   
    for (int i = 0; i < total; i++) {
      service.execute(vols[i%2], new ExampleTask());
    }

    Exception e = null;
    try {
      service.execute("no_such_volume", new ExampleTask());
    } catch (RuntimeException ex) {
      e = ex;
    }
    assertNotNull("Executing a task on a non-existing volume should throw an "
        + "Exception.", e);
   
    service.shutdown();
    if (!service.awaitTermination(5000)) {
      fail("AsyncDiskService didn't shutdown in 5 seconds.");
    }
   
    assertEquals(total, count);
  }
View Full Code Here


    for (int v = 0; v < volumes.length; v++) {
      this.volumes[v] = normalizePath(volumes[v]);
   
    this.localFileSystem = localFileSystem;
   
    asyncDiskService = new AsyncDiskService(this.volumes);
   
    // Create one ThreadPool per volume
    for (int v = 0 ; v < volumes.length; v++) {
      // Create the root for file deletion
      Path absoluteSubdir = new Path(volumes[v], TOBEDELETED);
View Full Code Here

      this.volumes[v] = normalizePath(nonCanonicalVols[v]);
      LOG.debug("Normalized volume: " + nonCanonicalVols[v]
          + " -> " + this.volumes[v]);
   
   
    asyncDiskService = new AsyncDiskService(this.volumes);
   
    // Create one ThreadPool per volume
    for (int v = 0 ; v < volumes.length; v++) {
      // Create the root for file deletion
      Path absoluteSubdir = new Path(volumes[v], TOBEDELETED);
View Full Code Here

   */
  @Test
  public void testAsyncDiskService() throws Throwable {
 
    String[] vols = new String[]{"/0", "/1"};
    AsyncDiskService service = new AsyncDiskService(vols);
   
    int total = 100;
   
    for (int i = 0; i < total; i++) {
      service.execute(vols[i%2], new ExampleTask());
    }

    Exception e = null;
    try {
      service.execute("no_such_volume", new ExampleTask());
    } catch (RuntimeException ex) {
      e = ex;
    }
    assertNotNull("Executing a task on a non-existing volume should throw an "
        + "Exception.", e);
   
    service.shutdown();
    if (!service.awaitTermination(5000)) {
      fail("AsyncDiskService didn't shutdown in 5 seconds.");
    }
   
    assertEquals(total, count);
  }
View Full Code Here

      this.volumes[v] = normalizePath(nonCanonicalVols[v]);
      LOG.debug("Normalized volume: " + nonCanonicalVols[v]
          + " -> " + this.volumes[v]);
   
   
    asyncDiskService = new AsyncDiskService(this.volumes);
   
    // Create one ThreadPool per volume
    for (int v = 0 ; v < volumes.length; v++) {
      // Create the root for file deletion
      Path absoluteSubdir = new Path(volumes[v], TOBEDELETED);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.AsyncDiskService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.