use of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method delete.
@Override
public void delete(String index) {
final DeleteIndexRequest request = new DeleteIndexRequest(index);
client.execute((c, requestOptions) -> c.indices().delete(request, requestOptions));
}
use of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest in project titan by thinkaurelius.
the class ElasticSearchIndex method clearStorage.
@Override
public void clearStorage() throws StorageException {
try {
try {
client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet();
// We wait for one second to let ES delete the river
Thread.sleep(1000);
} catch (IndexMissingException e) {
// Index does not exist... Fine
}
} catch (Exception e) {
throw new PermanentStorageException("Could not delete index " + indexName, e);
} finally {
close();
}
}
use of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest in project snow-owl by b2ihealthcare.
the class EsIndexAdmin method delete.
@Override
public void delete() {
if (exists()) {
final DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(name + "*");
try {
final AcknowledgedResponse deleteIndexResponse = client().indices().delete(deleteIndexRequest);
checkState(deleteIndexResponse.isAcknowledged(), "Failed to delete all ES indices for '%s'.", name);
} catch (Exception e) {
throw new IndexException(String.format("Failed to delete all ES indices for '%s'.", name), e);
}
}
}
use of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest in project sonarqube by SonarSource.
the class MigrationEsClientImpl method deleteIndex.
private void deleteIndex(String index) {
Loggers.get(getClass()).info("Drop Elasticsearch index [{}]", index);
client.deleteIndex(new DeleteIndexRequest(index));
}
use of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest in project apex-malhar by apache.
the class ElasticSearchPercolateTest method cleanup.
@After
public void cleanup() throws IOException {
try {
DeleteIndexResponse delete = store.client.admin().indices().delete(new DeleteIndexRequest(INDEX_NAME)).actionGet();
if (!delete.isAcknowledged()) {
logger.error("Index wasn't deleted");
}
store.disconnect();
} catch (NoNodeAvailableException e) {
// This indicates that elasticsearch is not running on a particular machine.
// Silently ignore in this case.
}
}
Aggregations