本文整理汇总了Java中org.apache.hadoop.hdfs.server.datanode.BlockPoolSliceScanner类的典型用法代码示例。如果您正苦于以下问题:Java BlockPoolSliceScanner类的具体用法?Java BlockPoolSliceScanner怎么用?Java BlockPoolSliceScanner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockPoolSliceScanner类属于org.apache.hadoop.hdfs.server.datanode包,在下文中一共展示了BlockPoolSliceScanner类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test2NNBlockRescanInterval
import org.apache.hadoop.hdfs.server.datanode.BlockPoolSliceScanner; //导入依赖的package包/类
@Test(timeout=120000)
public void test2NNBlockRescanInterval() throws IOException {
((Log4JLogger)BlockPoolSliceScanner.LOG).getLogger().setLevel(Level.ALL);
Configuration conf = new HdfsConfiguration();
cluster = new MiniDFSCluster.Builder(conf)
.nnTopology(MiniDFSNNTopology.simpleFederatedTopology(3))
.build();
try {
FileSystem fs = cluster.getFileSystem(1);
Path file2 = new Path("/test/testBlockScanInterval");
DFSTestUtil.createFile(fs, file2, 30, (short) 1, 0);
fs = cluster.getFileSystem(0);
Path file1 = new Path("/test/testBlockScanInterval");
DFSTestUtil.createFile(fs, file1, 30, (short) 1, 0);
for (int i = 0; i < 8; i++) {
LOG.info("Verifying that the blockscanner scans exactly once");
waitAndScanBlocks(1, 1);
}
} finally {
cluster.shutdown();
}
}
示例2: testBlockRescanInterval
import org.apache.hadoop.hdfs.server.datanode.BlockPoolSliceScanner; //导入依赖的package包/类
/**
* HDFS-3828: DN rescans blocks too frequently
*
* @throws Exception
*/
@Test(timeout=120000)
public void testBlockRescanInterval() throws IOException {
((Log4JLogger)BlockPoolSliceScanner.LOG).getLogger().setLevel(Level.ALL);
Configuration conf = new HdfsConfiguration();
cluster = new MiniDFSCluster.Builder(conf).build();
try {
FileSystem fs = cluster.getFileSystem();
Path file1 = new Path("/test/testBlockScanInterval");
DFSTestUtil.createFile(fs, file1, 30, (short) 1, 0);
for (int i = 0; i < 4; i++) {
LOG.info("Verifying that the blockscanner scans exactly once");
waitAndScanBlocks(1, 1);
}
} finally {
cluster.shutdown();
}
}