use of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest in project graylog2-server by Graylog2.
the class IndicesGetAllMessageFieldsTest method GetAllMessageFieldsForIndicesForNonexistingIndexShouldReturnEmptySet.
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.DELETE_ALL)
public void GetAllMessageFieldsForIndicesForNonexistingIndexShouldReturnEmptySet() throws Exception {
final String[] indexNames = new String[] { "graylog_0" };
final IndicesExistsResponse response = client.admin().indices().exists(new IndicesExistsRequest("graylog_0")).get();
assertThat(response.isExists()).isFalse();
final Map<String, Set<String>> result = indices.getAllMessageFieldsForIndices(indexNames);
assertThat(result).isNotNull().isEmpty();
}
use of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest in project beam by apache.
the class ElasticSearchIOTestUtils method deleteIndex.
/** Deletes the given index synchronously. */
static void deleteIndex(String index, Client client) throws Exception {
IndicesAdminClient indices = client.admin().indices();
IndicesExistsResponse indicesExistsResponse = indices.exists(new IndicesExistsRequest(index)).get();
if (indicesExistsResponse.isExists()) {
indices.prepareClose(index).get();
indices.delete(Requests.deleteIndexRequest(index)).get();
}
}
Aggregations