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


Java CachedFullPathNames类代码示例

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


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

示例1: verifyCachedFullPathNameResult

import org.apache.hadoop.hdfs.server.namenode.BlockPlacementPolicyRaid.CachedFullPathNames; //导入依赖的package包/类
private void verifyCachedFullPathNameResult(
    CachedFullPathNames cachedFullPathNames, FSInodeInfo inode, int cachedReads)
    throws IOException {
  Assert.assertEquals(inode.getFullPathName(),
                      policy.getFullPathName(inode));
  Assert.assertEquals(cachedReads,
      h.events.get(InjectionEvent.BLOCKPLACEMENTPOLICYRAID_CACHED_PATH).intValue());
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:9,代码来源:TestBlockPlacementPolicyRaid.java

示例2: testCachedPathNames

import org.apache.hadoop.hdfs.server.namenode.BlockPlacementPolicyRaid.CachedFullPathNames; //导入依赖的package包/类
/**
 * Test BlockPlacementPolicyRaid.CachedFullPathNames
 * Verify that the results obtained from cache is the same as
 * the results obtained directly
 */
@Test
public void testCachedPathNames() throws IOException {
  setupCluster();
  try {
    String file1 = "/dir/file1";
    String file2 = "/dir/file2";
    DFSTestUtil.createFile(fs, new Path(file1), 3, (short)1, 0L);
    DFSTestUtil.createFile(fs, new Path(file2), 4, (short)1, 0L);
    // test full path cache
    CachedFullPathNames cachedFullPathNames =
        new CachedFullPathNames(namesystem);
    FSInodeInfo inode1 = null;
    FSInodeInfo inode2 = null;
    namesystem.dir.readLock();
    try {
      inode1 = namesystem.dir.rootDir.getNode(file1, true);
      inode2 = namesystem.dir.rootDir.getNode(file2, true);
    } finally {
      namesystem.dir.readUnlock();
    }
    verifyCachedFullPathNameResult(cachedFullPathNames, inode1);
    verifyCachedFullPathNameResult(cachedFullPathNames, inode1);
    verifyCachedFullPathNameResult(cachedFullPathNames, inode2);
    verifyCachedFullPathNameResult(cachedFullPathNames, inode2);
    try {
      Thread.sleep(1200L);
    } catch (InterruptedException e) {
    }
    verifyCachedFullPathNameResult(cachedFullPathNames, inode2);
    verifyCachedFullPathNameResult(cachedFullPathNames, inode1);
  } finally {
    if (cluster != null) {
      cluster.shutdown();
    }
  }
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:42,代码来源:TestBlockPlacementPolicyRaid.java

示例3: verifyCachedFullPathNameResult

import org.apache.hadoop.hdfs.server.namenode.BlockPlacementPolicyRaid.CachedFullPathNames; //导入依赖的package包/类
private void verifyCachedFullPathNameResult(
    CachedFullPathNames cachedFullPathNames, FSInodeInfo inode)
throws IOException {
  String res1 = inode.getFullPathName();
  String res2 = cachedFullPathNames.get(inode);
  LOG.info("Actual path name: " + res1);
  LOG.info("Cached path name: " + res2);
  Assert.assertEquals(cachedFullPathNames.get(inode),
                      inode.getFullPathName());
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:11,代码来源:TestBlockPlacementPolicyRaid.java

示例4: verifyCachedFullPathNameResult

import org.apache.hadoop.hdfs.server.namenode.BlockPlacementPolicyRaid.CachedFullPathNames; //导入依赖的package包/类
private void verifyCachedFullPathNameResult(
    CachedFullPathNames cachedFullPathNames, FSInodeInfo inode)
    throws IOException {
  Assert.assertEquals(cachedFullPathNames.get(inode),
                      inode.getFullPathName());
}
 
开发者ID:iVCE,项目名称:RDFS,代码行数:7,代码来源:TestBlockPlacementPolicyRaid.java


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