當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。