Originally I had:
public static void main(String[] args) {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
…
This was nice because this would work just as well in my kubernetes deployment as it did when I just ran the main directly.
However there’s no way to set configuration in the case where the local environment is selected (when I run main directly).
I am currently writing:
Configuration conf = new Configuration();
conf.setString("metrics.reporter.jmx.class","org.apache.flink.metrics.jmx.JMXReporter");
conf.setString("metrics.reporter.jmx.port","8789");
StreamExecutionEnvironment env = LocalStreamEnvironment.createLocalEnvironment(8, conf);
This is fair enough for experimentation I suppose. It just a shame that the second bit of code is specific to the local environment.
However, I was thinking of using the JMXReporter in performance tests, so it would be nice to find a general solution to this.
Perhaps I will just parameterise all my Pipeline classes by StreamExecutionEvironment i.e.
// constructor
public FooPipeline(StreamExecutionEnvironment env) {
}
And drop in the standard environment or the test environment as appropriate. This is simple enough but I was just emailing this list because at first (before I started experimenting with metrics) it seemed that this wouldn’t be necessary.
Thanks,
Frank
What's the best way to enable the JMX Reporter while I am developing an applicaiton in an IDE? The reason is I would like to experiment with adding detailed metrics to my pipelines (and also see what standard operators provide) without having to deploy to a regular cluster.
Thanks,
Frank