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


Java Version.isCompatibleTo方法代码示例

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


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

示例1: checkVersion

import org.apache.hadoop.yarn.server.records.Version; //导入方法依赖的package包/类
/**
 * 1) Versioning scheme: major.minor. For e.g. 1.0, 1.1, 1.2...1.25, 2.0 etc.
 * 2) Any incompatible change of state-store is a major upgrade, and any
 *    compatible change of state-store is a minor upgrade.
 * 3) Within a minor upgrade, say 1.1 to 1.2:
 *    overwrite the version info and proceed as normal.
 * 4) Within a major upgrade, say 1.2 to 2.0:
 *    throw exception and indicate user to use a separate upgrade tool to
 *    upgrade NM state or remove incompatible old state.
 */
private void checkVersion() throws IOException {
  Version loadedVersion = loadVersion();
  LOG.info("Loaded NM state version info " + loadedVersion);
  if (loadedVersion.equals(getCurrentVersion())) {
    return;
  }
  if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
    LOG.info("Storing NM state version info " + getCurrentVersion());
    storeVersion();
  } else {
    throw new IOException(
      "Incompatible version for NM state: expecting NM state version " 
          + getCurrentVersion() + ", but loading version " + loadedVersion);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:NMLeveldbStateStoreService.java

示例2: checkVersion

import org.apache.hadoop.yarn.server.records.Version; //导入方法依赖的package包/类
/**
 * 1) Versioning scheme: major.minor. For e.g. 1.0, 1.1, 1.2...1.25, 2.0 etc.
 * 2) Any incompatible change of state-store is a major upgrade, and any
 *    compatible change of state-store is a minor upgrade.
 * 3) If theres's no version, treat it as CURRENT_VERSION_INFO.
 * 4) Within a minor upgrade, say 1.1 to 1.2:
 *    overwrite the version info and proceed as normal.
 * 5) Within a major upgrade, say 1.2 to 2.0:
 *    throw exception and indicate user to use a separate upgrade tool to
 *    upgrade RM state.
 */
public void checkVersion() throws Exception {
  Version loadedVersion = loadVersion();
  LOG.info("Loaded RM state version info " + loadedVersion);
  if (loadedVersion != null && loadedVersion.equals(getCurrentVersion())) {
    return;
  }
  // if there is no version info, treat it as CURRENT_VERSION_INFO;
  if (loadedVersion == null) {
    loadedVersion = getCurrentVersion();
  }
  if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
    LOG.info("Storing RM state version info " + getCurrentVersion());
    storeVersion();
  } else {
    throw new RMStateVersionIncompatibleException(
      "Expecting RM state version " + getCurrentVersion()
          + ", but loading version " + loadedVersion);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:RMStateStore.java

示例3: checkVersion

import org.apache.hadoop.yarn.server.records.Version; //导入方法依赖的package包/类
/**
 * 1) Versioning timeline store: major.minor. For e.g. 1.0, 1.1, 1.2...1.25, 2.0 etc.
 * 2) Any incompatible change of TS-store is a major upgrade, and any
 *    compatible change of TS-store is a minor upgrade.
 * 3) Within a minor upgrade, say 1.1 to 1.2:
 *    overwrite the version info and proceed as normal.
 * 4) Within a major upgrade, say 1.2 to 2.0:
 *    throw exception and indicate user to use a separate upgrade tool to
 *    upgrade timeline store or remove incompatible old state.
 */
private void checkVersion() throws IOException {
  Version loadedVersion = loadVersion();
  LOG.info("Loaded timeline store version info " + loadedVersion);
  if (loadedVersion.equals(getCurrentVersion())) {
    return;
  }
  if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
    LOG.info("Storing timeline store version info " + getCurrentVersion());
    dbStoreVersion(CURRENT_VERSION_INFO);
  } else {
    String incompatibleMessage = 
        "Incompatible version for timeline store: expecting version " 
            + getCurrentVersion() + ", but loading version " + loadedVersion;
    LOG.fatal(incompatibleMessage);
    throw new IOException(incompatibleMessage);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:LeveldbTimelineStore.java

示例4: checkVersion

import org.apache.hadoop.yarn.server.records.Version; //导入方法依赖的package包/类
/**
 * 1) Versioning timeline state store:
 * major.minor. For e.g. 1.0, 1.1, 1.2...1.25, 2.0 etc.
 * 2) Any incompatible change of TS-store is a major upgrade, and any
 * compatible change of TS-store is a minor upgrade.
 * 3) Within a minor upgrade, say 1.1 to 1.2:
 * overwrite the version info and proceed as normal.
 * 4) Within a major upgrade, say 1.2 to 2.0:
 * throw exception and indicate user to use a separate upgrade tool to
 * upgrade timeline store or remove incompatible old state.
 */
private void checkVersion() throws IOException {
  Version loadedVersion = loadVersion();
  LOG.info("Loaded timeline state store version info " + loadedVersion);
  if (loadedVersion.equals(getCurrentVersion())) {
    return;
  }
  if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
    LOG.info("Storing timeline state store version info " + getCurrentVersion());
    storeVersion(CURRENT_VERSION_INFO);
  } else {
    String incompatibleMessage =
        "Incompatible version for timeline state store: expecting version "
            + getCurrentVersion() + ", but loading version " + loadedVersion;
    LOG.fatal(incompatibleMessage);
    throw new IOException(incompatibleMessage);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:LeveldbTimelineStateStore.java

示例5: checkVersion

import org.apache.hadoop.yarn.server.records.Version; //导入方法依赖的package包/类
/**
 * 1) Versioning scheme: major.minor. For e.g. 1.0, 1.1, 1.2...1.25, 2.0 etc.
 * 2) Any incompatible change of DB schema is a major upgrade, and any
 *    compatible change of DB schema is a minor upgrade.
 * 3) Within a minor upgrade, say 1.1 to 1.2:
 *    overwrite the version info and proceed as normal.
 * 4) Within a major upgrade, say 1.2 to 2.0:
 *    throw exception and indicate user to use a separate upgrade tool to
 *    upgrade shuffle info or remove incompatible old state.
 */
private void checkVersion() throws IOException {
  Version loadedVersion = loadVersion();
  LOG.info("Loaded state DB schema version info " + loadedVersion);
  if (loadedVersion.equals(getCurrentVersion())) {
    return;
  }
  if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
    LOG.info("Storing state DB schedma version info " + getCurrentVersion());
    storeVersion();
  } else {
    throw new IOException(
      "Incompatible version for state DB schema: expecting DB schema version " 
          + getCurrentVersion() + ", but loading version " + loadedVersion);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:ShuffleHandler.java

示例6: checkVersion

import org.apache.hadoop.yarn.server.records.Version; //导入方法依赖的package包/类
/**
 * 1) Versioning scheme: major.minor. For e.g. 1.0, 1.1, 1.2...1.25, 2.0 etc.
 * 2) Any incompatible change of state-store is a major upgrade, and any
 *    compatible change of state-store is a minor upgrade.
 * 3) Within a minor upgrade, say 1.1 to 1.2:
 *    overwrite the version info and proceed as normal.
 * 4) Within a major upgrade, say 1.2 to 2.0:
 *    throw exception and indicate user to use a separate upgrade tool to
 *    upgrade state or remove incompatible old state.
 */
private void checkVersion() throws IOException {
  Version loadedVersion = loadVersion();
  LOG.info("Loaded state version info " + loadedVersion);
  if (loadedVersion.equals(getCurrentVersion())) {
    return;
  }
  if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
    LOG.info("Storing state version info " + getCurrentVersion());
    storeVersion();
  } else {
    throw new IOException(
      "Incompatible version for state: expecting state version "
          + getCurrentVersion() + ", but loading version " + loadedVersion);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:HistoryServerLeveldbStateStoreService.java

示例7: checkVersion

import org.apache.hadoop.yarn.server.records.Version; //导入方法依赖的package包/类
/**
 * 1) Versioning timeline store: major.minor. For e.g. 1.0, 1.1, 1.2...1.25,
 * 2.0 etc. 2) Any incompatible change of TS-store is a major upgrade, and any
 * compatible change of TS-store is a minor upgrade. 3) Within a minor
 * upgrade, say 1.1 to 1.2: overwrite the version info and proceed as normal.
 * 4) Within a major upgrade, say 1.2 to 2.0: throw exception and indicate
 * user to use a separate upgrade tool to upgrade timeline store or remove
 * incompatible old state.
 */
private void checkVersion() throws IOException {
  Version loadedVersion = loadVersion();
  LOG.info("Loaded timeline store version info " + loadedVersion);
  if (loadedVersion.equals(getCurrentVersion())) {
    return;
  }
  if (loadedVersion.isCompatibleTo(getCurrentVersion())) {
    LOG.info("Storing timeline store version info " + getCurrentVersion());
    dbStoreVersion(CURRENT_VERSION_INFO);
  } else {
    String incompatibleMessage = "Incompatible version for timeline store: "
        + "expecting version " + getCurrentVersion()
        + ", but loading version " + loadedVersion;
    LOG.fatal(incompatibleMessage);
    throw new IOException(incompatibleMessage);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:27,代码来源:RollingLevelDBTimelineStore.java


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