Tabnine Logo
ClusterUpdateSettingsRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
ClusterUpdateSettingsRequest
in
org.elasticsearch.action.admin.cluster.settings

Best Java code snippets using org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest (Showing top 20 results out of 315)

origin: floragunncom/search-guard

.updateSettings(new ClusterUpdateSettingsRequest()
.transientSettings(ENABLE_ALL_ALLOCATIONS_SETTINGS)
.persistentSettings(ENABLE_ALL_ALLOCATIONS_SETTINGS))
.actionGet()
.isAcknowledged();
origin: org.elasticsearch/elasticsearch

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
  final ClusterUpdateSettingsRequest clusterUpdateSettingsRequest = Requests.clusterUpdateSettingsRequest();
  clusterUpdateSettingsRequest.timeout(request.paramAsTime("timeout", clusterUpdateSettingsRequest.timeout()));
  clusterUpdateSettingsRequest.masterNodeTimeout(
      request.paramAsTime("master_timeout", clusterUpdateSettingsRequest.masterNodeTimeout()));
  Map<String, Object> source;
  try (XContentParser parser = request.contentParser()) {
    source = parser.map();
  }
  if (source.containsKey(TRANSIENT)) {
    clusterUpdateSettingsRequest.transientSettings((Map) source.get(TRANSIENT));
  }
  if (source.containsKey(PERSISTENT)) {
    clusterUpdateSettingsRequest.persistentSettings((Map) source.get(PERSISTENT));
  }
  return channel -> client.admin().cluster().updateSettings(clusterUpdateSettingsRequest, new RestToXContentListener<>(channel));
}
origin: org.elasticsearch/elasticsearch

  @Override
  public ClusterState execute(final ClusterState currentState) {
    final ClusterState clusterState =
        updater.updateSettings(
            currentState,
            clusterSettings.upgradeSettings(request.transientSettings()),
            clusterSettings.upgradeSettings(request.persistentSettings()),
            logger);
    changed = clusterState != currentState;
    return clusterState;
  }
});
origin: org.elasticsearch/elasticsearch

/**
 * Sets the transient settings to be updated. They will not survive a full cluster restart
 */
public ClusterUpdateSettingsRequestBuilder setTransientSettings(Settings settings) {
  request.transientSettings(settings);
  return this;
}
origin: org.elasticsearch/elasticsearch

  /**
   * Sets the persistent settings to be updated. They will get applied cross restarts
   */
  public ClusterUpdateSettingsRequestBuilder setPersistentSettings(Map settings) {
    request.persistentSettings(settings);
    return this;
  }
}
origin: org.elasticsearch/elasticsearch

public static ClusterUpdateSettingsRequest clusterUpdateSettingsRequest() {
  return new ClusterUpdateSettingsRequest();
}
origin: com.scireum/sirius-search

private void changeAllocationMode(String mode) {
  ClusterUpdateSettingsRequest request = new ClusterUpdateSettingsRequest();
  Settings settings = Settings.builder().put("cluster.routing.allocation.enable", mode).build();
  request.transientSettings(settings);
  index.getClient().admin().cluster().updateSettings(request);
}
origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

