Re: feature request: broadcast POJO objects as part of runtime context
Posted by
Stephan Ewen on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/feature-request-broadcast-POJO-objects-as-part-of-runtime-context-tp367p371.html
Hi!
I hope I understand correctly what you are trying to do: To have a config file available in the functions, you can simply do wither of the following:
-----------------------
Closure
-----------------------
Configuration conf = ...
data.map(new RichMapFunction<String, Integer>() {
public void open (Conficuration c) {
// access the conf object here
conf.getString(...);
}
public Integer map(String value) {
// whatever
}
});
-----------------------
-----------------------
Config Parameters
-----------------------
Configuration conf = ...
data.map(new RichMapFunction<String, Integer>() {
public void open (Conficuration c) {
// access the c - it will will have all elements of the conf - see withParameters() below
c.getString(...);
}
public Integer map(String value) {
// whatever
}
})
.withParameters(conf);
-----------------------
Stephan