Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save therako/f28ba3658a9ffecb956a73492b98660c to your computer and use it in GitHub Desktop.
Save therako/f28ba3658a9ffecb956a73492b98660c to your computer and use it in GitHub Desktop.
def flushSSTableToCassandra(cassHosts: String, dir: String): Unit = {
val conf=new Configuration()
val shuffledCassHosts=Random.shuffle(cassHosts.split(",").toList)
val selectedCassHost=shuffledCassHosts.head
conf.set("cassandra.output.thrift.address", selectedCassHost)
new SSTableLoader(new File(dir), new ExternalClient(conf), new OutputHandler.LogOutput).stream().get()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment