Skip to content
Advertisement

Tag: apache-flink

javadoc of SingleOutputStreamOperator#returns(TypeHint typeHint) method

I am reading the source code of SingleOutputStreamOperator#returns, its javadoc is: It mentions FunctionWithNonInferrableReturnType to show case the necessity of returns method, but I am unable to write such a class that is NonInferrableReturnType. Could you please help write a simple one? Thanks! Answer When the docs says NonInferrableReturnType it means that we can use the type variable <T>, or

Flink ElasticsearchSinkFunction not serializable in non-static method, but serializable in static method

I have a piece of code that only works inside static methods. If I put the code in a static method, then call it from a non-static method, it works. Never heard of anything like this and couldn’t find information online on it. This works: This doesn’t work: (Full) stack trace: The implementation of the provided ElasticsearchSinkFunction is not serializable.

Flink, rule of using ‘object reuse mode’

Doc says this mode can cause bugs, but it does not tell me the rule of using this mode, in what case it will cause bugs? Let’s say I have a job, source: kafka (byte[] data), flat-map: parse byte[] to Google Protobuf object ‘foo’, create a Tuple2<>(foo.id, foo), and return this tuple2 keyby and process: for each id, put the

Advertisement