Advertisement
Guest User

Untitled

a guest
Nov 9th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.48 KB | None | 0 0
  1.    data.foreachRDD { rdd =>
  2.       rdd.foreachPartition { partitionedRecords =>
  3.         val dao = new StreamDao(driver, url, user, password)  
  4.         partitionedRecords.foreach { row =>
  5.         do dmthng
  6.           }
  7.         }
  8.       }
  9. class StreamDao(driver: String, url: String, user: String, password: String) extends Serializable {
  10.   ConnectionPool.singleton(url,user,password)
  11.   def save(messages: MSG) = {
  12.     using(DB(ConnectionPool.borrow())) { db =>
  13.       }
  14.     }
  15.  
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement