use of org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest in project crate by crate.
the class UpdateSettingsPlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) {
Function<? super Symbol, Object> eval = x -> SymbolEvaluator.evaluate(plannerContext.transactionContext(), plannerContext.nodeContext(), x, params, subQueryResults);
ClusterUpdateSettingsRequest request = isPersistent ? new ClusterUpdateSettingsRequest().persistentSettings(buildSettingsFrom(settings, eval)) : new ClusterUpdateSettingsRequest().transientSettings(buildSettingsFrom(settings, eval));
OneRowActionListener<ClusterUpdateSettingsResponse> actionListener = new OneRowActionListener<>(consumer, r -> r.isAcknowledged() ? new Row1(1L) : new Row1(0L));
dependencies.transportActionProvider().transportClusterUpdateSettingsAction().execute(request, actionListener);
}
use of org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest in project graylog2-server by Graylog2.
the class ClientES7 method putSetting.
@Override
public void putSetting(String setting, String value) {
final ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest();
request.persistentSettings(Settings.builder().put(setting, value));
client.execute((c, requestOptions) -> c.cluster().putSettings(request, requestOptions), "Unable to update ES cluster setting: " + setting + "=" + value);
}
Aggregations