本文整理匯總了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();
}
}