Search in sources :

Example 6 with UpdateSettingsRequest

use of org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest in project elasticsearch by elastic.

the class IndicesRequestIT method testUpdateSettings.

public void testUpdateSettings() {
    interceptTransportActions(UpdateSettingsAction.NAME);
    UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(randomIndicesOrAliases()).settings(Settings.builder().put("refresh_interval", -1));
    internalCluster().coordOnlyNodeClient().admin().indices().updateSettings(updateSettingsRequest).actionGet();
    clearInterceptedActions();
    assertSameIndices(updateSettingsRequest, UpdateSettingsAction.NAME);
}
Also used : UpdateSettingsRequest(org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest)

Example 7 with UpdateSettingsRequest

use of org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest in project graylog2-server by Graylog2.

the class Indices method reopenIndex.

public void reopenIndex(String index) {
    // Mark this index as re-opened. It will never be touched by retention.
    UpdateSettingsRequest settings = new UpdateSettingsRequest(index);
    settings.settings(reopenIndexSettings());
    c.admin().indices().updateSettings(settings).actionGet();
    // Open index.
    c.admin().indices().open(new OpenIndexRequest(index)).actionGet();
}
Also used : UpdateSettingsRequest(org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest) OpenIndexRequest(org.elasticsearch.action.admin.indices.open.OpenIndexRequest)

Aggregations

UpdateSettingsRequest (org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest)7 Settings (org.elasticsearch.common.settings.Settings)3 FutureActionListener (io.crate.action.FutureActionListener)2 OpenIndexRequest (org.elasticsearch.action.admin.indices.open.OpenIndexRequest)2 UpdateSettingsResponse (org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 ClusterRerouteRequest (org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteRequest)1 CloseIndexRequest (org.elasticsearch.action.admin.indices.close.CloseIndexRequest)1 CreateIndexRequest (org.elasticsearch.action.admin.indices.create.CreateIndexRequest)1 DeleteIndexRequest (org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest)1 IndicesOptions (org.elasticsearch.action.support.IndicesOptions)1 Requests.updateSettingsRequest (org.elasticsearch.client.Requests.updateSettingsRequest)1 NodeClient (org.elasticsearch.client.node.NodeClient)1 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)1 DiscoveryNodes (org.elasticsearch.cluster.node.DiscoveryNodes)1