Package org.elasticsearch.cluster.settings

Examples of org.elasticsearch.cluster.settings.DynamicSettings


  private Settings toDynamicSettings(Settings settings) {
    // FIXME TransportClient?
    InternalNode node = (InternalNode) ((NodeClient) getClient()).getNode();

    DynamicSettings indexDynamicSettings = node.injector().getInstance(DynamicSettingsBean.class)
        .getIndexDynamicSettings();

    ImmutableSettings.Builder dynamicSettings = ImmutableSettings.builder();

    for (Map.Entry<String, String> e : settings.getAsMap().entrySet()) {
      if (indexDynamicSettings.hasDynamicSetting(e.getKey())) {
        String error = indexDynamicSettings.validateDynamicSetting(e.getKey(), e.getValue());
        if (error == null) {
          dynamicSettings.put(e.getKey(), e.getValue());
        } else {
          // TODO better error handling
          throw new IllegalArgumentException("index setting " + e.getKey() + " has invalid value '"
View Full Code Here


    @Test
    public void testClusterUpdateSettingsTask() throws Exception {
        final String persistentSetting = "persistent.level";
        final String transientSetting = "transient.uptime";
        // allow our settings to be updated (at all nodes)
        DynamicSettings dynamicSettings;
        for (int i = 0; i < cluster().size(); i++) {
            dynamicSettings = cluster().getInstance(Key.get(DynamicSettings.class, ClusterDynamicSettings.class), "node_" + i);
            dynamicSettings.addDynamicSetting(persistentSetting);
            dynamicSettings.addDynamicSetting(transientSetting);
        }

        // Update persistent only
        Settings persistentSettings = ImmutableSettings.builder()
                .put(persistentSetting, "panic")
View Full Code Here

public class IndexDynamicSettingsModule extends AbstractModule {

    private final DynamicSettings indexDynamicSettings;

    public IndexDynamicSettingsModule() {
        indexDynamicSettings = new DynamicSettings();
        indexDynamicSettings.addDynamicSetting(AbstractIndexStore.INDEX_STORE_THROTTLE_MAX_BYTES_PER_SEC, Validator.BYTES_SIZE);
        indexDynamicSettings.addDynamicSetting(AbstractIndexStore.INDEX_STORE_THROTTLE_TYPE);
        indexDynamicSettings.addDynamicSetting(ConcurrentMergeSchedulerProvider.MAX_THREAD_COUNT);
        indexDynamicSettings.addDynamicSetting(ConcurrentMergeSchedulerProvider.MAX_MERGE_COUNT);
        indexDynamicSettings.addDynamicSetting(FilterAllocationDecider.INDEX_ROUTING_REQUIRE_GROUP + "*");
 
View Full Code Here

TOP

Related Classes of org.elasticsearch.cluster.settings.DynamicSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.