本文整理汇总了Java中org.apache.hadoop.fs.swift.util.DurationStats类的典型用法代码示例。如果您正苦于以下问题:Java DurationStats类的具体用法?Java DurationStats怎么用?Java DurationStats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DurationStats类属于org.apache.hadoop.fs.swift.util包,在下文中一共展示了DurationStats类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testPutAndDelete
import org.apache.hadoop.fs.swift.util.DurationStats; //导入依赖的package包/类
@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);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:37,代码来源:TestSwiftRestClient.java
示例2: classTearDown
import org.apache.hadoop.fs.swift.util.DurationStats; //导入依赖的package包/类
@AfterClass
public static void classTearDown() throws Exception {
if (lastFs != null) {
List<DurationStats> statistics = lastFs.getOperationStatistics();
for (DurationStats stat : statistics) {
LOG.info(stat.toString());
}
}
}
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:SwiftFileSystemBaseTest.java
示例3: getOperationStatistics
import org.apache.hadoop.fs.swift.util.DurationStats; //导入依赖的package包/类
/**
* Get the current operation statistics
* @return a snapshot of the statistics
*/
public List<DurationStats> getOperationStatistics() {
return durationStats.getDurationStatistics();
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:SwiftRestClient.java
示例4: getOperationStatistics
import org.apache.hadoop.fs.swift.util.DurationStats; //导入依赖的package包/类
/**
* Get the current operation statistics
* @return a snapshot of the statistics
*/
public List<DurationStats> getOperationStatistics() {
return store.getOperationStatistics();
}
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:SwiftNativeFileSystem.java
示例5: getOperationStatistics
import org.apache.hadoop.fs.swift.util.DurationStats; //导入依赖的package包/类
/**
* Get the current operation statistics
* @return a snapshot of the statistics
*/
public List<DurationStats> getOperationStatistics() {
return swiftRestClient.getOperationStatistics();
}
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:SwiftNativeFileSystemStore.java
注:本文中的org.apache.hadoop.fs.swift.util.DurationStats类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论