You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Ismaël Mejía (JIRA)" <ji...@apache.org> on 2019/01/14 16:46:00 UTC

[jira] [Assigned] (BEAM-6424) RabbitMqIO: NullPointerException raised on getWatermark() first call

     [ https://issues.apache.org/jira/browse/BEAM-6424?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ismaël Mejía reassigned BEAM-6424:
----------------------------------

    Assignee:     (was: Eugene Kirpichov)

> RabbitMqIO: NullPointerException raised on getWatermark() first call
> --------------------------------------------------------------------
>
>                 Key: BEAM-6424
>                 URL: https://issues.apache.org/jira/browse/BEAM-6424
>             Project: Beam
>          Issue Type: Bug
>          Components: io-ideas
>            Reporter: Augustin Lafanechere
>            Priority: Minor
>
> I tried to use the RabbitMqIO with the direct runner to generate an unbounded PCollection from a queue. I encounter a NPE :
> {quote}{{java.lang.NullPointerException}}
> {{ at org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.processElement (UnboundedReadEvaluatorFactory.java:169)}}
> {{....}}
> {quote}
> After investigation it looks like it's caused by the fact that no default is given to 
> checkpointMark.oldestTimestamp. getWatermark() is called before the mutation of the currentTimestamp variable, raising a NPE. I fixed the problem on my side, reimplementing the class and overriding getWatermark to return Instant.now()  if checkpointMark.oldestTimestamp is null :
> {quote}@Override
> publicInstantgetWatermark() {
>   if (checkpointMark.oldestTimestamp == null) {
>     returnInstant.now();
>   }
>   return checkpointMark.oldestTimestamp;
> }{quote}
> It looks likes this bug as [already been raised here|https://jira.apache.org/jira/browse/BEAM-1240?focusedCommentId=16566869&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16566869] on the PR for RabbitMqIO.
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)