org.elasticsearch.cluster.metadata.MetaData.hasAlias()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(121)

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

MetaData.hasAlias介绍

[英]Checks if at least one of the specified aliases exists in the specified concrete indices. Wildcards are supported in the alias names for partial matches.
[中]检查指定的具体索引中是否至少存在一个指定别名。部分匹配的别名中支持通配符。

代码示例

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

/**
 * Validate the name for an index against some static rules and a cluster state.
 */
public static void validateIndexName(String index, ClusterState state) {
  validateIndexOrAliasName(index, InvalidIndexNameException::new);
  if (!index.toLowerCase(Locale.ROOT).equals(index)) {
    throw new InvalidIndexNameException(index, "must be lowercase");
  }
  if (state.routingTable().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.routingTable().index(index).getIndex());
  }
  if (state.metaData().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.metaData().index(index).getIndex());
  }
  if (state.metaData().hasAlias(index)) {
    throw new InvalidIndexNameException(index, "already exists as alias");
  }
}

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

continue;
if (currentState.metaData().hasAlias(indexMetaData.getIndex().getName())) {
  logger.warn("ignoring dangled index [{}] on node [{}] due to an existing alias with the same name",
      indexMetaData.getIndex(), request.fromNode);

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

/**
 * Validate the name for an index against some static rules and a cluster state.
 */
public static void validateIndexName(String index, ClusterState state) {
  validateIndexOrAliasName(index, InvalidIndexNameException::new);
  if (!index.toLowerCase(Locale.ROOT).equals(index)) {
    throw new InvalidIndexNameException(index, "must be lowercase");
  }
  if (state.routingTable().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.routingTable().index(index).getIndex());
  }
  if (state.metaData().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.metaData().index(index).getIndex());
  }
  if (state.metaData().hasAlias(index)) {
    throw new InvalidIndexNameException(index, "already exists as alias");
  }
}

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

/**
 * Validate the name for an index against some static rules and a cluster state.
 */
public static void validateIndexName(String index, ClusterState state) {
  validateIndexOrAliasName(index, InvalidIndexNameException::new);
  if (!index.toLowerCase(Locale.ROOT).equals(index)) {
    throw new InvalidIndexNameException(index, "must be lowercase");
  }
  if (state.routingTable().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.routingTable().index(index).getIndex());
  }
  if (state.metaData().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.metaData().index(index).getIndex());
  }
  if (state.metaData().hasAlias(index)) {
    throw new InvalidIndexNameException(index, "already exists as alias");
  }
}

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

/**
 * Validate the name for an index against some static rules and a cluster state.
 */
public static void validateIndexName(String index, ClusterState state) {
  validateIndexOrAliasName(index, InvalidIndexNameException::new);
  if (!index.toLowerCase(Locale.ROOT).equals(index)) {
    throw new InvalidIndexNameException(index, "must be lowercase");
  }
  if (state.routingTable().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.routingTable().index(index).getIndex());
  }
  if (state.metaData().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.metaData().index(index).getIndex());
  }
  if (state.metaData().hasAlias(index)) {
    throw new InvalidIndexNameException(index, "already exists as alias");
  }
}

代码示例来源:origin: harbby/presto-connectors

" > " + MAX_INDEX_NAME_BYTES + ")");
if (state.metaData().hasAlias(index)) {
  throw new InvalidIndexNameException(new Index(index), index, "already exists as alias");

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

continue;
if (currentState.metaData().hasAlias(indexMetaData.getIndex().getName())) {
  logger.warn("ignoring dangled index [{}] on node [{}] due to an existing alias with the same name",
      indexMetaData.getIndex(), request.fromNode);

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

continue;
if (currentState.metaData().hasAlias(indexMetaData.getIndex().getName())) {
  logger.warn("ignoring dangled index [{}] on node [{}] due to an existing alias with the same name",
      indexMetaData.getIndex(), request.fromNode);

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

continue;
if (currentState.metaData().hasAlias(indexMetaData.getIndex().getName())) {
  logger.warn("ignoring dangled index [{}] on node [{}] due to an existing alias with the same name",
      indexMetaData.getIndex(), request.fromNode);

代码示例来源:origin: harbby/presto-connectors

continue;
if (currentState.metaData().hasAlias(indexMetaData.getIndex())) {
  logger.warn("ignoring dangled index [{}] on node [{}] due to an existing alias with the same name",
      indexMetaData.getIndex(), request.fromNode);

相关文章