Package org.apache.hadoop.fs.swift.util

Examples of org.apache.hadoop.fs.swift.util.Duration.finished()


    //check file exists
    Duration head = new Duration();
    Header[] responseHeaders = client.headRequest("expect success",
                                                  sobject,
                                                  SwiftRestClient.NEWEST);
    head.finished();
    LOG.info("head request duration " + head);
    for (Header header: responseHeaders) {
      LOG.info(header.toString());
    }
    //delete the file
View Full Code Here


  @Test(timeout = SWIFT_BULK_IO_TEST_TIMEOUT)
  public void testScaledWriteThenRead() throws Throwable {
    Path dir = new Path("/test/manysmallfiles");
    Duration rm1 = new Duration();
    fs.delete(dir, true);
    rm1.finished();
    fs.mkdirs(dir);
    Duration ls1 = new Duration();
    fs.listStatus(dir);
    ls1.finished();
    long count = getOperationCount();
View Full Code Here

    fs.delete(dir, true);
    rm1.finished();
    fs.mkdirs(dir);
    Duration ls1 = new Duration();
    fs.listStatus(dir);
    ls1.finished();
    long count = getOperationCount();
    SwiftTestUtils.noteAction("Beginning Write of "+ count + " files ");
    DurationStats writeStats = new DurationStats("write");
    DurationStats readStats = new DurationStats("read");
    String format = "%08d";
View Full Code Here

    for (long l = 0; l < count; l++) {
      String name = String.format(format, l);
      Path p = new Path(dir, "part-" + name);
      Duration d = new Duration();
      SwiftTestUtils.writeTextFile(fs, p, name, false);
      d.finished();
      writeStats.add(d);
      Thread.sleep(1000);
    }
    //at this point, the directory is full.
    SwiftTestUtils.noteAction("Beginning ls");
View Full Code Here

    //at this point, the directory is full.
    SwiftTestUtils.noteAction("Beginning ls");

    Duration ls2 = new Duration();
    FileStatus[] status2 = (FileStatus[]) fs.listStatus(dir);
    ls2.finished();
    assertEquals("Not enough entries in the directory", count, status2.length);

    SwiftTestUtils.noteAction("Beginning read");

    for (long l = 0; l < count; l++) {
View Full Code Here

      String name = String.format(format, l);
      Path p = new Path(dir, "part-" + name);
      Duration d = new Duration();
      String result = SwiftTestUtils.readBytesToString(fs, p, name.length());
      assertEquals(name, result);
      d.finished();
      readStats.add(d);
    }
    //do a recursive delete
    SwiftTestUtils.noteAction("Beginning delete");
    Duration rm2 = new Duration();
View Full Code Here

    }
    //do a recursive delete
    SwiftTestUtils.noteAction("Beginning delete");
    Duration rm2 = new Duration();
    fs.delete(dir, true);
    rm2.finished();
    //print the stats
    LOG.info(String.format("'filesystem','%s'",fs.getUri()));
    LOG.info(writeStats.toString());
    LOG.info(readStats.toString());
    LOG.info(String.format(
View Full Code Here

    } catch (IOException e) {
      //release the connection -always
      method.releaseConnection();
      throw e;
    } finally {
      duration.finished();
      durationStats.add(method.getName()+" " + reason, duration, success);
    }
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.