spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvlpr <>
Subject Custom receiver to connect MySQL database
Date Tue, 14 Jun 2016 07:29:09 GMT
Hi folks,
I have written some codes for custom receiver to get data from MySQL db.
Belowed code:

class CustomReceiver(url: String, username: String, password: String)
extends Receiver[String](StorageLevel.MEMORY_AND_DISK_2) with Logging {

 case class customer(c_sk: Int, c_add_sk: Int, c_first: String)
  def onStart() {
    // Start the thread that receives data over a connection
    new Thread("MySQL Receiver") {
      override def run() { receive() }

  def onStop() {
   // There is nothing much to do as the thread calling receive()
   // is designed to stop by itself isStopped() returns false

  private def receive() {
    val con = DriverManager.getConnection(url, username, password)

while executing this code i am getting an error: Exception in thread "main"
java.lang.IllegalArgumentException: requirement failed: No output operations
registered, so nothing to execute

Please help me to solve my problem ? 

View this message in context:
Sent from the Apache Spark Developers List mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message