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


Java Setting.get方法代码示例

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


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

示例1: maybeUpdateClusterBlock

import org.elasticsearch.common.settings.Setting; //导入方法依赖的package包/类
/**
 * Updates the cluster block only iff the setting exists in the given settings
 */
private static void maybeUpdateClusterBlock(String[] actualIndices, ClusterBlocks.Builder blocks, ClusterBlock block, Setting<Boolean> setting, Settings openSettings) {
    if (setting.exists(openSettings)) {
        final boolean updateReadBlock = setting.get(openSettings);
        for (String index : actualIndices) {
            if (updateReadBlock) {
                blocks.addIndexBlock(index, block);
            } else {
                blocks.removeIndexBlock(index, block);
            }
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:MetaDataUpdateSettingsService.java

示例2: getSetting

import org.elasticsearch.common.settings.Setting; //导入方法依赖的package包/类
/**
 * Get a given setting from the repository settings, throwing a {@link RepositoryException} if the setting does not exist or is empty.
 */
static <T> T getSetting(Setting<T> setting, RepositoryMetaData metadata) {
    T value = setting.get(metadata.settings());
    if (value == null) {
        throw new RepositoryException(metadata.name(), "Setting [" + setting.getKey() + "] is not defined for repository");
    }
    if ((value instanceof String) && (Strings.hasText((String) value)) == false) {
        throw new RepositoryException(metadata.name(), "Setting [" + setting.getKey() + "] is empty for repository");
    }
    return value;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:GoogleCloudStorageRepository.java

示例3: getRequiredSetting

import org.elasticsearch.common.settings.Setting; //导入方法依赖的package包/类
private static String getRequiredSetting(Settings settings, Setting<String> setting) {
    String value = setting.get(settings);
    if (value == null || Strings.hasLength(value) == false) {
        throw new IllegalArgumentException("Missing required setting " + setting.getKey() + " for azure");
    }
    return value;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:AzureComputeServiceImpl.java

示例4: getValue

import org.elasticsearch.common.settings.Setting; //导入方法依赖的package包/类
public static <T> T getValue(Settings repositorySettings,
                             Settings globalSettings,
                             Setting<T> repositorySetting,
                             Setting<T> repositoriesSetting) {
    if (repositorySetting.exists(repositorySettings)) {
        return repositorySetting.get(repositorySettings);
    } else {
        return repositoriesSetting.get(globalSettings);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:AzureStorageSettings.java

示例5: getConfigValue

import org.elasticsearch.common.settings.Setting; //导入方法依赖的package包/类
/**
 * Find the setting value, trying first with named configs,
 * then falling back to repository and global repositories settings.
 */
private static <T> T getConfigValue(Settings repositorySettings, Settings globalSettings, String clientName,
                                    Setting.AffixSetting<T> configSetting, Setting<T> repositorySetting, Setting<T> globalSetting) {
    Setting<T> concreteSetting = configSetting.getConcreteSettingForNamespace(clientName);
    if (concreteSetting.exists(globalSettings)) {
        return concreteSetting.get(globalSettings);
    } else if (repositorySetting == null) {
        // no repository setting, just use global setting
        return globalSetting.get(globalSettings);
    } else {
        return S3Repository.getValue(repositorySettings, globalSettings, repositorySetting, globalSetting);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:InternalAwsS3Service.java

示例6: get

import org.elasticsearch.common.settings.Setting; //导入方法依赖的package包/类
/**
 * Provides a reproducible source of randomness seeded by a long
 * seed in the settings with the key setting.
 *
 * @param settings the settings containing the seed
 * @param setting  the setting to access the seed
 * @return a reproducible source of randomness
 */
public static Random get(Settings settings, Setting<Long> setting) {
    if (setting.exists(settings)) {
        return new Random(setting.get(settings));
    } else {
        return get();
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:Randomness.java


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