hi Kevin,

邮件里面贴不了图片,如果要贴图片,需要用一些第三方的图床工具。
或者你可以直接贴文字?

Kevin Liao <[email protected]> 于2020年1月9日周四 下午7:10写道:

> [image: B40C260D-DCC3-4B7D-A024-3839803C2234.png]
>
> Benchao Li <[email protected]> 于2020年1月9日周四 下午6:42写道:
>
>> hi Kevin,
>>
>> 能贴一下MyMapFunction2.java:39 这里的代码吗? 从上面的日志看不出来是valueState是null呢。
>>
>> Kevin Liao <[email protected]> 于2020年1月9日周四 下午5:57写道:
>>
>> > 早上发现任务异常,task 在不停重启,遂查看 jm 日志,最开始的报错是这样的
>> >
>> > ```
>> > 2020-01-09 05:14:04.087 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (3/6) (d0e6c4a05d0274c18a4a3df41ab5ff1b) switched from
>> > RUNNING to FAILED.
>> > java.lang.NullPointerException: null
>> > at com.sogou.qidian.MyMapFunction2.map(MyMapFunction2.java:39)
>> > at com.sogou.qidian.MyMapFunction2.map(MyMapFunction2.java:25)
>> > at
>> >
>> >
>> org.apache.flink.streaming.api.operators.StreamMap.processElement(StreamMap.java:41)
>> > at
>> > org.apache.flink.streaming.runtime.io
>> >
>> .StreamOneInputProcessor.processElement(StreamOneInputProcessor.java:164)
>> > at
>> > org.apache.flink.streaming.runtime.io
>> > .StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:143)
>> > at
>> >
>> >
>> org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:279)
>> > at
>> >
>> >
>> org.apache.flink.streaming.runtime.tasks.StreamTask.run(StreamTask.java:301)
>> > at
>> >
>> >
>> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:406)
>> > at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:705)
>> > at org.apache.flink.runtime.taskmanager.Task.run(Task.java:530)
>> > at java.lang.Thread.run(Thread.java:748)
>> > 2020-01-09 05:14:04.088 [flink-akka.actor.default-dispatcher-28] INFO
>> >  o.a.f.r.e.failover.flip1.RestartPipelinedRegionStrategy  - Calculating
>> > tasks to restart to recover the failed task
>> > 90bea66de1c231edf33913ecd54406c1_2.
>> > 2020-01-09 05:14:04.088 [flink-akka.actor.default-dispatcher-28] INFO
>> >  o.a.f.r.e.failover.flip1.RestartPipelinedRegionStrategy  - 12 tasks
>> should
>> > be restarted to recover the failed task
>> 90bea66de1c231edf33913ecd54406c1_2.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (6/6) (ac52050e60236cd1efcd262c8240cd25) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (5/6) (cf4ff0c189315b27e7e2178d8c60e49f) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (4/6) (8c8b07cb39a3f682f41f102e614765e6) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (3/6) (34aadddbffe9f61b1916bcd1427ced96) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (6/6) (de624cf5c9d4dec6fe68d4800c701457) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (4/6) (e52c1e70884a6599205f9e0f5b092bc0) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (5/6) (60496dddb4bc885ee37a6025662080ad) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.089 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (2/6) (bf8515b4f9e852182a5519102fe4fdf3) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.090 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (2/6) (bb14d5776c53babcc57edd65bf7159b0) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.090 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (1/6) (4c7cd6eaf5c3ca9c2b0db73e7d230a9e) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.090 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (1/6) (4a157d98db2f2efad72035af279433ff) switched from
>> > RUNNING to CANCELING.
>> > 2020-01-09 05:14:04.096 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (1/6) (4c7cd6eaf5c3ca9c2b0db73e7d230a9e) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.101 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (2/6) (bb14d5776c53babcc57edd65bf7159b0) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.103 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (5/6) (cf4ff0c189315b27e7e2178d8c60e49f) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.115 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (2/6) (bf8515b4f9e852182a5519102fe4fdf3) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.119 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (4/6) (e52c1e70884a6599205f9e0f5b092bc0) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.140 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (6/6) (de624cf5c9d4dec6fe68d4800c701457) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.140 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Discarding
>> the
>> > results produced by task execution de624cf5c9d4dec6fe68d4800c701457.
>> > 2020-01-09 05:14:04.141 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (6/6) (ac52050e60236cd1efcd262c8240cd25) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.141 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (5/6) (60496dddb4bc885ee37a6025662080ad) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.141 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Discarding
>> the
>> > results produced by task execution 60496dddb4bc885ee37a6025662080ad.
>> > 2020-01-09 05:14:04.142 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (4/6) (8c8b07cb39a3f682f41f102e614765e6) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.142 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (1/6) (4a157d98db2f2efad72035af279433ff) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.142 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Discarding
>> the
>> > results produced by task execution 4a157d98db2f2efad72035af279433ff.
>> > 2020-01-09 05:14:04.143 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (3/6) (34aadddbffe9f61b1916bcd1427ced96) switched from
>> > CANCELING to CANCELED.
>> > 2020-01-09 05:14:04.143 [flink-akka.actor.default-dispatcher-28] INFO
>> >  o.a.f.r.e.failover.AdaptedRestartPipelinedRegionStrategyNG  - Finally
>> > restart 12 tasks to recover from task failure.
>> > 2020-01-09 05:14:04.144 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.checkpoint.CheckpointCoordinator  - Restoring
>> job
>> > 7907d93e17fccf460069c2ca7f13d7e7 from latest valid checkpoint:
>> Checkpoint
>> > 720 @ 1578518011978 for 7907d93e17fccf460069c2ca7f13d7e7.
>> > 2020-01-09 05:14:04.145 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.checkpoint.CheckpointCoordinator  - No master
>> > state to restore
>> > 2020-01-09 05:14:04.145 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (2/6) (d83eee0b90a0e4a4dcff3e1ca6bed8b6) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.145 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (4/6) (da6e91a7475712da5ca52fc82069345f) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.145 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (1/6) (ffa3b56b4e1321aa5ec94e040921e223) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.145 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (3/6) (5c3fb959f79d53cdca506188ed40cc6d) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.146 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (5/6) (7a2252b0a18cd91211adae3ce3b613be) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.146 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (6/6) (6010486f42fc1e0e7c93623174bf0477) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.146 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (1/6) (eb06b4212d17f10cf4a8bcc812eaa073) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.146 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (2/6) (af4e3fc75729a2d035db42ec95e44189) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.146 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (3/6) (adb9b0aabe0234fe336211f5e44e18f3) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.146 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (4/6) (9ad2c9ee62ff804683284b0cdf571c99) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.146 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (6/6) (1e66dc5791940cf7e213b1b3cf8cf1fd) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (5/6) (4cb656b991141acbbe9e1033103ab470) switched from
>> > CREATED to SCHEDULED.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (2/6) (d83eee0b90a0e4a4dcff3e1ca6bed8b6) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> > Source: Custom Source -> Filter (2/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000003 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=15754)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (4/6) (da6e91a7475712da5ca52fc82069345f) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> > Source: Custom Source -> Filter (4/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000002 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=20658)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (1/6) (ffa3b56b4e1321aa5ec94e040921e223) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> > Source: Custom Source -> Filter (1/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000003 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=15754)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (3/6) (5c3fb959f79d53cdca506188ed40cc6d) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> > Source: Custom Source -> Filter (3/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000002 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=20658)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (5/6) (7a2252b0a18cd91211adae3ce3b613be) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> > Source: Custom Source -> Filter (5/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000003 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=15754)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (6/6) (6010486f42fc1e0e7c93623174bf0477) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> > Source: Custom Source -> Filter (6/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000002 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=20658)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (1/6) (eb06b4212d17f10cf4a8bcc812eaa073) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> Map ->
>> > Filter -> Sink: Unnamed (1/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000002 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=20658)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (2/6) (af4e3fc75729a2d035db42ec95e44189) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> Map ->
>> > Filter -> Sink: Unnamed (2/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000003 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=15754)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (3/6) (adb9b0aabe0234fe336211f5e44e18f3) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> Map ->
>> > Filter -> Sink: Unnamed (3/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000003 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=15754)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (4/6) (9ad2c9ee62ff804683284b0cdf571c99) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> Map ->
>> > Filter -> Sink: Unnamed (4/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000003 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=15754)
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (6/6) (1e66dc5791940cf7e213b1b3cf8cf1fd) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.147 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> Map ->
>> > Filter -> Sink: Unnamed (6/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000002 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=20658)
>> > 2020-01-09 05:14:04.148 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (5/6) (4cb656b991141acbbe9e1033103ab470) switched from
>> > SCHEDULED to DEPLOYING.
>> > 2020-01-09 05:14:04.148 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Deploying
>> Map ->
>> > Filter -> Sink: Unnamed (5/6) (attempt #2) to
>> > container_e06_1577354972821_672000_01_000002 @
>> > rsync.slave713.mars.hadoop.js.ted (dataPort=20658)
>> > 2020-01-09 05:14:04.159 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (1/6) (ffa3b56b4e1321aa5ec94e040921e223) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.160 [flink-akka.actor.default-dispatcher-28] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (2/6) (d83eee0b90a0e4a4dcff3e1ca6bed8b6) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.161 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (5/6) (7a2252b0a18cd91211adae3ce3b613be) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.168 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (4/6) (9ad2c9ee62ff804683284b0cdf571c99) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.169 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (4/6) (da6e91a7475712da5ca52fc82069345f) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.170 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (6/6) (6010486f42fc1e0e7c93623174bf0477) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.170 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (2/6) (af4e3fc75729a2d035db42ec95e44189) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.173 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (3/6) (adb9b0aabe0234fe336211f5e44e18f3) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.210 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Source:
>> Custom
>> > Source -> Filter (3/6) (5c3fb959f79d53cdca506188ed40cc6d) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.230 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (1/6) (eb06b4212d17f10cf4a8bcc812eaa073) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.231 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (6/6) (1e66dc5791940cf7e213b1b3cf8cf1fd) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.245 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (5/6) (4cb656b991141acbbe9e1033103ab470) switched from
>> > DEPLOYING to RUNNING.
>> > 2020-01-09 05:14:04.922 [flink-akka.actor.default-dispatcher-14] INFO
>> >  org.apache.flink.runtime.executiongraph.ExecutionGraph  - Map ->
>> Filter ->
>> > Sink: Unnamed (3/6) (adb9b0aabe0234fe336211f5e44e18f3) switched from
>> > RUNNING to FAILED.
>> > java.lang.NullPointerException: null
>> > at com.sogou.qidian.MyMapFunction2.map(MyMapFunction2.java:39)
>> > at com.sogou.qidian.MyMapFunction2.map(MyMapFunction2.java:25)
>> > at
>> >
>> >
>> org.apache.flink.streaming.api.operators.StreamMap.processElement(StreamMap.java:41)
>> > at
>> > org.apache.flink.streaming.runtime.io
>> >
>> .StreamOneInputProcessor.processElement(StreamOneInputProcessor.java:164)
>> > at
>> > org.apache.flink.streaming.runtime.io
>> > .StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:143)
>> > at
>> >
>> >
>> org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:279)
>> > at
>> >
>> >
>> org.apache.flink.streaming.runtime.tasks.StreamTask.run(StreamTask.java:301)
>> > at
>> >
>> >
>> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:406)
>> > at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:705)
>> > at org.apache.flink.runtime.taskmanager.Task.run(Task.java:530)
>> > at java.lang.Thread.run(Thread.java:748)
>> > ```
>> >
>> > 之后就是不停的循环,怪异的是 MyMapFunction2.java:39内容是
>> > ```
>> >
>> > if (null != uniqMark.value() && uniqMark.value()) {
>> >
>> > ```
>> >
>> > 而报错的时间点距离任务启动差不多就是 12 小时,符合我设置的 valueState 的 ttl
>> >
>> > ```
>> >
>> > @Override
>> > public void open(Configuration parameters) throws Exception {
>> >   ValueStateDescriptor<Boolean> descriptor = new
>> > ValueStateDescriptor<>("uniqMark",
>> >       TypeInformation.of(Boolean.class));
>> >   StateTtlConfig ttlConfig = StateTtlConfig.newBuilder(Time.hours(1))
>> >       .setUpdateType(UpdateType.OnCreateAndWrite)
>> >       .setStateVisibility(StateVisibility.ReturnExpiredIfNotCleanedUp)
>> >       .cleanupIncrementally(1000, false)
>> >       .build();
>> >   descriptor.enableTimeToLive(ttlConfig);
>> >   uniqMark = getRuntimeContext().getState(descriptor);
>> > }
>> >
>> > ```
>> >
>> > 所以我猜测在什么极端情况下会出现 valueState 自身变为 null 的情况么?(比如刚刚被清理的瞬间)?
>> >
>> > 求各位指正
>> >
>>
>>
>> --
>>
>> Benchao Li
>> School of Electronics Engineering and Computer Science, Peking University
>> Tel:+86-15650713730
>> Email: [email protected]; [email protected]
>>
>

-- 

Benchao Li
School of Electronics Engineering and Computer Science, Peking University
Tel:+86-15650713730
Email: [email protected]; [email protected]

回复