Hi,
How are you using your extended sink?
The runtime context is provided to the UDF by the system when the job is executed.
So, for example, if you’re just testing out your UDF in unit tests, `getRuntimeContext` would return null (simply because it isn’t set). In such cases, you would need to inject a mock runtime context to perform the test.
Does this explain your case?
Cheers,
Gordon
On 17 April 2017 at 6:45:31 PM, sohimankotia ([hidden email]) wrote:
I have a class extending FlinkKafkaProducer010 . In Invoke method I am using
this.getRuntimeContext to increment flink counter .
But I am getting null value of RuntimeContext which is leading to
NullPointerException .
Using Flink 1.2
--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Why-I-am-getting-Null-pointer-exception-while-accessing-RuntimeContext-in-FlinkKafkaProducer010-tp12633.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.