本文整理汇总了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());
}
示例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();
}
}
}
示例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());
}
示例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());
}