Replaced IOException with Exception on factory implementations' `Processor.Factory#create(Map)` method.
This commit is contained in:
parent
fdf4543b8e
commit
dde274d944
|
@ -21,7 +21,6 @@ package org.elasticsearch.ingest.processor;
|
||||||
|
|
||||||
import org.elasticsearch.ingest.IngestDocument;
|
import org.elasticsearch.ingest.IngestDocument;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -58,7 +57,7 @@ public abstract class AbstractStringProcessor implements Processor {
|
||||||
|
|
||||||
public static abstract class Factory<T extends AbstractStringProcessor> implements Processor.Factory<T> {
|
public static abstract class Factory<T extends AbstractStringProcessor> implements Processor.Factory<T> {
|
||||||
@Override
|
@Override
|
||||||
public T create(Map<String, Object> config) throws IOException {
|
public T create(Map<String, Object> config) throws Exception {
|
||||||
List<String> fields = ConfigurationUtils.readList(config, "fields");
|
List<String> fields = ConfigurationUtils.readList(config, "fields");
|
||||||
return newProcessor(Collections.unmodifiableList(fields));
|
return newProcessor(Collections.unmodifiableList(fields));
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -129,7 +128,7 @@ public class ConvertProcessor implements Processor {
|
||||||
|
|
||||||
public static class Factory implements Processor.Factory<ConvertProcessor> {
|
public static class Factory implements Processor.Factory<ConvertProcessor> {
|
||||||
@Override
|
@Override
|
||||||
public ConvertProcessor create(Map<String, Object> config) throws IOException {
|
public ConvertProcessor create(Map<String, Object> config) throws Exception {
|
||||||
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
||||||
Map<String, Type> convertFields = new HashMap<>();
|
Map<String, Type> convertFields = new HashMap<>();
|
||||||
for (Map.Entry<String, String> entry : fields.entrySet()) {
|
for (Map.Entry<String, String> entry : fields.entrySet()) {
|
||||||
|
|
|
@ -111,7 +111,7 @@ public final class DateProcessor implements Processor {
|
||||||
public static class Factory implements Processor.Factory<DateProcessor> {
|
public static class Factory implements Processor.Factory<DateProcessor> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public DateProcessor create(Map<String, Object> config) {
|
public DateProcessor create(Map<String, Object> config) throws Exception {
|
||||||
String matchField = ConfigurationUtils.readStringProperty(config, "match_field");
|
String matchField = ConfigurationUtils.readStringProperty(config, "match_field");
|
||||||
String targetField = ConfigurationUtils.readStringProperty(config, "target_field", DEFAULT_TARGET_FIELD);
|
String targetField = ConfigurationUtils.readStringProperty(config, "target_field", DEFAULT_TARGET_FIELD);
|
||||||
String timezoneString = ConfigurationUtils.readOptionalStringProperty(config, "timezone");
|
String timezoneString = ConfigurationUtils.readOptionalStringProperty(config, "timezone");
|
||||||
|
|
|
@ -220,7 +220,7 @@ public final class GeoIpProcessor implements Processor {
|
||||||
private Path geoIpConfigDirectory;
|
private Path geoIpConfigDirectory;
|
||||||
private final DatabaseReaderService databaseReaderService = new DatabaseReaderService();
|
private final DatabaseReaderService databaseReaderService = new DatabaseReaderService();
|
||||||
|
|
||||||
public GeoIpProcessor create(Map<String, Object> config) throws IOException {
|
public GeoIpProcessor create(Map<String, Object> config) throws Exception {
|
||||||
String ipField = readStringProperty(config, "source_field");
|
String ipField = readStringProperty(config, "source_field");
|
||||||
String targetField = readStringProperty(config, "target_field", "geoip");
|
String targetField = readStringProperty(config, "target_field", "geoip");
|
||||||
String databaseFile = readStringProperty(config, "database_file", "GeoLite2-City.mmdb");
|
String databaseFile = readStringProperty(config, "database_file", "GeoLite2-City.mmdb");
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.file.DirectoryStream;
|
import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
@ -39,7 +38,7 @@ public final class GrokProcessor implements Processor {
|
||||||
private final String matchField;
|
private final String matchField;
|
||||||
private final Grok grok;
|
private final Grok grok;
|
||||||
|
|
||||||
public GrokProcessor(Grok grok, String matchField) throws IOException {
|
public GrokProcessor(Grok grok, String matchField) {
|
||||||
this.matchField = matchField;
|
this.matchField = matchField;
|
||||||
this.grok = grok;
|
this.grok = grok;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +71,7 @@ public final class GrokProcessor implements Processor {
|
||||||
public static class Factory implements Processor.Factory<GrokProcessor> {
|
public static class Factory implements Processor.Factory<GrokProcessor> {
|
||||||
private Path grokConfigDirectory;
|
private Path grokConfigDirectory;
|
||||||
|
|
||||||
public GrokProcessor create(Map<String, Object> config) throws IOException {
|
public GrokProcessor create(Map<String, Object> config) throws Exception {
|
||||||
String matchField = ConfigurationUtils.readStringProperty(config, "field");
|
String matchField = ConfigurationUtils.readStringProperty(config, "field");
|
||||||
String matchPattern = ConfigurationUtils.readStringProperty(config, "pattern");
|
String matchPattern = ConfigurationUtils.readStringProperty(config, "pattern");
|
||||||
Map<String, String> patternBank = new HashMap<>();
|
Map<String, String> patternBank = new HashMap<>();
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -68,7 +67,7 @@ public class GsubProcessor implements Processor {
|
||||||
|
|
||||||
public static class Factory implements Processor.Factory<GsubProcessor> {
|
public static class Factory implements Processor.Factory<GsubProcessor> {
|
||||||
@Override
|
@Override
|
||||||
public GsubProcessor create(Map<String, Object> config) throws IOException {
|
public GsubProcessor create(Map<String, Object> config) throws Exception {
|
||||||
List<Map<String, String>> gsubConfig = ConfigurationUtils.readList(config, "expressions");
|
List<Map<String, String>> gsubConfig = ConfigurationUtils.readList(config, "expressions");
|
||||||
List<GsubExpression> gsubExpressions = new ArrayList<>();
|
List<GsubExpression> gsubExpressions = new ArrayList<>();
|
||||||
for (Map<String, String> stringObjectMap : gsubConfig) {
|
for (Map<String, String> stringObjectMap : gsubConfig) {
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -68,7 +67,7 @@ public class JoinProcessor implements Processor {
|
||||||
|
|
||||||
public static class Factory implements Processor.Factory<JoinProcessor> {
|
public static class Factory implements Processor.Factory<JoinProcessor> {
|
||||||
@Override
|
@Override
|
||||||
public JoinProcessor create(Map<String, Object> config) throws IOException {
|
public JoinProcessor create(Map<String, Object> config) throws Exception {
|
||||||
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
||||||
return new JoinProcessor(Collections.unmodifiableMap(fields));
|
return new JoinProcessor(Collections.unmodifiableMap(fields));
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.IngestDocument.MetaData;
|
import org.elasticsearch.ingest.IngestDocument.MetaData;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -49,7 +48,7 @@ public final class MetaDataProcessor implements Processor {
|
||||||
private final MustacheFactory mustacheFactory = new DefaultMustacheFactory();
|
private final MustacheFactory mustacheFactory = new DefaultMustacheFactory();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MetaDataProcessor create(Map<String, Object> config) throws IOException {
|
public MetaDataProcessor create(Map<String, Object> config) throws Exception {
|
||||||
Map<MetaData, Mustache> templates = new HashMap<>();
|
Map<MetaData, Mustache> templates = new HashMap<>();
|
||||||
Iterator<Map.Entry<String, Object>> iterator = config.entrySet().iterator();
|
Iterator<Map.Entry<String, Object>> iterator = config.entrySet().iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -60,7 +59,7 @@ public class RemoveProcessor implements Processor {
|
||||||
|
|
||||||
public static class Factory implements Processor.Factory<RemoveProcessor> {
|
public static class Factory implements Processor.Factory<RemoveProcessor> {
|
||||||
@Override
|
@Override
|
||||||
public RemoveProcessor create(Map<String, Object> config) throws IOException {
|
public RemoveProcessor create(Map<String, Object> config) throws Exception {
|
||||||
List<String> fields = ConfigurationUtils.readList(config, "fields");
|
List<String> fields = ConfigurationUtils.readList(config, "fields");
|
||||||
return new RemoveProcessor(Collections.unmodifiableList(fields));
|
return new RemoveProcessor(Collections.unmodifiableList(fields));
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -65,7 +64,7 @@ public class RenameProcessor implements Processor {
|
||||||
|
|
||||||
public static class Factory implements Processor.Factory<RenameProcessor> {
|
public static class Factory implements Processor.Factory<RenameProcessor> {
|
||||||
@Override
|
@Override
|
||||||
public RenameProcessor create(Map<String, Object> config) throws IOException {
|
public RenameProcessor create(Map<String, Object> config) throws Exception {
|
||||||
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
||||||
return new RenameProcessor(Collections.unmodifiableMap(fields));
|
return new RenameProcessor(Collections.unmodifiableMap(fields));
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ public class SetProcessor implements Processor {
|
||||||
|
|
||||||
public static final class Factory implements Processor.Factory<SetProcessor> {
|
public static final class Factory implements Processor.Factory<SetProcessor> {
|
||||||
@Override
|
@Override
|
||||||
public SetProcessor create(Map<String, Object> config) throws IOException {
|
public SetProcessor create(Map<String, Object> config) throws Exception {
|
||||||
Map<String, Object> fields = ConfigurationUtils.readMap(config, "fields");
|
Map<String, Object> fields = ConfigurationUtils.readMap(config, "fields");
|
||||||
return new SetProcessor(Collections.unmodifiableMap(fields));
|
return new SetProcessor(Collections.unmodifiableMap(fields));
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.elasticsearch.ingest.IngestDocument;
|
||||||
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
import org.elasticsearch.ingest.processor.ConfigurationUtils;
|
||||||
import org.elasticsearch.ingest.processor.Processor;
|
import org.elasticsearch.ingest.processor.Processor;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -65,7 +64,7 @@ public class SplitProcessor implements Processor {
|
||||||
|
|
||||||
public static class Factory implements Processor.Factory<SplitProcessor> {
|
public static class Factory implements Processor.Factory<SplitProcessor> {
|
||||||
@Override
|
@Override
|
||||||
public SplitProcessor create(Map<String, Object> config) throws IOException {
|
public SplitProcessor create(Map<String, Object> config) throws Exception {
|
||||||
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
Map<String, String> fields = ConfigurationUtils.readMap(config, "fields");
|
||||||
return new SplitProcessor(Collections.unmodifiableMap(fields));
|
return new SplitProcessor(Collections.unmodifiableMap(fields));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue