apex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vlad Rozov <v.ro...@datatorrent.com>
Subject Re: Information Needed
Date Tue, 02 Aug 2016 20:26:14 GMT
Both setup() and beginWindow() should work. It will be more correct to 
open the configuration stream and parse the configuration file in 
setup() as you tried in the initial implementation as long as 
configuration path does not depend on window Id. Where the 
inputConfStream is used? Most likely it reaches EOF unexpectedly.

Vlad


On 8/2/16 12:19, Mukkamula, Suryavamshivardhan (CWM-NR) wrote:
> Hi Team,
> When I am trying to read input line from feed, to parse the line I am 
> reading another configuration file from HDFS. To avoid reading the 
> configuration file for every line I would like to read it in the 
> beginWindow() method. But the Input stream is getting closed and 
> operator is not holding the stream for all the tuples.
> Can I read the input Stream Once for all the tuples? (I tried in the 
> setup() method as well , but no luck)
> @Override
>           public void beginWindow(long windowId)
>           {
>                 super.beginWindow(windowId);
>                 try {
>                         inputConfStream = getFS().open(new 
> Path(getInputConfFile()));
>                                         } catch (Exception e) {
>                         // TODO Auto-generated catch block
>                         e.printStackTrace();
>                         LOG.error("beginWindow: Error while streaming 
> the input Configuration File = {}", getInputConfFile());
>                 }
>           }
> Regards,
> Surya Vamshi
>
> _______________________________________________________________________
>
> If you received this email in error, please advise the sender (by 
> return email or otherwise) immediately. You have consented to receive 
> the attached electronically at the above-noted email address; please 
> retain a copy of this confirmation for future reference.
>
> Si vous recevez ce courriel par erreur, veuillez en aviser 
> l'expéditeur immédiatement, par retour de courriel ou par un autre 
> moyen. Vous avez accepté de recevoir le(s) document(s) ci-joint(s) par 
> voie électronique à l'adresse courriel indiquée ci-dessus; veuillez 
> conserver une copie de cette confirmation pour les fins de reference 
> future.
>


Mime
View raw message