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


Java HBaseTestingUtility.getTestFileSystem方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.HBaseTestingUtility.getTestFileSystem方法的典型用法代码示例。如果您正苦于以下问题:Java HBaseTestingUtility.getTestFileSystem方法的具体用法?Java HBaseTestingUtility.getTestFileSystem怎么用?Java HBaseTestingUtility.getTestFileSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.HBaseTestingUtility的用法示例。


在下文中一共展示了HBaseTestingUtility.getTestFileSystem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testMatchingTail

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
/**
 * Test path compare and prefix checking.
 * @throws IOException
 */
@Test
public void testMatchingTail() throws IOException {
  HBaseTestingUtility htu = new HBaseTestingUtility();
  final FileSystem fs = htu.getTestFileSystem();
  Path rootdir = htu.getDataTestDir();
  assertTrue(rootdir.depth() > 1);
  Path partPath = new Path("a", "b");
  Path fullPath = new Path(rootdir, partPath);
  Path fullyQualifiedPath = fs.makeQualified(fullPath);
  assertFalse(FSUtils.isMatchingTail(fullPath, partPath));
  assertFalse(FSUtils.isMatchingTail(fullPath, partPath.toString()));
  assertTrue(FSUtils.isStartingWithPath(rootdir, fullPath.toString()));
  assertTrue(FSUtils.isStartingWithPath(fullyQualifiedPath, fullPath.toString()));
  assertFalse(FSUtils.isStartingWithPath(rootdir, partPath.toString()));
  assertFalse(FSUtils.isMatchingTail(fullyQualifiedPath, partPath));
  assertTrue(FSUtils.isMatchingTail(fullyQualifiedPath, fullPath));
  assertTrue(FSUtils.isMatchingTail(fullyQualifiedPath, fullPath.toString()));
  assertTrue(FSUtils.isMatchingTail(fullyQualifiedPath, fs.makeQualified(fullPath)));
  assertTrue(FSUtils.isStartingWithPath(rootdir, fullyQualifiedPath.toString()));
  assertFalse(FSUtils.isMatchingTail(fullPath, new Path("x")));
  assertFalse(FSUtils.isMatchingTail(new Path("x"), fullPath));
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:TestFSUtils.java

示例2: testVersion

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
@Test
public void testVersion() throws DeserializationException, IOException {
  HBaseTestingUtility htu = new HBaseTestingUtility();
  final FileSystem fs = htu.getTestFileSystem();
  final Path rootdir = htu.getDataTestDir();
  assertNull(FSUtils.getVersion(fs, rootdir));
  // Write out old format version file.  See if we can read it in and convert.
  Path versionFile = new Path(rootdir, HConstants.VERSION_FILE_NAME);
  FSDataOutputStream s = fs.create(versionFile);
  final String version = HConstants.FILE_SYSTEM_VERSION;
  s.writeUTF(version);
  s.close();
  assertTrue(fs.exists(versionFile));
  FileStatus [] status = fs.listStatus(versionFile);
  assertNotNull(status);
  assertTrue(status.length > 0);
  String newVersion = FSUtils.getVersion(fs, rootdir);
  assertEquals(version.length(), newVersion.length());
  assertEquals(version, newVersion);
  // File will have been converted. Exercise the pb format
  assertEquals(version, FSUtils.getVersion(fs, rootdir));
  FSUtils.checkVersion(fs, rootdir, true);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:TestFSUtils.java

示例3: MockStoreFile

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
MockStoreFile(HBaseTestingUtility testUtil, Path testPath,
    long length, long ageInDisk, boolean isRef, long sequenceid) throws IOException {
  super(testUtil.getTestFileSystem(), testPath, testUtil.getConfiguration(),
    new CacheConfig(testUtil.getConfiguration()), BloomType.NONE);
  this.length = length;
  this.isRef = isRef;
  this.ageInDisk = ageInDisk;
  this.sequenceid = sequenceid;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:MockStoreFile.java

示例4: testLocalLinkReadDuringRename

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
/**
 * Test, on a local filesystem, that the FileLink is still readable
 * even when the current file gets renamed.
 */
@Test
public void testLocalLinkReadDuringRename() throws IOException {
  HBaseTestingUtility testUtil = new HBaseTestingUtility();
  FileSystem fs = testUtil.getTestFileSystem();
  assertEquals("file", fs.getUri().getScheme());
  testLinkReadDuringRename(fs, testUtil.getDataTestDir());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:TestFileLink.java


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