org.elasticsearch.Version.isRelease()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中org.elasticsearch.Version.isRelease()方法的一些代码示例,展示了Version.isRelease()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.isRelease()方法的具体详情如下:
包路径:org.elasticsearch.Version
类名称:Version
方法名:isRelease

Version.isRelease介绍

暂无

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

static void warnIfPreRelease(final Version version, final boolean isSnapshot, final Logger logger) {
  if (!version.isRelease() || isSnapshot) {
    logger.warn(
      "version [{}] is a pre-release version of Elasticsearch and is not suitable for production",
      Version.displayVersion(version, isSnapshot));
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Returns the minimum compatible version based on the current
 * version. Ie a node needs to have at least the return version in order
 * to communicate with a node running the current version. The returned version
 * is in most of the cases the smallest major version release unless the current version
 * is a beta or RC release then the version itself is returned.
 */
public Version minimumCompatibilityVersion() {
  if (major >= 6) {
    // all major versions from 6 onwards are compatible with last minor series of the previous major
    Version bwcVersion = null;
    for (int i = DeclaredVersionsHolder.DECLARED_VERSIONS.size() - 1; i >= 0; i--) {
      final Version candidateVersion = DeclaredVersionsHolder.DECLARED_VERSIONS.get(i);
      if (candidateVersion.major == major - 1 && candidateVersion.isRelease() && after(candidateVersion)) {
        if (bwcVersion != null && candidateVersion.minor < bwcVersion.minor) {
          break;
        }
        bwcVersion = candidateVersion;
      }
    }
    return bwcVersion == null ? this : bwcVersion;
  }
  return Version.min(this, fromId((int) major * 1000000 + 0 * 10000 + 99));
}

代码示例来源:origin: apache/servicemix-bundles

static void warnIfPreRelease(final Version version, final boolean isSnapshot, final Logger logger) {
  if (!version.isRelease() || isSnapshot) {
    logger.warn(
      "version [{}] is a pre-release version of Elasticsearch and is not suitable for production",
      Version.displayVersion(version, isSnapshot));
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

static void warnIfPreRelease(final Version version, final boolean isSnapshot, final Logger logger) {
  if (!version.isRelease() || isSnapshot) {
    logger.warn(
      "version [{}] is a pre-release version of Elasticsearch and is not suitable for production",
      Version.displayVersion(version, isSnapshot));
  }
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

static void warnIfPreRelease(final Version version, final boolean isSnapshot, final Logger logger) {
  if (!version.isRelease() || isSnapshot) {
    logger.warn(
      "version [{}] is a pre-release version of Elasticsearch and is not suitable for production",
      displayVersion(version, isSnapshot));
  }
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Returns the minimum compatible version based on the current
 * version. Ie a node needs to have at least the return version in order
 * to communicate with a node running the current version. The returned version
 * is in most of the cases the smallest major version release unless the current version
 * is a beta or RC release then the version itself is returned.
 */
public Version minimumCompatibilityVersion() {
  if (major >= 6) {
    // all major versions from 6 onwards are compatible with last minor series of the previous major
    Version bwcVersion = null;
    for (int i = DeclaredVersionsHolder.DECLARED_VERSIONS.size() - 1; i >= 0; i--) {
      final Version candidateVersion = DeclaredVersionsHolder.DECLARED_VERSIONS.get(i);
      if (candidateVersion.major == major - 1 && candidateVersion.isRelease() && after(candidateVersion)) {
        if (bwcVersion != null && candidateVersion.minor < bwcVersion.minor) {
          break;
        }
        bwcVersion = candidateVersion;
      }
    }
    return bwcVersion == null ? this : bwcVersion;
  }
  return Version.min(this, fromId((int) major * 1000000 + 0 * 10000 + 99));
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Returns the minimum compatible version based on the current
 * version. Ie a node needs to have at least the return version in order
 * to communicate with a node running the current version. The returned version
 * is in most of the cases the smallest major version release unless the current version
 * is a beta or RC release then the version itself is returned.
 */
public Version minimumCompatibilityVersion() {
  if (major >= 6) {
    // all major versions from 6 onwards are compatible with last minor series of the previous major
    Version bwcVersion = null;
    for (int i = DeclaredVersionsHolder.DECLARED_VERSIONS.size() - 1; i >= 0; i--) {
      final Version candidateVersion = DeclaredVersionsHolder.DECLARED_VERSIONS.get(i);
      if (candidateVersion.major == major - 1 && candidateVersion.isRelease() && after(candidateVersion)) {
        if (bwcVersion != null && candidateVersion.minor < bwcVersion.minor) {
          break;
        }
        bwcVersion = candidateVersion;
      }
    }
    return bwcVersion == null ? this : bwcVersion;
  }
  return Version.min(this, fromId((int) major * 1000000 + 0 * 10000 + 99));
}

相关文章