You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by eric perler <er...@hotmail.com> on 2014/04/01 16:54:43 UTC

custom receiver in java

i would like to write a custom receiver to receive data from a Tibco RV subject
i found this scala example..
http://spark.incubator.apache.org/docs/0.8.0/streaming-custom-receivers.html
but i cant seem to find a java example
does anybody know of a good java example for creating a custom receiver
thx 		 	   		  

Re: custom receiver in java

Posted by Tathagata Das <ta...@gmail.com>.
Yes, thanks updating this old thread! We heard our community demands and
added support for Java receivers!

TD


On Wed, Jun 4, 2014 at 12:15 PM, lbustelo <gi...@bustelos.com> wrote:

> Not that what TD was referring above, is already in 1.0.0
>
> http://spark.apache.org/docs/1.0.0/streaming-custom-receivers.html
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/custom-receiver-in-java-tp3575p6962.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>

Re: custom receiver in java

Posted by lbustelo <gi...@bustelos.com>.
Not that what TD was referring above, is already in 1.0.0

http://spark.apache.org/docs/1.0.0/streaming-custom-receivers.html



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

Re: custom receiver in java

Posted by Tathagata Das <ta...@gmail.com>.
Unfortunately, there isnt a good Java-friendly way to define custom
receivers. However, I am currently refactoring the receiver interface to
make it more Java friendly and I hope to get that in Spark 1.0 release.

In the meantime, I would encourage you define the custom receiver in Scala.
If you are not comfortable with Scala, we can write all the core
functionality in Java as functions, and create a skeleton Scala custom
receiver that calls into the Java functions (shown below). Unfortunately,
you have to use scala compiler to compile this.

TD

-----------------------
      class CustomReceiver(parameters: CustomReceiverParameters)
         extends NetworkReceiver[*<type of records>*]
       {
         protected lazy val blocksGenerator: BlockGenerator =
           new BlockGenerator(StorageLevel.MEMORY_ONLY_SER_2)
*         val javaReceiver = new MyJavaReceiver(parameters, blockGenerator)
 // create an instance of java receiver object*

         protected def onStart() = {
           blocksGenerator.start()
*           javaReceiver.start()   // start the java receiver*
         }

         protected def onStop() {
           blocksGenerator.stop()
*           javaReceiver.stop()*
         }
       }




On Tue, Apr 1, 2014 at 7:54 AM, eric perler <er...@hotmail.com> wrote:

> i would like to write a custom receiver to receive data from a Tibco RV
> subject
>
> i found this scala example..
>
>
> http://spark.incubator.apache.org/docs/0.8.0/streaming-custom-receivers.html
>
> but i cant seem to find a java example
>
> does anybody know of a good java example for creating a custom receiver
>
> thx
>