Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data.foreachRDD { rdd =>
- rdd.foreachPartition { partitionedRecords =>
- val dao = new StreamDao(driver, url, user, password)
- partitionedRecords.foreach { row =>
- do dmthng
- }
- }
- }
- class StreamDao(driver: String, url: String, user: String, password: String) extends Serializable {
- ConnectionPool.singleton(url,user,password)
- def save(messages: MSG) = {
- using(DB(ConnectionPool.borrow())) { db =>
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement