-
-
Save bradfordcp/9a10fdb0588e00c3fc69716eb1edac68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UDTExampleFeed(cass: Cassandra, keyspace: String) extends AbstractContactFeed { | |
private def getTelecommunicationUDT = { | |
val telecommunication_type = cass.getCluster.getMetadata.getKeyspace(keyspace).getUserType("telecommunication") | |
val telecommunication = telecommunication_type.newValue() | |
val row = getTelecommunicationRow | |
row.foreach(p => telecommunication.setString(p._1, p._2)) | |
telecommunication | |
} | |
def getTelecommunicationsUDT = { | |
def telecommunicationsData = { | |
Map("telecommunications" -> (1 to 3).map(_ => { | |
getTelecommunicationUDT | |
}).filter(_ != false).foldLeft(Set[UDTValue]())((s, a) => s + a.asInstanceOf[UDTValue])) | |
} | |
Iterator.continually(telecommunicationsData) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment