use of io.crate.analyze.NumberOfReplicas in project crate by crate.
the class NumberOfReplicasSetting method parseValue.
private static Settings parseValue(String val) {
Settings.Builder builder = Settings.builder();
NumberOfReplicas numberOfReplicas;
try {
Integer numReplicas = parseInt(val, 0, NAME);
numberOfReplicas = new NumberOfReplicas(numReplicas);
} catch (NumberFormatException e) {
numberOfReplicas = new NumberOfReplicas(val);
}
// in case the number_of_replicas is changing from auto_expand to a fixed number -> disable auto expand
builder.put(AutoExpandReplicas.SETTING.getKey(), false);
builder.put(numberOfReplicas.esSettingKey(), numberOfReplicas.esSettingValue());
return builder.build();
}
Aggregations