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


Java BlockPoolSliceScanner类代码示例

本文整理汇总了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();
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:25,代码来源:TestMultipleNNDataBlockScanner.java

示例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();
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:24,代码来源:TestMultipleNNDataBlockScanner.java


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