当前位置: 首页>>代码示例>>Java>>正文


Java SwiftNativeFileSystem类代码示例

本文整理汇总了Java中org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem的典型用法代码示例。如果您正苦于以下问题:Java SwiftNativeFileSystem类的具体用法?Java SwiftNativeFileSystem怎么用?Java SwiftNativeFileSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SwiftNativeFileSystem类属于org.apache.hadoop.fs.swift.snative包,在下文中一共展示了SwiftNativeFileSystem类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: delete

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
private void delete(SwiftNativeFileSystem fs, Path path) {
  try {
    if (!fs.delete(path, false)) {
      LOG.warn("Failed to delete " + path);
    }
  } catch (IOException e) {
    LOG.warn("deleting " + path, e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:TestSwiftFileSystemBasicOps.java

示例2: deleteR

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
private void deleteR(SwiftNativeFileSystem fs, Path path) {
  try {
    if (!fs.delete(path, true)) {
      LOG.warn("Failed to delete " + path);
    }
  } catch (IOException e) {
    LOG.warn("deleting " + path, e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:TestSwiftFileSystemBasicOps.java

示例3: testManyPartitionedFile

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
/**
 * Test sticks up a very large partitioned file and verifies that
 * it comes back unchanged.
 * @throws Throwable
 */
@Test(timeout = SWIFT_BULK_IO_TEST_TIMEOUT)
public void testManyPartitionedFile() throws Throwable {
  final Path path = new Path("/test/testManyPartitionedFile");

  int len = PART_SIZE_BYTES * 15;
  final byte[] src = SwiftTestUtils.dataset(len, 32, 144);
  FSDataOutputStream out = fs.create(path,
                                     false,
                                     getBufferSize(),
                                     (short) 1,
                                     BLOCK_SIZE);

  out.write(src, 0, src.length);
  int expected =
    getExpectedPartitionsWritten(len, PART_SIZE_BYTES, true);
  out.close();
  assertPartitionsWritten("write completed", out, expected);
  assertEquals("too few bytes written", len,
               SwiftNativeFileSystem.getBytesWritten(out));
  assertEquals("too few bytes uploaded", len,
               SwiftNativeFileSystem.getBytesUploaded(out));
  //now we verify that the data comes back. If it
  //doesn't, it means that the ordering of the partitions
  //isn't right
  byte[] dest = readDataset(fs, path, len);
  //compare data
  SwiftTestUtils.compareByteArrays(src, dest, len);
  //finally, check the data
  FileStatus[] stats = fs.listStatus(path);
  assertEquals("wrong entry count in "
               + SwiftTestUtils.dumpStats(path.toString(), stats),
               expected, stats.length);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:39,代码来源:TestSwiftFileSystemPartitionedUploads.java

示例4: testManyPartitionedFile

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
/**
 * Test sticks up a very large partitioned file and verifies that
 * it comes back unchanged.
 * @throws Throwable
 */
@Test(timeout = SWIFT_BULK_IO_TEST_TIMEOUT)
public void testManyPartitionedFile() throws Throwable {
  final Path path = new Path("/test/testManyPartitionedFile");

  int len = PART_SIZE_BYTES * 15;
  final byte[] src = SwiftTestUtils.dataset(len, 32, 144);
  FSDataOutputStream out = fs.create(path,
                                     false,
                                     getBufferSize(),
                                     (short) 1,
                                     BLOCK_SIZE);

  out.write(src, 0, src.length);
  int expected =
    getExpectedPartitionsWritten(len, PART_SIZE_BYTES, true);
  out.close();
  assertPartitionsWritten("write completed", out, expected);
  assertEquals("too few bytes written", len,
               SwiftNativeFileSystem.getBytesWritten(out));
  assertEquals("too few bytes uploaded", len,
               SwiftNativeFileSystem.getBytesUploaded(out));
  //now we verify that the data comes back. If it
  //doesn't, it means that the ordering of the partitions
  //isn't right
  byte[] dest = readDataset(fs, path, len);
  //compare data
  SwiftTestUtils.compareByteArrays(src, dest, len);
  //finally, check the data
  FileStatus[] stats = getStore().listSegments(fs.getFileStatus(path), true);
  assertEquals("wrong entry count in "
               + SwiftTestUtils.dumpStats(path.toString(), stats),
               expected, stats.length);
}
 
开发者ID:openstack,项目名称:sahara-extra,代码行数:39,代码来源:TestSwiftFileSystemPartitionedUploads.java

示例5: testQualifiedPath

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
/**
 * Test writes partitioned file writing that path is qualified.
 * @throws Throwable
 */
@Test(timeout = SWIFT_BULK_IO_TEST_TIMEOUT)
public void testQualifiedPath() throws Throwable {
  final Path path = path("/test/qualifiedPath");
  int len = PART_SIZE_BYTES * 4;
  final byte[] src = SwiftTestUtils.dataset(len, 32, 144);
  FSDataOutputStream out = fs.create(path,
                                     false,
                                     getBufferSize(),
                                     (short) 1,
                                     BLOCK_SIZE);

  out.write(src, 0, src.length);
  int expected =
    getExpectedPartitionsWritten(len, PART_SIZE_BYTES, true);
  out.close();
  assertPartitionsWritten("write completed", out, expected);
  assertEquals("too few bytes written", len,
               SwiftNativeFileSystem.getBytesWritten(out));
  assertEquals("too few bytes uploaded", len,
               SwiftNativeFileSystem.getBytesUploaded(out));
  //now we verify that the data comes back. If it
  //doesn't, it means that the ordering of the partitions
  //isn't right
  byte[] dest = readDataset(fs, path, len);
  //compare data
  SwiftTestUtils.compareByteArrays(src, dest, len);
  //finally, check the data
  FileStatus[] stats = getStore().listSegments(fs.getFileStatus(path), true);
  assertEquals("wrong entry count in "
               + SwiftTestUtils.dumpStats(path.toString(), stats),
               expected, stats.length);
}
 
开发者ID:openstack,项目名称:sahara-extra,代码行数:37,代码来源:TestSwiftFileSystemPartitionedUploads.java

示例6: testGetSchemeImplemented

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testGetSchemeImplemented() throws Throwable {
  String scheme = fs.getScheme();
  assertEquals(SwiftNativeFileSystem.SWIFT,scheme);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:TestSwiftFileSystemExtendedContract.java

示例7: createSwiftFS

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
protected SwiftNativeFileSystem createSwiftFS() throws IOException {
  SwiftNativeFileSystem swiftNativeFileSystem =
          new SwiftNativeFileSystem();
  return swiftNativeFileSystem;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:TestSwiftFileSystemContract.java

示例8: createSwiftFS

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
protected SwiftNativeFileSystem createSwiftFS() throws IOException {
  SwiftNativeFileSystem swiftNativeFileSystem =
    new SwiftNativeFileSystem();
  return swiftNativeFileSystem;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:SwiftFileSystemBaseTest.java

示例9: getScheme

import org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem; //导入依赖的package包/类
@Override
public String getScheme() {
  return SwiftNativeFileSystem.SWIFT;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:SwiftContract.java


注:本文中的org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。