Hi @Oytun Tez
It Looks like your PatternFlatSelectFunction is not serializable.
Because you use anonymous inner class, Check the class to which getPending 
belongs, maybe that class is not serializable?
Or you may be advised not to use internal classes, but to use a static internal 
class.

Best, JingsongLee


------------------------------------------------------------------
From:Oytun Tez <oy...@motaword.com>
Send Time:2019年4月19日(星期五) 03:38
To:user <user@flink.apache.org>
Subject:PatternFlatSelectAdapter - Serialization issue after 1.8 upgrade

Hi all,

We are just migration from 1.6 to 1.8. I encountered a serialization error 
which we didn't have before if memory serves: The implementation of the 
PatternFlatSelectAdapter is not serializable. The object probably contains or 
references non serializable fields.

The method below simply intakes a PatternStream from CEP.pattern() and makes 
use of the sideoutput for timed-out events. Can you see anything weird here 
(WorkerEvent is the input, but collectors collect Project object)?

protected DataStream<Project> getPending(PatternStream<WorkerEvent> 
patternStream) {
            OutputTag<Project> pendingProjectsTag = new 
OutputTag<Project>("invitation-pending-projects"){};

            return patternStream.flatSelect(
                    pendingProjectsTag,
                    new PatternFlatTimeoutFunction<WorkerEvent, Project>() {
                        @Override
                        public void timeout(Map<String, List<WorkerEvent>> map, 
long l, Collector<Project> collector) {
                        }
                    },
                    new PatternFlatSelectFunction<WorkerEvent, Project>() {
                        @Override
                        public void flatSelect(Map<String, List<WorkerEvent>> 
pattern, Collector<Project> collector) {
                        }
                    }
            ).name("Select pending projects for 
invitation").getSideOutput(pendingProjectsTag);
        }

---
Oytun Tez

M O T A W O R D
The World's Fastest Human Translation Platform.
oy...@motaword.com — www.motaword.com 

Reply via email to