Re: Read data from SparkStreaming from Java socket.

2014-12-14 Thread Guillermo Ortiz
Why doesn't it work?? I guess that it's the same with \n. 2014-12-13 12:56 GMT+01:00 Guillermo Ortiz konstt2...@gmail.com: I got it, thanks,, a silly question,, why if I do: out.write(hello + System.currentTimeMillis() + \n); it doesn't detect anything and if I do out.println(hello +

Re: Read data from SparkStreaming from Java socket.

2014-12-14 Thread Gerard Maas
Are you using a bufferedPrintWriter? that's probably a different flushing behaviour. Try doing out.flush() after out.write(...) and you will have the same result. This is Spark unrelated btw. -kr, Gerard.

Re: Read data from SparkStreaming from Java socket.

2014-12-14 Thread Guillermo Ortiz
Thanks. 2014-12-14 12:20 GMT+01:00 Gerard Maas gerard.m...@gmail.com: Are you using a bufferedPrintWriter? that's probably a different flushing behaviour. Try doing out.flush() after out.write(...) and you will have the same result. This is Spark unrelated btw. -kr, Gerard.

Re: Read data from SparkStreaming from Java socket.

2014-12-13 Thread Guillermo Ortiz
I got it, thanks,, a silly question,, why if I do: out.write(hello + System.currentTimeMillis() + \n); it doesn't detect anything and if I do out.println(hello + System.currentTimeMillis()); it works?? I'm doing with spark val errorLines = lines.filter(_.contains(hello)) 2014-12-13 8:12

Read data from SparkStreaming from Java socket.

2014-12-12 Thread Guillermo Ortiz
Hi, I'm a newbie with Spark,, I'm just trying to use SparkStreaming and filter some data sent with a Java Socket but it's not working... it works when I use ncat Why is it not working?? My sparkcode is just this: val sparkConf = new SparkConf().setMaster(local[2]).setAppName(Test) val

Re: Read data from SparkStreaming from Java socket.

2014-12-12 Thread Akhil Das
I have created a Serversocket program which you can find over here https://gist.github.com/akhld/4286df9ab0677a555087 It simply listens to the given port and when the client connects, it will send the contents of the given file. I'm attaching the executable jar also, you can run the jar as: java

Re: Read data from SparkStreaming from Java socket.

2014-12-12 Thread Guillermo Ortiz
I dont' understand what spark streaming socketTextStream is waiting... is it like a server so you just have to send data from a client?? or what's it excepting? 2014-12-12 14:19 GMT+01:00 Akhil Das ak...@sigmoidanalytics.com: I have created a Serversocket program which you can find over here

Re: Read data from SparkStreaming from Java socket.

2014-12-12 Thread Akhil Das
socketTextStream is Socket client which will read from a TCP ServerSocket. Thanks Best Regards On Fri, Dec 12, 2014 at 7:21 PM, Guillermo Ortiz konstt2...@gmail.com wrote: I dont' understand what spark streaming socketTextStream is waiting... is it like a server so you just have to send data

Re: Read data from SparkStreaming from Java socket.

2014-12-12 Thread Tathagata Das
Yes, socketTextStream starts a TCP client that tries to connect to a TCP server (localhost: in your case). If there is a server running on that port that can send data to connected TCP connections, then you will receive data in the stream. Did you check out the quick example in the streaming