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


Java ClusterStatsAction类代码示例

本文整理汇总了Java中org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction的典型用法代码示例。如果您正苦于以下问题:Java ClusterStatsAction类的具体用法?Java ClusterStatsAction怎么用?Java ClusterStatsAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ClusterStatsAction类属于org.elasticsearch.action.admin.cluster.stats包,在下文中一共展示了ClusterStatsAction类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testActions

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
public void testActions() {

        // TODO this is a really shitty way to test it, we need to figure out a way to test all the client methods
        //      without specifying each one (reflection doesn't as each action needs its own special settings, without
        //      them, request validation will fail before the test is executed. (one option is to enable disabling the
        //      validation in the settings??? - ugly and conceptually wrong)

        // choosing arbitrary top level actions to test
        client.prepareGet("idx", "type", "id").execute().addListener(new AssertingActionListener<>(GetAction.NAME, client.threadPool()));
        client.prepareSearch().execute().addListener(new AssertingActionListener<>(SearchAction.NAME, client.threadPool()));
        client.prepareDelete("idx", "type", "id").execute().addListener(new AssertingActionListener<>(DeleteAction.NAME, client.threadPool()));
        client.admin().cluster().prepareDeleteStoredScript("lang", "id").execute().addListener(new AssertingActionListener<>(DeleteStoredScriptAction.NAME, client.threadPool()));
        client.prepareIndex("idx", "type", "id").setSource("source", XContentType.JSON).execute().addListener(new AssertingActionListener<>(IndexAction.NAME, client.threadPool()));

        // choosing arbitrary cluster admin actions to test
        client.admin().cluster().prepareClusterStats().execute().addListener(new AssertingActionListener<>(ClusterStatsAction.NAME, client.threadPool()));
        client.admin().cluster().prepareCreateSnapshot("repo", "bck").execute().addListener(new AssertingActionListener<>(CreateSnapshotAction.NAME, client.threadPool()));
        client.admin().cluster().prepareReroute().execute().addListener(new AssertingActionListener<>(ClusterRerouteAction.NAME, client.threadPool()));

        // choosing arbitrary indices admin actions to test
        client.admin().indices().prepareCreate("idx").execute().addListener(new AssertingActionListener<>(CreateIndexAction.NAME, client.threadPool()));
        client.admin().indices().prepareStats().execute().addListener(new AssertingActionListener<>(IndicesStatsAction.NAME, client.threadPool()));
        client.admin().indices().prepareClearCache("idx1", "idx2").execute().addListener(new AssertingActionListener<>(ClearIndicesCacheAction.NAME, client.threadPool()));
        client.admin().indices().prepareFlush().execute().addListener(new AssertingActionListener<>(FlushAction.NAME, client.threadPool()));
    }
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:26,代码来源:AbstractClientHeadersTestCase.java

示例2: getClusterStatsNodes

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
public ClusterStatsNodes getClusterStatsNodes() {
    ClusterStatsRequest clusterStatsRequest =
        new ClusterStatsRequestBuilder(elasticsearchClient.admin().cluster(), ClusterStatsAction.INSTANCE).request();
    ClusterStatsResponse clusterStatsResponse =
        elasticsearchClient.admin().cluster().clusterStats(clusterStatsRequest).actionGet();
    ClusterStatsNodes clusterStatsNodes = clusterStatsResponse.getNodesStats();
    return clusterStatsNodes;
}
 
开发者ID:yacy,项目名称:yacy_grid_mcp,代码行数:9,代码来源:ElasticsearchClient.java

示例3: getStats

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
/**
 * Retrieve a statistic object from the connected elasticsearch cluster
 * 
 * @return cluster stats from connected cluster
 */
public ClusterStatsNodes getStats() {
    final ClusterStatsRequest clusterStatsRequest =
        new ClusterStatsRequestBuilder(elasticsearchClient.admin().cluster(), ClusterStatsAction.INSTANCE)
            .request();
    final ClusterStatsResponse clusterStatsResponse =
        elasticsearchClient.admin().cluster().clusterStats(clusterStatsRequest).actionGet();
    final ClusterStatsNodes clusterStatsNodes = clusterStatsResponse.getNodesStats();
    return clusterStatsNodes;
}
 
开发者ID:yacy,项目名称:yacy_grid_mcp,代码行数:15,代码来源:ElasticsearchClient.java

示例4: testOverrideHeader

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
public void testOverrideHeader() throws Exception {
    String key1Val = randomAsciiOfLength(5);
    Map<String, String> expected = new HashMap<>();
    expected.put("key1", key1Val);
    expected.put("key2", "val 2");
    client.threadPool().getThreadContext().putHeader("key1", key1Val);
    client.prepareGet("idx", "type", "id")
            .execute().addListener(new AssertingActionListener<>(GetAction.NAME, expected, client.threadPool()));

    client.admin().cluster().prepareClusterStats()
            .execute().addListener(new AssertingActionListener<>(ClusterStatsAction.NAME, expected, client.threadPool()));

    client.admin().indices().prepareCreate("idx")
            .execute().addListener(new AssertingActionListener<>(CreateIndexAction.NAME, expected, client.threadPool()));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:AbstractClientHeadersTestCase.java

示例5: TransportLexicalizeAction

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
@Inject
public TransportLexicalizeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
                                 ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Config config) {
    super(settings, ClusterStatsAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            LexicalizeRequest::new, TransportLexicalizeAction.NodeInfoRequest::new, ThreadPool.Names.MANAGEMENT, LexicalizeResponse.Node.class);
    this.config = config;
}
 
开发者ID:wxingyl,项目名称:elasticsearch-analysis-benz,代码行数:8,代码来源:TransportLexicalizeAction.java

示例6: clusterStats

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
@Override
public ActionFuture<ClusterStatsResponse> clusterStats(ClusterStatsRequest request) {
    return execute(ClusterStatsAction.INSTANCE, request);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java

示例7: prepareClusterStats

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
@Override
public ClusterStatsRequestBuilder prepareClusterStats() {
    return new ClusterStatsRequestBuilder(this, ClusterStatsAction.INSTANCE);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java

示例8: getAction

import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; //导入依赖的package包/类
public ClusterStatsAction getAction() {
    return ClusterStatsAction.INSTANCE;
}
 
开发者ID:obourgain,项目名称:elasticsearch-http,代码行数:4,代码来源:ClusterStatsActionHandler.java


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