org.elasticsearch.action.admin.indices.stats.IndicesStatsRequestBuilder.get()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.elasticsearch.action.admin.indices.stats.IndicesStatsRequestBuilder.get()方法的一些代码示例,展示了IndicesStatsRequestBuilder.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IndicesStatsRequestBuilder.get()方法的具体详情如下:
包路径:org.elasticsearch.action.admin.indices.stats.IndicesStatsRequestBuilder
类名称:IndicesStatsRequestBuilder
方法名:get

IndicesStatsRequestBuilder.get介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

@Test
public void fail_to_stats() {
 try {
  es.client().prepareStats("unknown").get();
  fail();
 } catch (Exception e) {
  assertThat(e).isInstanceOf(IllegalStateException.class);
  assertThat(e.getMessage()).contains("Fail to execute ES indices stats request on indices 'unknown'");
 }
}

代码示例来源:origin: SonarSource/sonarqube

private void completeIndexAttributes(ProtobufSystemInfo.Section.Builder protobuf) {
  IndicesStatsResponse indicesStats = esClient.prepareStats().all().get();
  for (Map.Entry<String, IndexStats> indexStats : indicesStats.getIndices().entrySet()) {
   String prefix = "Index " + indexStats.getKey() + " - ";
   setAttribute(protobuf, prefix + "Docs", indexStats.getValue().getPrimaries().getDocs().getCount());
   setAttribute(protobuf, prefix + "Shards", indexStats.getValue().getShards().length);
   setAttribute(protobuf, prefix + "Store Size", byteCountToDisplaySize(indexStats.getValue().getPrimaries().getStore().getSizeInBytes()));
  }
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void get_with_string_timeout_is_not_yet_implemented() {
 try {
  es.client().prepareStats(FakeIndexDefinition.INDEX).get("1");
  fail();
 } catch (Exception e) {
  assertThat(e).isInstanceOf(IllegalStateException.class).hasMessage("Not yet implemented");
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void get_with_time_value_timeout_is_not_yet_implemented() {
 try {
  es.client().prepareStats(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1));
  fail();
 } catch (Exception e) {
  assertThat(e).isInstanceOf(IllegalStateException.class).hasMessage("Not yet implemented");
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void trace_logs() {
 logTester.setLevel(LoggerLevel.TRACE);
 es.client().prepareStats(FakeIndexDefinition.INDEX).get();
 assertThat(logTester.logs(LoggerLevel.TRACE)).hasSize(1);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void stats() {
 es.client().prepareStats(FakeIndexDefinition.INDEX).get();
}

代码示例来源:origin: pinterest/soundwave

public Map<String, IndexStats> getIndexStats() throws Exception {
 IndicesStatsResponse resp = esClient.admin().indices().prepareStats().all().get();
 return resp.getIndices();
}

代码示例来源:origin: dropwizard/dropwizard-elasticsearch

final IndicesStatsResponse indicesStatsResponse = client.admin().indices().prepareStats(indices).get();

代码示例来源:origin: org.sonarsource.sonarqube/sonar-server

private void completeIndexAttributes(ProtobufSystemInfo.Section.Builder protobuf) {
  IndicesStatsResponse indicesStats = esClient.prepareStats().all().get();
  for (Map.Entry<String, IndexStats> indexStats : indicesStats.getIndices().entrySet()) {
   String prefix = "Index " + indexStats.getKey() + " - ";
   setAttribute(protobuf, prefix + "Docs", indexStats.getValue().getPrimaries().getDocs().getCount());
   setAttribute(protobuf, prefix + "Shards", indexStats.getValue().getShards().length);
   setAttribute(protobuf, prefix + "Store Size", byteCountToDisplaySize(indexStats.getValue().getPrimaries().getStore().getSizeInBytes()));
  }
 }
}

代码示例来源:origin: sirensolutions/siren-join

private QueryCacheStats getQueryCacheStats(String index) {
 IndicesStatsResponse statsResponse = client().admin().indices().prepareStats(index).setQueryCache(true).setRefresh(true).get();
 return statsResponse.getIndex(index).getTotal().getQueryCache();
}

代码示例来源:origin: com.strapdata.elasticsearch.test/framework

protected void assertSeqNos() throws Exception {
  assertBusy(() -> {
    IndicesStatsResponse stats = client().admin().indices().prepareStats().clear().get();
    for (IndexStats indexStats : stats.getIndices().values()) {
      for (IndexShardStats indexShardStats : indexStats.getIndexShards().values()) {

代码示例来源:origin: com.scireum/sirius-search

NodesStatsResponse nodesStatsResponse = index.getClient().admin().cluster().prepareNodesStats().get();
ClusterStateResponse clusterStateResponse = index.getClient().admin().cluster().prepareState().get();
IndicesStatsResponse indicesStatsResponse = index.getClient().admin().indices().prepareStats().all().get();

相关文章