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