static Request clusterPutSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest) throws IOException {
  Request request = new Request(HttpPut.METHOD_NAME, "/_cluster/settings");
  RequestConverters.Params parameters = new RequestConverters.Params(request);
  parameters.withTimeout(clusterUpdateSettingsRequest.timeout());
  parameters.withMasterTimeout(clusterUpdateSettingsRequest.masterNodeTimeout());
  request.setEntity(RequestConverters.createEntity(clusterUpdateSettingsRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
  return request;
}
origin: com.strapdata.elasticsearch/elasticsearch

  @Override
  public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    writeSettingsToStream(transientSettings, out);
    writeSettingsToStream(persistentSettings, out);
    writeTimeout(out);
  }
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public void readFrom(StreamInput in) throws IOException {
  super.readFrom(in);
  transientSettings = readSettingsFromStream(in);
  persistentSettings = readSettingsFromStream(in);
  readTimeout(in);
}
origin: org.elasticsearch/elasticsearch

@Override
protected ClusterBlockException checkBlock(ClusterUpdateSettingsRequest request, ClusterState state) {
  // allow for dedicated changes to the metadata blocks, so we don't block those to allow to "re-enable" it
  if (request.transientSettings().size() + request.persistentSettings().size() == 1) {
    // only one setting
    if (MetaData.SETTING_READ_ONLY_SETTING.exists(request.persistentSettings())
      || MetaData.SETTING_READ_ONLY_SETTING.exists(request.transientSettings())
      || MetaData.SETTING_READ_ONLY_ALLOW_DELETE_SETTING.exists(request.transientSettings())
      || MetaData.SETTING_READ_ONLY_ALLOW_DELETE_SETTING.exists(request.persistentSettings())) {
      // one of the settings above as the only setting in the request means - resetting the block!
      return null;
    }
  }
  return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
}
origin: org.elasticsearch/elasticsearch

/**
 * Sets the transient settings to be updated. They will not survive a full cluster restart
 */
public ClusterUpdateSettingsRequestBuilder setTransientSettings(Settings.Builder settings) {
  request.transientSettings(settings);
  return this;
}
origin: org.elasticsearch/elasticsearch

/**
 * Sets the persistent settings to be updated. They will get applied cross restarts
 */
public ClusterUpdateSettingsRequestBuilder setPersistentSettings(Settings.Builder settings) {
  request.persistentSettings(settings);
  return this;
}
origin: org.elasticsearch/elasticsearch

public ClusterUpdateSettingsRequestBuilder(ElasticsearchClient client, ClusterUpdateSettingsAction action) {
  super(client, action, new ClusterUpdateSettingsRequest());
}
origin: apache/servicemix-bundles

static Request clusterPutSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest) throws IOException {
  Request request = new Request(HttpPut.METHOD_NAME, "/_cluster/settings");
  RequestConverters.Params parameters = new RequestConverters.Params(request);
  parameters.withTimeout(clusterUpdateSettingsRequest.timeout());
  parameters.withMasterTimeout(clusterUpdateSettingsRequest.masterNodeTimeout());
  request.setEntity(RequestConverters.createEntity(clusterUpdateSettingsRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
  return request;
}
origin: harbby/presto-connectors

  @Override
  public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    writeSettingsToStream(transientSettings, out);
    writeSettingsToStream(persistentSettings, out);
    writeTimeout(out);
  }
}
origin: harbby/presto-connectors

@Override
public void readFrom(StreamInput in) throws IOException {
  super.readFrom(in);
  transientSettings = readSettingsFromStream(in);
  persistentSettings = readSettingsFromStream(in);
  readTimeout(in);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
  final ClusterUpdateSettingsRequest clusterUpdateSettingsRequest = Requests.clusterUpdateSettingsRequest();
  clusterUpdateSettingsRequest.timeout(request.paramAsTime("timeout", clusterUpdateSettingsRequest.timeout()));
  clusterUpdateSettingsRequest.masterNodeTimeout(
      request.paramAsTime("master_timeout", clusterUpdateSettingsRequest.masterNodeTimeout()));
  Map<String, Object> source;
  try (XContentParser parser = request.contentParser()) {
    source = parser.map();
  }
  if (source.containsKey(TRANSIENT)) {
    clusterUpdateSettingsRequest.transientSettings((Map) source.get(TRANSIENT));
  }
  if (source.containsKey(PERSISTENT)) {
    clusterUpdateSettingsRequest.persistentSettings((Map) source.get(PERSISTENT));
  }
  return channel -> client.admin().cluster().updateSettings(clusterUpdateSettingsRequest, new RestToXContentListener<>(channel));
}
origin: com.strapdata.elasticsearch/elasticsearch

  @Override
  public ClusterState execute(final ClusterState currentState) {
    ClusterState clusterState = updater.updateSettings(currentState, request.transientSettings(), request.persistentSettings());
    changed = clusterState != currentState;
    return clusterState;
  }
});
origin: org.elasticsearch/elasticsearch

/**
 * Sets the transient settings to be updated. They will not survive a full cluster restart
 */
public ClusterUpdateSettingsRequestBuilder setTransientSettings(Map settings) {
  request.transientSettings(settings);
  return this;
}
org.elasticsearch.action.admin.cluster.settingsClusterUpdateSettingsRequest

Javadoc

Request for an update cluster settings action

Most used methods

  • <init>
  • transientSettings
    Sets the transient settings to be updated. They will not survive a full cluster restart
  • masterNodeTimeout
  • persistentSettings
    Sets the persistent settings to be updated. They will get applied cross restarts
  • timeout
  • readTimeout
  • writeTimeout

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Notification (javax.management)
  • JCheckBox (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now