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


Java Settings.getAsLong方法代码示例

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


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

示例1: addHumanReadableSettings

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
/**
 * Adds human readable version and creation date settings.
 * This method is used to display the settings in a human readable format in REST API
 */
public static Settings addHumanReadableSettings(Settings settings) {
    Settings.Builder builder = Settings.builder().put(settings);
    Version version = settings.getAsVersion(SETTING_VERSION_CREATED, null);
    if (version != null) {
        builder.put(SETTING_VERSION_CREATED_STRING, version.toString());
    }
    Version versionUpgraded = settings.getAsVersion(SETTING_VERSION_UPGRADED, null);
    if (versionUpgraded != null) {
        builder.put(SETTING_VERSION_UPGRADED_STRING, versionUpgraded.toString());
    }
    Long creationDate = settings.getAsLong(SETTING_CREATION_DATE, null);
    if (creationDate != null) {
        DateTime creationDateTime = new DateTime(creationDate, DateTimeZone.UTC);
        builder.put(SETTING_CREATION_DATE_STRING, creationDateTime.toString());
    }
    return builder.build();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:22,代码来源:IndexMetaData.java

示例2: PublishClusterStateVersionAction

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
public PublishClusterStateVersionAction(Settings settings, ClusterService clusterService, TransportService transportService, ClusterStateOpLog clusterStateOpLog) {
    super(settings);
    this.clusterService = clusterService;
    this.transportService = transportService;
    this.clusterStateOpLog = clusterStateOpLog;
    this.pullFullClusterStateAction = new PullFullClusterStateAction(settings, clusterService, transportService, clusterStateOpLog);
    this.fullStateSyncOps = settings.getAsLong(SETTING_FULL_STATE_SYNC_THRESHOLD, 30L);
    this.publishTimeout = settings.getAsTime(PUBLISH_TIMEOUT, publishTimeout);
    this.transportService.registerRequestHandler(PUBLISH_VERSION_ACTION_NAME, BytesTransportRequest.class, ThreadPool.Names.GENERIC, new PublishClusterStateVersionRequestHandler());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:PublishClusterStateVersionAction.java

示例3: timeCreated

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
private long timeCreated(Settings settings) {
    return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1L);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:PriorityComparator.java

示例4: timeCreated

import org.elasticsearch.common.settings.Settings; //导入方法依赖的package包/类
private long timeCreated(Settings settings) {
    return settings.getAsLong(IndexMetaData.SETTING_CREATION_DATE, -1l);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:PriorityComparator.java


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