类org.apache.hadoop.fs.swift.util.DurationStats源码实例Demo

下面列出了怎么用org.apache.hadoop.fs.swift.util.DurationStats的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: hadoop   文件: TestSwiftRestClient.java
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testPutAndDelete() throws Throwable {
  assumeEnabled();
  SwiftRestClient client = createClient();
  client.authenticate();
  Path path = new Path("restTestPutAndDelete");
  SwiftObjectPath sobject = SwiftObjectPath.fromPath(serviceURI, path);
  byte[] stuff = new byte[1];
  stuff[0] = 'a';
  client.upload(sobject, new ByteArrayInputStream(stuff), stuff.length);
  //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
  client.delete(sobject);
  //check file is gone
  try {
    Header[] headers = client.headRequest("expect fail",
                                          sobject,
                                          SwiftRestClient.NEWEST);
    Assert.fail("Expected deleted file, but object is still present: "
                + sobject);
  } catch (FileNotFoundException e) {
    //expected
  }
  for (DurationStats stats: client.getOperationStatistics()) {
    LOG.info(stats);
  }
}
 
源代码2 项目: hadoop   文件: SwiftFileSystemBaseTest.java
@AfterClass
public static void classTearDown() throws Exception {
  if (lastFs  != null) {
    List<DurationStats> statistics = lastFs.getOperationStatistics();
    for (DurationStats stat : statistics) {
      LOG.info(stat.toString());
    }
  }
}
 
源代码3 项目: big-c   文件: TestSwiftRestClient.java
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testPutAndDelete() throws Throwable {
  assumeEnabled();
  SwiftRestClient client = createClient();
  client.authenticate();
  Path path = new Path("restTestPutAndDelete");
  SwiftObjectPath sobject = SwiftObjectPath.fromPath(serviceURI, path);
  byte[] stuff = new byte[1];
  stuff[0] = 'a';
  client.upload(sobject, new ByteArrayInputStream(stuff), stuff.length);
  //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
  client.delete(sobject);
  //check file is gone
  try {
    Header[] headers = client.headRequest("expect fail",
                                          sobject,
                                          SwiftRestClient.NEWEST);
    Assert.fail("Expected deleted file, but object is still present: "
                + sobject);
  } catch (FileNotFoundException e) {
    //expected
  }
  for (DurationStats stats: client.getOperationStatistics()) {
    LOG.info(stats);
  }
}
 
源代码4 项目: big-c   文件: SwiftFileSystemBaseTest.java
@AfterClass
public static void classTearDown() throws Exception {
  if (lastFs  != null) {
    List<DurationStats> statistics = lastFs.getOperationStatistics();
    for (DurationStats stat : statistics) {
      LOG.info(stat.toString());
    }
  }
}
 
源代码5 项目: sahara-extra   文件: TestSwiftRestClient.java
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testPutAndDelete() throws Throwable {
  assumeEnabled();
  SwiftRestClient client = createClient();
  client.authenticate();
  Path path = new Path("restTestPutAndDelete");
  SwiftObjectPath sobject = SwiftObjectPath.fromPath(serviceURI, path);
  byte[] stuff = new byte[1];
  stuff[0] = 'a';
  client.upload(sobject, new ByteArrayInputStream(stuff), stuff.length);
  //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
  client.delete(sobject);
  //check file is gone
  try {
    Header[] headers = client.headRequest("expect fail",
                                          sobject,
                                          SwiftRestClient.NEWEST);
    Assert.fail("Expected deleted file, but object is still present: "
                + sobject);
  } catch (FileNotFoundException e) {
    //expected
  }
  for (DurationStats stats: client.getOperationStatistics()) {
    LOG.info(stats);
  }
}
 
源代码6 项目: sahara-extra   文件: SwiftFileSystemBaseTest.java
@AfterClass
public static void classTearDown() throws Exception {
  if (lastFs  != null) {
    List<DurationStats> statistics = lastFs.getOperationStatistics();
    for (DurationStats stat : statistics) {
      LOG.info(stat.toString());
    }
  }
}
 
源代码7 项目: hadoop   文件: SwiftRestClient.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */

public List<DurationStats> getOperationStatistics() {
  return durationStats.getDurationStatistics();
}
 
源代码8 项目: big-c   文件: SwiftRestClient.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */

public List<DurationStats> getOperationStatistics() {
  return durationStats.getDurationStatistics();
}
 
源代码9 项目: sahara-extra   文件: SwiftRestClient.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */

public List<DurationStats> getOperationStatistics() {
  return durationStats.getDurationStatistics();
}
 
源代码10 项目: hadoop   文件: SwiftNativeFileSystem.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */
public List<DurationStats> getOperationStatistics() {
  return store.getOperationStatistics();
}
 
源代码11 项目: hadoop   文件: SwiftNativeFileSystemStore.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */
public List<DurationStats> getOperationStatistics() {
  return swiftRestClient.getOperationStatistics();
}
 
源代码12 项目: big-c   文件: SwiftNativeFileSystem.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */
public List<DurationStats> getOperationStatistics() {
  return store.getOperationStatistics();
}
 
源代码13 项目: big-c   文件: SwiftNativeFileSystemStore.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */
public List<DurationStats> getOperationStatistics() {
  return swiftRestClient.getOperationStatistics();
}
 
源代码14 项目: sahara-extra   文件: SwiftNativeFileSystem.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */
public List<DurationStats> getOperationStatistics() {
  return store.getOperationStatistics();
}
 
源代码15 项目: sahara-extra   文件: SwiftNativeFileSystemStore.java
/**
 * Get the current operation statistics
 * @return a snapshot of the statistics
 */
public List<DurationStats> getOperationStatistics() {
  return swiftRestClient.getOperationStatistics();
}
 
 类所在包
 同包方法