Re: Join streams Apache Spark

2017-05-09 Thread tencas
Hi scorpio,

 thanks for your reply. 
I don't understand your approach. Is it possible to receive data from
different clients throught the same port on Spark?

Surely I'm confused and I'd appreciate your opinion.

Regarding the word count example , from Spark Streaming documentation, Spark
acts as a client that connects to a remote server, in order te receive data:

/// Create a DStream that will connect to hostname:port, like localhost:
JavaReceiverInputDStream lines = jssc.socketTextStream("localhost",
);/

Then, you create a dummy server using nc receive connections request from
spark, and to send data:

/nc -lk /

So, regarding this implementation, as spark is playing the role of tcp
client. you'd need to manage the join of external sensors streams (by the
way, all with the same schema) in your own server.
How would you be able to make Spark acts as a "sink" that can receive
different sources stream throught the same port??








--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28670.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

-
To unsubscribe e-mail: user-unsubscr...@spark.apache.org



Re: Join streams Apache Spark

2017-05-08 Thread saulshanabrook
I, actually, just ran it in a Docker image. But the point is, it doesn't
need to run in the JVM, because it just runs as a separate process. Then
your Java (or any other client) code sends messages to it over TCP and it
relays them to Spark.

On Mon, May 8, 2017 at 4:07 AM tencas [via Apache Spark User List] <
ml+s1001560n28662...@n3.nabble.com> wrote:

> Yep, I mean the first script you posted. So, you can compile it to Java
> binaries for example ? Ok, I have no idea about Go.
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28662.html
> To unsubscribe from Join streams Apache Spark, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28665.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

Re: Join streams Apache Spark

2017-05-08 Thread tencas
Yep, I mean the first script you posted. So, you can compile it to Java
binaries for example ? Ok, I have no idea about Go.



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28662.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

-
To unsubscribe e-mail: user-unsubscr...@spark.apache.org



Re: Join streams Apache Spark

2017-05-07 Thread Gourav Sengupta
On another note, you might want to first try Flume in case you are just at
exploration phase. The advantage of Flume (using push) is that you do not
need to write any additional program in order to sink or write your data to
any target system. I am not quite sure how well Flume works with SPARK
streaming (theoretically it should)

On other hand Kafka and its integration with SPARK is mentioned here
https://docs.databricks.com/spark/latest/structured-streaming/kafka.html


Regards,
Gourav Sengupta

On Sat, Apr 15, 2017 at 9:12 PM, tencas  wrote:

> Hi everybody,
>
>  I am using Apache Spark Streaming using a TCP connector to receive data.
> I have a python application that connects to a sensor, and create a TCP
> server that waits connection from Apache Spark, and then, sends json data
> through this socket.
>
> How can I manage to join many independent sensors sources to send data to
> the same receiver on Apache Spark?
>
> Thanks.
>
>
>
> --
> View this message in context: http://apache-spark-user-list.
> 1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> -
> To unsubscribe e-mail: user-unsubscr...@spark.apache.org
>
>


Re: Join streams Apache Spark

2017-05-07 Thread saulshanabrook
The script I wrote in Go? No I do not, but it's very easy to compile it to
whatever platform you are running on! Doesn't need to be integrated in the
same language as the rest of your code.

On Sat, May 6, 2017 at 3:13 PM tencas [via Apache Spark User List] <
ml+s1001560n28658...@n3.nabble.com> wrote:

> There exists an Spark Streaming example of the classic word count, using
> apache kafka connector:
>
>
> https://github.com/apache/spark/blob/master/examples/src/main/java/org/apache/spark/examples/streaming/JavaKafkaWordCount.java
>
> (maybe you already know)
>
> The point is, what are the benefits from using Kafka, instead of a lighter
> solution like yours. Maybe anybody could help us. Anyway, when I try it
> out, I'll give you feedback.
>
> On the other hand, have you got ,by any chance, the same script written on
> Scala, Phyton or Java ?
>
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28658.html
> To unsubscribe from Join streams Apache Spark, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28659.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

Re: Join streams Apache Spark

2017-05-06 Thread tencas
There exists an Spark Streaming example of the classic word count, using
apache kafka connector:

https://github.com/apache/spark/blob/master/examples/src/main/java/org/apache/spark/examples/streaming/JavaKafkaWordCount.java

(maybe you already know)

The point is, what are the benefits from using Kafka, instead of a lighter
solution like yours. Maybe anybody could help us. Anyway, when I try it out,
I'll give you feedback.

On the other hand, have you got ,by any chance, the same script written on
Scala, Phyton or Java ?





--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28658.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

-
To unsubscribe e-mail: user-unsubscr...@spark.apache.org



Re: Join streams Apache Spark

2017-05-06 Thread saulshanabrook
Would love to hear if you try it out. I was also considering that. I
recently changed to using the file based streaming input. I made another Go
script

that let's me connect over TCP and writes each newline it receives to a new
file in a folder. Then Spark can read them from that folder.

On Sat, May 6, 2017 at 2:38 PM tencas [via Apache Spark User List] <
ml+s1001560n2865...@n3.nabble.com> wrote:

> Thanks @saulshanabrook, I'll have a look at it.
>
> I think apache kafka could be an alternative solution, but I haven't
> checked it yet.
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28656.html
> To unsubscribe from Join streams Apache Spark, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28657.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

Re: Join streams Apache Spark

2017-05-06 Thread tencas
Thanks @saulshanabrook, I'll have a look at it.

I think apache kafka could be an alternative solution, but I haven't checked
it yet.



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28656.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

-
To unsubscribe e-mail: user-unsubscr...@spark.apache.org



Re: Join streams Apache Spark

2017-05-06 Thread saulshanabrook
I  wrote a server in Go
  
that allows many TCP connections for incoming data on one port, writing each
line to the client listening on another port. The  environmental variable
set's what port client's should connect to, to send data to Spark (the
sensors in your case) and the  sets the port that Spark should connect to,
to listen for data.

If anyone knows a simpler way of doing this, by using some existing
software, I would love to know about it.

If you are interested in this code, I would be happy to clean it up and
release it with some documentation.



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Join-streams-Apache-Spark-tp28603p28655.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

-
To unsubscribe e-mail: user-unsubscr...@spark.apache.org