Skip to content

Commit

Permalink
Update Settings: Allow to control index.auto_expand_replicas, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Mar 21, 2011
1 parent 2f1aba9 commit 8f8fb89
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -21,6 +21,7 @@

import org.elasticsearch.cluster.*;
import org.elasticsearch.cluster.routing.RoutingTable;
import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ImmutableSettings;
Expand Down Expand Up @@ -51,7 +52,7 @@ public class MetaDataUpdateSettingsService extends AbstractComponent implements
// TODO we only need to do that on first create of an index, or the number of nodes changed
for (final IndexMetaData indexMetaData : event.state().metaData()) {
String autoExpandReplicas = indexMetaData.settings().get(IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS);
if (autoExpandReplicas != null) {
if (autoExpandReplicas != null && Booleans.parseBoolean(autoExpandReplicas, true)) { // Booleans only work for false values, just as we want it here
try {
final int numberOfReplicas = event.state().nodes().dataNodes().size() - 1;

Expand Down

0 comments on commit 8f8fb89

Please sign in to comment.