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