use of org.elasticsearch.action.admin.indices.status.IndicesStatusRequestBuilder in project bw-calendar-engine by Bedework.
the class BwIndexEsImpl method getIndexInfo.
@Override
public Set<IndexInfo> getIndexInfo() throws CalFacadeException {
final Set<IndexInfo> res = new TreeSet<>();
try {
final IndicesAdminClient idx = getAdminIdx();
final IndicesStatusRequestBuilder isrb = idx.prepareStatus(Strings.EMPTY_ARRAY);
final ActionFuture<IndicesStatusResponse> sr = idx.status(isrb.request());
final IndicesStatusResponse sresp = sr.actionGet();
for (final String inm : sresp.getIndices().keySet()) {
final IndexInfo ii = new IndexInfo(inm);
res.add(ii);
final ClusterStateRequest clusterStateRequest = Requests.clusterStateRequest().routingTable(true).nodes(true).indices(inm);
final Iterator<String> it = getAdminCluster().state(clusterStateRequest).actionGet().getState().getMetaData().aliases().keysIt();
while (it.hasNext()) {
ii.addAlias(it.next());
}
}
return res;
} catch (final Throwable t) {
throw new CalFacadeException(t);
}
}
Aggregations