public class MapRunner<IN,OUT> extends RichMapFunction<IN,OUT> implements ResultTypeQueryable<OUT>, FunctionCompiler<MapFunction<IN,OUT>>
Constructor and Description |
---|
MapRunner(String name,
String code,
TypeInformation<OUT> returnType) |
Modifier and Type | Method and Description |
---|---|
TypeInformation<OUT> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
org.slf4j.Logger |
LOG() |
OUT |
map(IN in)
The mapping method.
|
void |
open(Configuration parameters)
Initialization method for the function.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compile
public MapRunner(String name, String code, TypeInformation<OUT> returnType)
public org.slf4j.Logger LOG()
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 OUT map(IN in)
MapFunction
map
in interface MapFunction<IN,OUT>
map
in class RichMapFunction<IN,OUT>
in
- The input value.public TypeInformation<OUT> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<OUT>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.