Can't you use `transform` instead of `foreachRDD`?
> On 15.06.2016, at 15:18, Matthias Niehoff <matthias.nieh...@codecentric.de> > wrote: > > Hi, > > i want to subtract 2 DStreams (based on the same Input Stream) to get all > elements that exist in the original stream, but not in the modified stream > (the modified Stream is changed using joinWithCassandraTable which does an > inner join and because of this might remove entries). > > Subtract is only possible on RDDs. So I could use a foreachRDD right in the > beginning of the Stream processing and work on rdds. I think its quite ugly > to use the output op at the beginning and then implement a lot of > transformations in the foreachRDD. So could you think of different ways to do > an efficient diff between to DStreams? > > Thank you > > -- > Matthias Niehoff | IT-Consultant | Agile Software Factory | Consulting > codecentric AG | Zeppelinstr 2 | 76185 Karlsruhe | Deutschland > tel: +49 (0) 721.9595-681 <tel:%2B49%20%280%29%20721.9595-681> | fax: +49 (0) > 721.9595-666 <tel:%2B49%20%280%29%20721.9595-666> | mobil: +49 (0) > 172.1702676 <tel:%2B49%20%280%29%20172.1702676> > www.codecentric.de <http://www.codecentric.de/> | blog.codecentric.de > <http://blog.codecentric.de/> | www.meettheexperts.de > <http://www.meettheexperts.de/> | www.more4fi.de <http://www.more4fi.de/> > > Sitz der Gesellschaft: Solingen | HRB 25917| Amtsgericht Wuppertal > Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns > Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz > > Diese E-Mail einschließlich evtl. beigefügter Dateien enthält vertrauliche > und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige > Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie > bitte sofort den Absender und löschen Sie diese E-Mail und evtl. beigefügter > Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. > beigefügter Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht > gestattet