Hi Hung, could you maybe post a more complete snippet of your program? This would allow me to figure out why the output changes between versions 0.10 and 1.0.
@Matthias: The signature was changed to also allow window functions that don’t take an Iterable. For example, when doing WindowedStream.apply(ReduceFunction, WindowFunction) the window function only gets a single element. Before, this would be a single element inside an Iterable. Now the fact that it gets a single element is reflected in the signature. > On 25 Feb 2016, at 14:47, Matthias J. Sax <mj...@apache.org> wrote: > > Just out of curiosity: Why was it changes like this. Specifying > "Iterable<...>" as type in AllWindowFunction seems rather unintuitive... > > -Matthias > > On 02/25/2016 01:58 PM, Aljoscha Krettek wrote: >> Hi, >> yes that is true. The way you would now write such a function is this: >> >> private static class MyIterableFunction implements >> AllWindowFunction<Iterable<Tuple2<String, Integer>>, Tuple2<String, >> Integer>, TimeWindow> { >> private static final long serialVersionUID = 1L; >> >> @Override >> public void apply( >> TimeWindow window, >> Iterable<Tuple2<String, Integer>> values, >> Collector<Tuple2<String, Integer>> out) throws Exception { >> >> } >> } >> >> (I used Tuple2<String, Integer> as an example input type here.) >> >> and then you can use it with AllWindowedStream.apply(new >> MyIterableFunction()); >> >> >>> On 25 Feb 2016, at 13:29, HungChang <unicorn.bana...@gmail.com> wrote: >>> >>> Thank you for your reply. >>> >>> The following in the current master looks like not iterable? because the >>> parameter is IN rather than Iterable<IN> >>> So I still have problem to iterate,,, >>> >>> @Public >>> public interface AllWindowFunction<IN, OUT, W extends Window> extends >>> Function, Serializable { >>> >>> /** >>> * Evaluates the window and outputs none or several elements. >>> * >>> * @param window The window that is being evaluated. >>> * @param values The elements in the window being evaluated. >>> * @param out A collector for emitting elements. >>> * >>> * @throws Exception The function may throw exceptions to fail the >>> program >>> and trigger recovery. >>> */ >>> void apply(W window, IN values, Collector<OUT> out) throws Exception; >>> } >>> >>> https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/windowing/AllWindowFunction.java >>> >>> Best, >>> >>> Hung >>> >>> >>> >>> -- >>> View this message in context: >>> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/The-way-to-itearte-instances-in-AllWindowFunction-in-current-Master-branch-tp5137p5145.html >>> Sent from the Apache Flink User Mailing List archive. mailing list archive >>> at Nabble.com. >> >