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


Java ImmutableOpenMap.values方法代码示例

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


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

示例1: overallState

import org.elasticsearch.common.collect.ImmutableOpenMap; //导入方法依赖的package包/类
public static RestoreInProgress.State overallState(RestoreInProgress.State nonCompletedState,
                                                   ImmutableOpenMap<ShardId, RestoreInProgress.ShardRestoreStatus> shards) {
    boolean hasFailed = false;
    for (ObjectCursor<RestoreInProgress.ShardRestoreStatus> status : shards.values()) {
        if (!status.value.state().completed()) {
            return nonCompletedState;
        }
        if (status.value.state() == RestoreInProgress.State.FAILURE) {
            hasFailed = true;
        }
    }
    if (hasFailed) {
        return RestoreInProgress.State.FAILURE;
    } else {
        return RestoreInProgress.State.SUCCESS;
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:RestoreService.java

示例2: concreteAliases

import org.elasticsearch.common.collect.ImmutableOpenMap; //导入方法依赖的package包/类
public String[] concreteAliases(MetaData metaData, String concreteIndex) {
    if (expandAliasesWildcards()) {
        //for DELETE we expand the aliases
        String[] indexAsArray = {concreteIndex};
        ImmutableOpenMap<String, List<AliasMetaData>> aliasMetaData = metaData.findAliases(aliases, indexAsArray);
        List<String> finalAliases = new ArrayList<>();
        for (ObjectCursor<List<AliasMetaData>> curAliases : aliasMetaData.values()) {
            for (AliasMetaData aliasMeta: curAliases.value) {
                finalAliases.add(aliasMeta.alias());
            }
        }
        return finalAliases.toArray(new String[finalAliases.size()]);
    } else {
        //for add we just return the current aliases
        return aliases;
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:IndicesAliasesRequest.java

示例3: MetaData

import org.elasticsearch.common.collect.ImmutableOpenMap; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
MetaData(String clusterUUID, long version, Settings transientSettings, Settings persistentSettings, ImmutableOpenMap<String, IndexMetaData> indices, ImmutableOpenMap<String, IndexTemplateMetaData> templates, UserMetadata userMetadata, TenantMetadata tenantMetadata, ImmutableOpenMap<String, Custom> customs, String[] allIndices, String[] allOpenIndices, String[] allClosedIndices, SortedMap<String, AliasOrIndex> aliasAndIndexLookup) {
    this.clusterUUID = clusterUUID;
    this.version = version;
    this.transientSettings = transientSettings;
    this.persistentSettings = persistentSettings;
    this.settings = Settings.settingsBuilder().put(persistentSettings).put(transientSettings).build();
    this.indices = indices;
    this.customs = customs;
    this.templates = templates;
    this.userMetadata = userMetadata;
    this.tenantMetadata = tenantMetadata;
    int totalNumberOfShards = 0;
    int numberOfShards = 0;
    for (ObjectCursor<IndexMetaData> cursor : indices.values()) {
        totalNumberOfShards += cursor.value.getTotalNumberOfShards();
        numberOfShards += cursor.value.getNumberOfShards();
    }
    this.totalNumberOfShards = totalNumberOfShards;
    this.numberOfShards = numberOfShards;

    this.allIndices = allIndices;
    this.allOpenIndices = allOpenIndices;
    this.allClosedIndices = allClosedIndices;
    this.aliasAndIndexLookup = aliasAndIndexLookup;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:27,代码来源:MetaData.java

示例4: averageUsage

import org.elasticsearch.common.collect.ImmutableOpenMap; //导入方法依赖的package包/类
/**
 * Returns a {@link DiskUsage} for the {@link RoutingNode} using the
 * average usage of other nodes in the disk usage map.
 * @param node Node to return an averaged DiskUsage object for
 * @param usages Map of nodeId to DiskUsage for all known nodes
 * @return DiskUsage representing given node using the average disk usage
 */
DiskUsage averageUsage(RoutingNode node, ImmutableOpenMap<String, DiskUsage> usages) {
    if (usages.size() == 0) {
        return new DiskUsage(node.nodeId(), node.node().getName(), "_na_", 0, 0);
    }
    long totalBytes = 0;
    long freeBytes = 0;
    for (ObjectCursor<DiskUsage> du : usages.values()) {
        totalBytes += du.value.getTotalBytes();
        freeBytes += du.value.getFreeBytes();
    }
    return new DiskUsage(node.nodeId(), node.node().getName(), "_na_", totalBytes / usages.size(), freeBytes / usages.size());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:DiskThresholdDecider.java

示例5: MetaData

import org.elasticsearch.common.collect.ImmutableOpenMap; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
MetaData(String clusterUUID, long version, Settings transientSettings, Settings persistentSettings,
         ImmutableOpenMap<String, IndexMetaData> indices, ImmutableOpenMap<String, IndexTemplateMetaData> templates,
         ImmutableOpenMap<String, Custom> customs, String[] allIndices, String[] allOpenIndices, String[] allClosedIndices,
         SortedMap<String, AliasOrIndex> aliasAndIndexLookup) {
    this.clusterUUID = clusterUUID;
    this.version = version;
    this.transientSettings = transientSettings;
    this.persistentSettings = persistentSettings;
    this.settings = Settings.builder().put(persistentSettings).put(transientSettings).build();
    this.indices = indices;
    this.customs = customs;
    this.templates = templates;
    int totalNumberOfShards = 0;
    int numberOfShards = 0;
    for (ObjectCursor<IndexMetaData> cursor : indices.values()) {
        totalNumberOfShards += cursor.value.getTotalNumberOfShards();
        numberOfShards += cursor.value.getNumberOfShards();
    }
    this.totalNumberOfShards = totalNumberOfShards;
    this.numberOfShards = numberOfShards;

    this.allIndices = allIndices;
    this.allOpenIndices = allOpenIndices;
    this.allClosedIndices = allClosedIndices;
    this.aliasAndIndexLookup = aliasAndIndexLookup;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:28,代码来源:MetaData.java

示例6: completed

import org.elasticsearch.common.collect.ImmutableOpenMap; //导入方法依赖的package包/类
public static boolean completed(ImmutableOpenMap<ShardId, RestoreInProgress.ShardRestoreStatus> shards) {
    for (ObjectCursor<RestoreInProgress.ShardRestoreStatus> status : shards.values()) {
        if (!status.value.state().completed()) {
            return false;
        }
    }
    return true;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:RestoreService.java

示例7: ParentChildAtomicFieldData

import org.elasticsearch.common.collect.ImmutableOpenMap; //导入方法依赖的package包/类
public ParentChildAtomicFieldData(ImmutableOpenMap<String, AtomicOrdinalsFieldData> typeToIds) {
    this.typeToIds = typeToIds;
    long size = 0;
    for (ObjectCursor<AtomicOrdinalsFieldData> cursor : typeToIds.values()) {
        size += cursor.value.ramBytesUsed();
    }
    this.memorySizeInBytes = size;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:ParentChildAtomicFieldData.java


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