mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
Fix line lengths for ingest config utils
This commit is contained in:
parent
e5caadc4f3
commit
f6491047a0
@ -39,8 +39,8 @@ public final class ConfigurationUtils {
|
|||||||
*
|
*
|
||||||
* If the property value isn't of type string a {@link ElasticsearchParseException} is thrown.
|
* If the property value isn't of type string a {@link ElasticsearchParseException} is thrown.
|
||||||
*/
|
*/
|
||||||
public static String readOptionalStringProperty(String processorType, String processorTag, Map<String, Object> configuration,
|
public static String readOptionalStringProperty(String processorType, String processorTag,
|
||||||
String propertyName) {
|
Map<String, Object> configuration, String propertyName) {
|
||||||
Object value = configuration.remove(propertyName);
|
Object value = configuration.remove(propertyName);
|
||||||
return readString(processorType, processorTag, propertyName, value);
|
return readString(processorType, processorTag, propertyName, value);
|
||||||
}
|
}
|
||||||
@ -112,8 +112,8 @@ public final class ConfigurationUtils {
|
|||||||
* If the property value isn't of type int a {@link ElasticsearchParseException} is thrown.
|
* If the property value isn't of type int a {@link ElasticsearchParseException} is thrown.
|
||||||
* If the property is missing an {@link ElasticsearchParseException} is thrown
|
* If the property is missing an {@link ElasticsearchParseException} is thrown
|
||||||
*/
|
*/
|
||||||
public static int readIntProperty(String processorType, String processorTag, Map<String, Object> configuration, String propertyName,
|
public static int readIntProperty(String processorType, String processorTag, Map<String, Object> configuration,
|
||||||
int defaultValue) {
|
String propertyName, int defaultValue) {
|
||||||
Object value = configuration.remove(propertyName);
|
Object value = configuration.remove(propertyName);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
@ -146,7 +146,8 @@ public final class ConfigurationUtils {
|
|||||||
* If the property value isn't of type list an {@link ElasticsearchParseException} is thrown.
|
* If the property value isn't of type list an {@link ElasticsearchParseException} is thrown.
|
||||||
* If the property is missing an {@link ElasticsearchParseException} is thrown
|
* If the property is missing an {@link ElasticsearchParseException} is thrown
|
||||||
*/
|
*/
|
||||||
public static <T> List<T> readList(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) {
|
public static <T> List<T> readList(String processorType, String processorTag, Map<String, Object> configuration,
|
||||||
|
String propertyName) {
|
||||||
Object value = configuration.remove(propertyName);
|
Object value = configuration.remove(propertyName);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw newConfigurationException(processorType, processorTag, propertyName, "required property is missing");
|
throw newConfigurationException(processorType, processorTag, propertyName, "required property is missing");
|
||||||
@ -211,7 +212,8 @@ public final class ConfigurationUtils {
|
|||||||
/**
|
/**
|
||||||
* Returns and removes the specified property as an {@link Object} from the specified configuration map.
|
* Returns and removes the specified property as an {@link Object} from the specified configuration map.
|
||||||
*/
|
*/
|
||||||
public static Object readObject(String processorType, String processorTag, Map<String, Object> configuration, String propertyName) {
|
public static Object readObject(String processorType, String processorTag, Map<String, Object> configuration,
|
||||||
|
String propertyName) {
|
||||||
Object value = configuration.remove(propertyName);
|
Object value = configuration.remove(propertyName);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw newConfigurationException(processorType, processorTag, propertyName, "required property is missing");
|
throw newConfigurationException(processorType, processorTag, propertyName, "required property is missing");
|
||||||
@ -219,8 +221,8 @@ public final class ConfigurationUtils {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ElasticsearchParseException newConfigurationException(String processorType, String processorTag, String propertyName,
|
public static ElasticsearchParseException newConfigurationException(String processorType, String processorTag,
|
||||||
String reason) {
|
String propertyName, String reason) {
|
||||||
ElasticsearchParseException exception = new ElasticsearchParseException("[" + propertyName + "] " + reason);
|
ElasticsearchParseException exception = new ElasticsearchParseException("[" + propertyName + "] " + reason);
|
||||||
|
|
||||||
if (processorType != null) {
|
if (processorType != null) {
|
||||||
@ -249,7 +251,8 @@ public final class ConfigurationUtils {
|
|||||||
return processors;
|
return processors;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Processor readProcessor(Map<String, Processor.Factory> processorFactories, String type, Map<String, Object> config) throws Exception {
|
private static Processor readProcessor(Map<String, Processor.Factory> processorFactories,
|
||||||
|
String type, Map<String, Object> config) throws Exception {
|
||||||
Processor.Factory factory = processorFactories.get(type);
|
Processor.Factory factory = processorFactories.get(type);
|
||||||
if (factory != null) {
|
if (factory != null) {
|
||||||
boolean ignoreFailure = ConfigurationUtils.readBooleanProperty(null, null, config, "ignore_failure", false);
|
boolean ignoreFailure = ConfigurationUtils.readBooleanProperty(null, null, config, "ignore_failure", false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user