You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Mateusz Zakarczemny (JIRA)" <ji...@apache.org> on 2017/04/12 14:36:41 UTC

[jira] [Commented] (FLINK-1539) Runtime context not initialized when running streaming PojoExample

    [ https://issues.apache.org/jira/browse/FLINK-1539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15965967#comment-15965967 ] 

Mateusz Zakarczemny commented on FLINK-1539:
--------------------------------------------

[~gyfora] [~mbalassi]
It is not fixed.
I'm trying to implement custom RichOutputFormat with metrics. When I'm invoking
{code}getRuntimeContext.getMetricGroup{code}
RichOutputFormat throws exception. As I understand getRuntimeContext is part of public api. Therefore I should get valid result or at least some mocked object in local execution. Right now I have to catch IllegalStateException which could hide other errors.

> Runtime context not initialized when running streaming PojoExample
> ------------------------------------------------------------------
>
>                 Key: FLINK-1539
>                 URL: https://issues.apache.org/jira/browse/FLINK-1539
>             Project: Flink
>          Issue Type: Bug
>          Components: Streaming
>    Affects Versions: 0.9
>            Reporter: Márton Balassi
>            Assignee: Gyula Fora
>
> When running streaming PojoExample received the following exception:
> Exception in thread "main" java.lang.IllegalStateException: The runtime context has not been initialized.
> 	at org.apache.flink.api.common.functions.AbstractRichFunction.getRuntimeContext(AbstractRichFunction.java:49)
> 	at org.apache.flink.streaming.api.function.aggregation.SumAggregator$PojoSumAggregator.<init>(SumAggregator.java:149)
> 	at org.apache.flink.streaming.api.function.aggregation.SumAggregator.getSumFunction(SumAggregator.java:52)
> 	at org.apache.flink.streaming.api.datastream.DataStream.sum(DataStream.java:632)
> 	at org.apache.flink.streaming.examples.wordcount.PojoExample.main(PojoExample.java:65)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:483)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)