22
22
import org .elasticsearch .ingest .AbstractProcessor ;
23
23
import org .elasticsearch .ingest .ConfigurationUtils ;
24
24
import org .elasticsearch .ingest .IngestDocument ;
25
+ import org .elasticsearch .ingest .Processor ;
25
26
26
27
import java .util .List ;
27
28
import java .util .Map ;
@@ -54,9 +55,9 @@ public final class CsvProcessor extends AbstractProcessor {
54
55
final boolean ignoreMissing ;
55
56
final Object emptyValue ;
56
57
57
- CsvProcessor (String tag , String field , String [] headers , boolean trim , char separator , char quote , boolean ignoreMissing ,
58
- Object emptyValue ) {
59
- super (tag );
58
+ CsvProcessor (String tag , String description , String field , String [] headers , boolean trim , char separator , char quote ,
59
+ boolean ignoreMissing , Object emptyValue ) {
60
+ super (tag , description );
60
61
this .field = field ;
61
62
this .headers = headers ;
62
63
this .trim = trim ;
@@ -89,8 +90,8 @@ public String getType() {
89
90
90
91
public static final class Factory implements org .elasticsearch .ingest .Processor .Factory {
91
92
@ Override
92
- public CsvProcessor create (Map <String , org . elasticsearch . ingest . Processor .Factory > registry , String processorTag ,
93
- Map <String , Object > config ) {
93
+ public CsvProcessor create (Map <String , Processor .Factory > registry , String processorTag ,
94
+ String description , Map <String , Object > config ) {
94
95
String field = ConfigurationUtils .readStringProperty (TYPE , processorTag , config , "field" );
95
96
String quote = ConfigurationUtils .readStringProperty (TYPE , processorTag , config , "quote" , "\" " );
96
97
if (quote .length () != 1 ) {
@@ -110,8 +111,8 @@ public CsvProcessor create(Map<String, org.elasticsearch.ingest.Processor.Factor
110
111
if (targetFields .isEmpty ()) {
111
112
throw newConfigurationException (TYPE , processorTag , "target_fields" , "target fields list can't be empty" );
112
113
}
113
- return new CsvProcessor (processorTag , field , targetFields .toArray (new String [0 ]), trim , separator . charAt ( 0 ), quote .charAt (0 ),
114
- ignoreMissing , emptyValue );
114
+ return new CsvProcessor (processorTag , description , field , targetFields .toArray (new String [0 ]), trim , separator .charAt (0 ),
115
+ quote . charAt ( 0 ), ignoreMissing , emptyValue );
115
116
}
116
117
}
117
118
}
0 commit comments