use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.support.master.AcknowledgedResponse in project crate by crate.
the class TransportCreatePartitionsActionTest method testCreateBulkIndicesSimple.
@Test
public void testCreateBulkIndicesSimple() throws Exception {
List<String> indices = Arrays.asList("index1", "index2", "index3", "index4");
AcknowledgedResponse response = action.execute(new CreatePartitionsRequest(indices, UUID.randomUUID())).get();
assertThat(response.isAcknowledged(), is(true));
Metadata indexMetadata = internalCluster().clusterService().state().metadata();
for (String index : indices) {
assertThat(indexMetadata.hasIndex(index), is(true));
}
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.support.master.AcknowledgedResponse in project crate by crate.
the class TransportCreatePartitionsActionTest method testEmpty.
@Test
public void testEmpty() throws Exception {
AcknowledgedResponse response = action.execute(new CreatePartitionsRequest(List.of(), UUID.randomUUID())).get();
assertThat(response.isAcknowledged(), is(true));
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.support.master.AcknowledgedResponse in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method deleteIndexTemplate.
@Override
public boolean deleteIndexTemplate(String templateName) {
final DeleteIndexTemplateRequest request = new DeleteIndexTemplateRequest(templateName);
final AcknowledgedResponse result = client.execute((c, requestOptions) -> c.indices().deleteTemplate(request, requestOptions), "Unable to delete index template " + templateName);
return result.isAcknowledged();
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.support.master.AcknowledgedResponse in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method ensureIndexTemplate.
@Override
public boolean ensureIndexTemplate(String templateName, Map<String, Object> template) {
final PutIndexTemplateRequest request = new PutIndexTemplateRequest(templateName).source(template);
final AcknowledgedResponse result = client.execute((c, requestOptions) -> c.indices().putTemplate(request, requestOptions), "Unable to create index template " + templateName);
return result.isAcknowledged();
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.support.master.AcknowledgedResponse in project sonarqube by SonarSource.
the class EsTester method deleteIndexIfExists.
private static void deleteIndexIfExists(String name) {
try {
AcknowledgedResponse response = ES_REST_CLIENT.nativeClient().indices().delete(new DeleteIndexRequest(name), RequestOptions.DEFAULT);
checkState(response.isAcknowledged(), "Fail to drop the index " + name);
} catch (ElasticsearchStatusException e) {
if (e.status().getStatus() == 404) {
// ignore, index not found
} else {
throw e;
}
} catch (IOException e) {
throw new IllegalStateException("Could not delete index", e);
}
}
Aggregations