use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class ClientES7 method createIndex.
@Override
public void createIndex(String index, int shards, int replicas) {
LOG.debug("Creating index " + index);
final CreateIndexRequest createIndexRequest = new CreateIndexRequest(index);
createIndexRequest.settings(Settings.builder().put("index.number_of_shards", shards).put("index.number_of_replicas", replicas));
client.execute((c, requestOptions) -> c.indices().create(createIndexRequest, requestOptions));
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class ClientES7 method closeIndex.
@Override
public void closeIndex(String index) {
final CloseIndexRequest closeIndexRequest = new CloseIndexRequest(index);
client.execute((c, requestOptions) -> c.indices().close(closeIndexRequest, requestOptions));
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class ClientES7 method addAliasMapping.
@Override
public void addAliasMapping(String indexName, String alias) {
final IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest();
final AliasActions aliasAction = new AliasActions(AliasActions.Type.ADD).index(indexName).alias(alias);
indicesAliasesRequest.addAliasAction(aliasAction);
client.execute((c, requestOptions) -> c.indices().updateAliases(indicesAliasesRequest, requestOptions), "failed to add alias " + alias + " for index " + indexName);
}
use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.RequestOptions in project graylog2-server by Graylog2.
the class FixtureImporterES7 method createIndex.
private void createIndex(String indexName) {
final CreateIndexRequest createIndexRequest = new CreateIndexRequest(indexName).waitForActiveShards(ActiveShardCount.ONE);
client.execute((c, requestOptions) -> c.indices().create(createIndexRequest, requestOptions));
}
Aggregations