I am new to flink and trying to write some unit tests for a RichFunction.
This function wants to find configuration passed in via the open method in
order to set up a network client. I am using a stream harness for my test,
customised with my own MockEnvironment + Configuration. To my surprise, the
configuration is always empty. So I did some reading and debugging and came
across this:

https://github.com/apache/flink/blob/62786320eb555e36fe9fb82168fe97855dc54056/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractUdfStreamOperator.java#L100

Given that open is defined with no ability to pass in configuration in the
super class, it seems like there is no code path that ever injects anything
other than the empty configuration, which seems to render the configuration
completely useless. I am sure I have missed some other important part of
the api and would love some insight as to how to get my configuration
pushed down into my function. I note that the DataSet api has
withParameters, but afaict there is no such api for DataStream.

I haven't yet gone to production, but I am now worried that my entire plan
for configuration passing is completely suspect, and would love to hear
otherwise.

Ben

Reply via email to