本文整理了Java中org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.getIndices()
方法的一些代码示例,展示了ClusterHealthResponse.getIndices()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ClusterHealthResponse.getIndices()
方法的具体详情如下:
包路径:org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse
类名称:ClusterHealthResponse
方法名:getIndices
暂无
代码示例来源:origin: com.scireum/sirius-search
private Map<String, Map<Integer, List<ShardRouting>>> getIndexShardRoutings(ClusterHealthResponse clusterHealthResponse,
ClusterStateResponse clusterStateResponse) {
Map<String, Map<Integer, List<ShardRouting>>> indexShardRoutings = new HashMap<>();
try (XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()) {
for (Map.Entry<String, ClusterIndexHealth> indexHealth : clusterHealthResponse.getIndices().entrySet()) {
String indexName = indexHealth.getValue().getIndex();
indexShardRoutings.put(indexName, getShardRoutings(clusterStateResponse, indexHealth));
}
} catch (IOException e) {
Exceptions.handle(e);
}
return indexShardRoutings;
}
代码示例来源:origin: gitchennan/elasticsearch-query-toolkit
private ImmutableMap<String, IndexState> newIndicesStateCacheInstance(TransportClient client) {
try {
ImmutableMap.Builder<String, IndexState> cacheBuilder = ImmutableMap.<String, IndexState>builder();
GetIndexResponse getIndexResponse = client.admin().indices().prepareGetIndex().execute().actionGet();
ClusterHealthResponse clusterHealthResponse = client.admin().cluster().prepareHealth(getIndexResponse.indices()).execute().actionGet();
for (String index : clusterHealthResponse.getIndices().keySet()) {
ClusterHealthStatus indexStatus = clusterHealthResponse.getIndices().get(index).getStatus();
cacheBuilder.put(index, IndexState.newIndexState(index, IndexState.IndexStatus.fromString(indexStatus.name())));
}
indicesStateCacheMissing = false;
return cacheBuilder.build();
}
catch (Exception ex) {
EsPersistLogger.warn(this, "Failed to get index state.", ex);
indicesStateCacheMissing = true;
return ImmutableMap.<String, IndexState>builder().build();
}
}
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-sail-elasticsearch
logger.info("Cluster nodes: {} (data {})", healthResponse.getNumberOfNodes(),
healthResponse.getNumberOfDataNodes());
ClusterIndexHealth indexHealth = healthResponse.getIndices().get(indexName);
logger.info("Index health: {}", indexHealth.getStatus());
logger.info(
代码示例来源:origin: dadoonet/spring-elasticsearch
if (healths.isTimedOut()) {
logger.warn("we got a timeout when checking indices status...");
if (healths.getIndices() != null) {
for (ClusterIndexHealth health : healths.getIndices().values()) {
if (health.getStatus() == ClusterHealthStatus.RED) {
logger.warn("index [{}] is in RED state", health.getIndex());
代码示例来源:origin: org.elasticsearch/elasticsearch
ClusterIndexHealth indexHealth = response.getIndices().get(indexName);
IndexStats indexStats = stats.getIndices().get(indexName);
IndexMetaData indexMetaData = indexMetaDatas.getIndices().get(indexName);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
ClusterIndexHealth indexHealth = response.getIndices().get(indexName);
IndexStats indexStats = stats.getIndices().get(indexName);
IndexMetaData indexMetaData = indexMetaDatas.getIndices().get(indexName);
代码示例来源:origin: apache/servicemix-bundles
ClusterIndexHealth indexHealth = response.getIndices().get(indexName);
IndexStats indexStats = stats.getIndices().get(indexName);
IndexMetaData indexMetaData = indexMetaDatas.getIndices().get(indexName);
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
ClusterIndexHealth indexHealth = response.getIndices().get(indexName);
IndexStats indexStats = stats.getIndices().get(indexName);
IndexMetaData indexMetaData = indexMetaDatas.getIndices().get(indexName);
代码示例来源:origin: harbby/presto-connectors
ClusterIndexHealth indexHealth = health.getIndices().get(index);
IndexStats indexStats = stats.getIndices().get(index);
IndexMetaData indexMetaData = indexMetaDatas.getIndices().get(index);
内容来源于网络,如有侵权,请联系作者删除!