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


Java Storage.STORAGE_DIR_PREVIOUS属性代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.common.Storage.STORAGE_DIR_PREVIOUS属性的典型用法代码示例。如果您正苦于以下问题:Java Storage.STORAGE_DIR_PREVIOUS属性的具体用法?Java Storage.STORAGE_DIR_PREVIOUS怎么用?Java Storage.STORAGE_DIR_PREVIOUS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hdfs.server.common.Storage的用法示例。


在下文中一共展示了Storage.STORAGE_DIR_PREVIOUS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkResultBlockPool

/**
 * For block pool, verify that the current and/or previous exist as indicated
 * by the method parameters.  If previous exists, verify that
 * it hasn't been modified by comparing the checksum of all it's
 * containing files with their original checksum.  It is assumed that
 * the server has recovered.
 * @param baseDirs directories pointing to block pool storage
 * @param bpid block pool Id
 * @param currentShouldExist current directory exists under storage
 * @param currentShouldExist previous directory exists under storage
 */
void checkResultBlockPool(String[] baseDirs, boolean currentShouldExist,
    boolean previousShouldExist) throws IOException
{
  if (currentShouldExist) {
    for (int i = 0; i < baseDirs.length; i++) {
      File bpCurDir = new File(baseDirs[i], Storage.STORAGE_DIR_CURRENT);
      assertEquals(UpgradeUtilities.checksumContents(DATA_NODE, bpCurDir,
              false), UpgradeUtilities.checksumMasterBlockPoolContents());
    }
  }
  if (previousShouldExist) {
    for (int i = 0; i < baseDirs.length; i++) {
      File bpPrevDir = new File(baseDirs[i], Storage.STORAGE_DIR_PREVIOUS);
      assertTrue(bpPrevDir.isDirectory());
      assertEquals(
                   UpgradeUtilities.checksumContents(DATA_NODE, bpPrevDir,
                   false), UpgradeUtilities.checksumMasterBlockPoolContents());
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:TestDFSStorageStateRecovery.java


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