public static SizeValue parseSizeValue(String sValue) throws ElasticsearchParseException { return parseSizeValue(sValue, null); }
/** * Returns the setting value (as size) associated with the setting key. If it does not exists, * returns the default value provided. */ public SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException { return parseSizeValue(get(setting), defaultValue); }
public static SizeValue parseSizeValue(String sValue) throws ElasticsearchParseException { return parseSizeValue(sValue, null); }
public static SizeValue parseSizeValue(String sValue) throws ElasticsearchParseException { return parseSizeValue(sValue, null); }
public static SizeValue parseSizeValue(String sValue) throws ElasticsearchParseException { return parseSizeValue(sValue, null); }
public static SizeValue parseSizeValue(String sValue) throws ElasticsearchParseException { return parseSizeValue(sValue, null); }
/** * Returns the setting value (as size) associated with the setting key. If it does not exists, * returns the default value provided. */ public SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException { return parseSizeValue(get(setting), defaultValue); }
/** * Returns the setting value (as size) associated with the setting key. If it does not exists, * returns the default value provided. */ public SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException { return parseSizeValue(get(setting), defaultValue); }
/** * Returns the setting value (as size) associated with the setting key. If it does not exists, * returns the default value provided. */ public SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException { return parseSizeValue(get(setting), defaultValue); }
/** * Returns the setting value (as size) associated with the setting key. If it does not exists, * returns the default value provided. */ public SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException { return parseSizeValue(get(setting), defaultValue); }
/** * Returns the setting value (as size) associated with the setting key. If it does not exists, * returns the default value provided. */ public SizeValue getAsSize(String[] settings, SizeValue defaultValue) throws SettingsException { return parseSizeValue(get(settings), defaultValue); }
/** * A thread pool size can also be unbounded and is represented by -1, which is not supported by SizeValue (which only supports positive numbers) */ private SizeValue getAsSizeOrUnbounded(Settings settings, String setting, SizeValue defaultValue) throws SettingsException { if ("-1".equals(settings.get(setting))) { return null; } return parseSizeValue(settings.get(setting), defaultValue); }
/** * Supports just passing fpp, as in "0.01", and also ranges, like "50k=0.01,1m=0.05". If * its null, returns {@link #buildDefault()}. */ public static Factory buildFromString(@Nullable String config) { if (config == null) { return buildDefault(); } String[] sEntries = Strings.splitStringToArray(config, ','); if (sEntries.length == 0) { if (config.length() > 0) { return new Factory(new Entry[]{new Entry(0, Double.parseDouble(config))}); } return buildDefault(); } Entry[] entries = new Entry[sEntries.length]; for (int i = 0; i < sEntries.length; i++) { int index = sEntries[i].indexOf('='); entries[i] = new Entry( (int) SizeValue.parseSizeValue(sEntries[i].substring(0, index).trim()).singles(), Double.parseDouble(sEntries[i].substring(index + 1).trim()) ); } return new Factory(entries); }