當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。