Spark- Saving JavaRDD to Cassandra -
http://www.datastax.com/dev/blog/accessing-cassandra-from-spark-in-java
the link above shows way save javardd
cassandra
in way:
import static com.datastax.spark.connector.cassandrajavautil.*; javardd<product> productsrdd = sc.parallelize(products); javafunctions(productsrdd, product.class).savetocassandra("java_api", "products");
but com.datastax.spark.connector.cassandrajavautil.*
seems deprecated. updated api should be:
import static com.datastax.spark.connector.japi.cassandrajavautil.*;
can show me codes store javardd
cassandra
using updated api above?
following documentation, should this:
javafunctions(rdd).writerbuilder("ks", "people", maptorow(person.class)).savetocassandra();
Comments
Post a Comment