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