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

x33g5p2x  于2022-01-21 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(130)

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

IndexMetaData.isRoutingPartitionedIndex介绍

暂无

代码示例

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

public static int generateShardId(IndexMetaData indexMetaData, @Nullable String id, @Nullable String routing) {
  final String effectiveRouting;
  final int partitionOffset;
  if (routing == null) {
    assert(indexMetaData.isRoutingPartitionedIndex() == false) : "A routing value is required for gets from a partitioned index";
    effectiveRouting = id;
  } else {
    effectiveRouting = routing;
  }
  if (indexMetaData.isRoutingPartitionedIndex()) {
    partitionOffset = Math.floorMod(Murmur3HashFunction.hash(id), indexMetaData.getRoutingPartitionSize());
  } else {
    // we would have still got 0 above but this check just saves us an unnecessary hash calculation
    partitionOffset = 0;
  }
  return calculateScaledShardId(indexMetaData, effectiveRouting, partitionOffset);
}

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

private void checkPartitionedIndexConstraints(DocumentMapper newMapper) {
  if (indexSettings.getIndexMetaData().isRoutingPartitionedIndex()) {
    if (newMapper.parentFieldMapper().active()) {
      throw new IllegalArgumentException("mapping type name [" + newMapper.type() + "] cannot have a "
          + "_parent field for the partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
    if (!newMapper.routingFieldMapper().required()) {
      throw new IllegalArgumentException("mapping type [" + newMapper.type() + "] must have routing "
          + "required for partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
  }
}

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

assert indexMetaData.isRoutingPartitionedIndex() == false;
  findSplitDocs(IdFieldMapper.NAME, includeInShard, leafReader, bitSet::set);
} else {
  if (indexMetaData.isRoutingPartitionedIndex()) {

代码示例来源:origin: com.strapdata.elasticsearch.plugin/parent-join

private static void checkIndexCompatibility(IndexSettings settings, String name) {
  if (settings.getIndexMetaData().isRoutingPartitionedIndex()) {
    throw new IllegalStateException("cannot create join field [" + name + "] " +
      "for the partitioned index " + "[" + settings.getIndex().getName() + "]");
  }
  if (settings.isSingleType() == false) {
    throw new IllegalStateException("cannot create join field [" + name + "] " +
      "on multi-types index [" + settings.getIndex().getName() + "]");
  }
}

代码示例来源:origin: org.elasticsearch.plugin/parent-join-client

private static void checkIndexCompatibility(IndexSettings settings, String name) {
  if (settings.getIndexMetaData().isRoutingPartitionedIndex()) {
    throw new IllegalStateException("cannot create join field [" + name + "] " +
      "for the partitioned index " + "[" + settings.getIndex().getName() + "]");
  }
  if (settings.isSingleType() == false) {
    throw new IllegalStateException("cannot create join field [" + name + "] " +
      "on multi-types index [" + settings.getIndex().getName() + "]");
  }
}

代码示例来源:origin: org.codelibs.elasticsearch.module/parent-join

private static void checkIndexCompatibility(IndexSettings settings, String name) {
  if (settings.getIndexMetaData().isRoutingPartitionedIndex()) {
    throw new IllegalStateException("cannot create join field [" + name + "] " +
      "for the partitioned index " + "[" + settings.getIndex().getName() + "]");
  }
  if (settings.isSingleType() == false) {
    throw new IllegalStateException("cannot create join field [" + name + "] " +
      "on multi-types index [" + settings.getIndex().getName() + "]");
  }
}

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

private void checkPartitionedIndexConstraints(DocumentMapper newMapper) {
  if (indexSettings.getIndexMetaData().isRoutingPartitionedIndex()) {
    if (newMapper.parentFieldMapper().active()) {
      throw new IllegalArgumentException("mapping type name [" + newMapper.type() + "] cannot have a "
          + "_parent field for the partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
    if (!newMapper.routingFieldMapper().required()) {
      throw new IllegalArgumentException("mapping type [" + newMapper.type() + "] must have routing "
          + "required for partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
  }
}

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

static int generateShardId(IndexMetaData indexMetaData, @Nullable String id, @Nullable String routing) {
  final String effectiveRouting;
  final int partitionOffset;
  if (routing == null) {
    assert(indexMetaData.isRoutingPartitionedIndex() == false) : "A routing value is required for gets from a partitioned index";
    effectiveRouting = id;
  } else {
    effectiveRouting = routing;
  }
  if (indexMetaData.isRoutingPartitionedIndex()) {
    partitionOffset = Math.floorMod(Murmur3HashFunction.hash(id), indexMetaData.getRoutingPartitionSize());
  } else {
    // we would have still got 0 above but this check just saves us an unnecessary hash calculation
    partitionOffset = 0;
  }
  return calculateScaledShardId(indexMetaData, effectiveRouting, partitionOffset);
}

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

public static int generateShardId(IndexMetaData indexMetaData, @Nullable String id, @Nullable String routing) {
  final String effectiveRouting;
  final int partitionOffset;
  if (routing == null) {
    assert(indexMetaData.isRoutingPartitionedIndex() == false) : "A routing value is required for gets from a partitioned index";
    effectiveRouting = id;
  } else {
    effectiveRouting = routing;
  }
  if (indexMetaData.isRoutingPartitionedIndex()) {
    partitionOffset = Math.floorMod(Murmur3HashFunction.hash(id), indexMetaData.getRoutingPartitionSize());
  } else {
    // we would have still got 0 above but this check just saves us an unnecessary hash calculation
    partitionOffset = 0;
  }
  return calculateScaledShardId(indexMetaData, effectiveRouting, partitionOffset);
}

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

public static int generateShardId(IndexMetaData indexMetaData, @Nullable String id, @Nullable String routing) {
  final String effectiveRouting;
  final int partitionOffset;
  if (routing == null) {
    assert(indexMetaData.isRoutingPartitionedIndex() == false) : "A routing value is required for gets from a partitioned index";
    effectiveRouting = id;
  } else {
    effectiveRouting = routing;
  }
  if (indexMetaData.isRoutingPartitionedIndex()) {
    partitionOffset = Math.floorMod(Murmur3HashFunction.hash(id), indexMetaData.getRoutingPartitionSize());
  } else {
    // we would have still got 0 above but this check just saves us an unnecessary hash calculation
    partitionOffset = 0;
  }
  return calculateScaledShardId(indexMetaData, effectiveRouting, partitionOffset);
}

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

private void checkPartitionedIndexConstraints(DocumentMapper newMapper) {
  if (indexSettings.getIndexMetaData().isRoutingPartitionedIndex()) {
    if (newMapper.parentFieldMapper().active()) {
      throw new IllegalArgumentException("mapping type name [" + newMapper.type() + "] cannot have a "
          + "_parent field for the partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
    if (!newMapper.routingFieldMapper().required()) {
      throw new IllegalArgumentException("mapping type [" + newMapper.type() + "] must have routing "
          + "required for partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
  }
}

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

private void checkPartitionedIndexConstraints(DocumentMapper newMapper) {
  if (indexSettings.getIndexMetaData().isRoutingPartitionedIndex()) {
    if (newMapper.parentFieldMapper().active()) {
      throw new IllegalArgumentException("mapping type name [" + newMapper.type() + "] cannot have a "
          + "_parent field for the partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
    if (!newMapper.routingFieldMapper().required()) {
      throw new IllegalArgumentException("mapping type [" + newMapper.type() + "] must have routing "
          + "required for partitioned index [" + indexSettings.getIndex().getName() + "]");
    }
  }
}

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

assert indexMetaData.isRoutingPartitionedIndex() == false;
  findSplitDocs(IdFieldMapper.NAME, includeInShard, leafReader, bitSet::set);
} else {
  if (indexMetaData.isRoutingPartitionedIndex()) {

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

assert indexMetaData.isRoutingPartitionedIndex() == false;
  findSplitDocs(IdFieldMapper.NAME, includeInShard, leafReader, bitSet::set);
} else {
  if (indexMetaData.isRoutingPartitionedIndex()) {

相关文章

微信公众号

最新文章

更多

IndexMetaData类方法