public class FlatMapRunner extends RichFlatMapFunction<Row,Row> implements ResultTypeQueryable<Row>, Compiler<FlatMapFunction<Row,Row>>, Logging
Constructor and Description |
---|
FlatMapRunner(String name,
String code,
TypeInformation<Row> returnType) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Tear-down method for the user code.
|
void |
flatMap(Row in,
Collector<Row> out)
The core method of the FlatMapFunction.
|
TypeInformation<Row> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
void |
open(Configuration parameters)
Initialization method for the function.
|
TypeInformation<Row> |
returnType() |
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public FlatMapRunner(String name, String code, TypeInformation<Row> returnType)
public TypeInformation<Row> returnType()
public void open(Configuration parameters)
RichFunction
The configuration object passed to the function can be used for configuration and initialization. The configuration contains all parameters that were configured on the function in the program composition.
public class MyMapper extends FilterFunction<String> {
private String searchString;
public void open(Configuration parameters) {
this.searchString = parameters.getString("foo");
}
public boolean filter(String value) {
return value.equals(searchString);
}
}
By default, this method does nothing.
open
in interface RichFunction
open
in class AbstractRichFunction
parameters
- The configuration containing the parameters attached to the contract.Configuration
public void flatMap(Row in, Collector<Row> out)
FlatMapFunction
flatMap
in interface FlatMapFunction<Row,Row>
flatMap
in class RichFlatMapFunction<Row,Row>
in
- The input value.out
- The collector for returning result values.public TypeInformation<Row> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<Row>
public void close()
RichFunction
This method can be used for clean up work.
close
in interface RichFunction
close
in class AbstractRichFunction
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.