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


Java Strings.capitalize方法代码示例

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


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

示例1: ensureColor

import org.elasticsearch.common.Strings; //导入方法依赖的package包/类
private ClusterHealthStatus ensureColor(ClusterHealthStatus clusterHealthStatus, TimeValue timeout, String... indices) {
    String color = clusterHealthStatus.name().toLowerCase(Locale.ROOT);
    String method = "ensure" + Strings.capitalize(color);

    ClusterHealthRequest healthRequest = Requests.clusterHealthRequest(indices)
        .timeout(timeout)
        .waitForStatus(clusterHealthStatus)
        .waitForEvents(Priority.LANGUID)
        .waitForNoRelocatingShards(true)
        // We currently often use ensureGreen or ensureYellow to check whether the cluster is back in a good state after shutting down
        // a node. If the node that is stopped is the master node, another node will become master and publish a cluster state where it
        // is master but where the node that was stopped hasn't been removed yet from the cluster state. It will only subsequently
        // publish a second state where the old master is removed. If the ensureGreen/ensureYellow is timed just right, it will get to
        // execute before the second cluster state update removes the old master and the condition ensureGreen / ensureYellow will
        // trivially hold if it held before the node was shut down. The following "waitForNodes" condition ensures that the node has
        // been removed by the master so that the health check applies to the set of nodes we expect to be part of the cluster.
        .waitForNodes(Integer.toString(cluster().size()));

    ClusterHealthResponse actionGet = client().admin().cluster().health(healthRequest).actionGet();
    if (actionGet.isTimedOut()) {
        logger.info("{} timed out, cluster state:\n{}\n{}",
            method,
            client().admin().cluster().prepareState().get().getState(),
            client().admin().cluster().preparePendingClusterTasks().get());
        fail("timed out waiting for " + color + " state");
    }
    assertThat("Expected at least " + clusterHealthStatus + " but got " + actionGet.getStatus(),
        actionGet.getStatus().value(), lessThanOrEqualTo(clusterHealthStatus.value()));
    logger.debug("indices {} are {}", indices.length == 0 ? "[_all]" : indices, color);
    return actionGet.getStatus();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:32,代码来源:ESIntegTestCase.java

示例2: StemmerTokenFilterFactory

import org.elasticsearch.common.Strings; //导入方法依赖的package包/类
public StemmerTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    this.language = Strings.capitalize(settings.get("language", settings.get("name", "porter")));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:StemmerTokenFilterFactory.java

示例3: SnowballTokenFilterFactory

import org.elasticsearch.common.Strings; //导入方法依赖的package包/类
public SnowballTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    this.language = Strings.capitalize(settings.get("language", settings.get("name", "English")));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:SnowballTokenFilterFactory.java

示例4: StemmerTokenFilterFactory

import org.elasticsearch.common.Strings; //导入方法依赖的package包/类
@Inject
public StemmerTokenFilterFactory(Index index, IndexSettingsService indexSettingsService, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    this.language = Strings.capitalize(settings.get("language", settings.get("name", "porter")));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:StemmerTokenFilterFactory.java

示例5: SnowballTokenFilterFactory

import org.elasticsearch.common.Strings; //导入方法依赖的package包/类
@Inject
public SnowballTokenFilterFactory(Index index, IndexSettingsService indexSettingsService, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    this.language = Strings.capitalize(settings.get("language", settings.get("name", "English")));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:SnowballTokenFilterFactory.java


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