title: Spark- Saving JavaRDD to Cassandra
body: <p>This <a href="http://www.datastax.com/dev/blog/accessing-cassandra-from-spark-in-java" rel="nofollow noreferrer">link</a> shows a way to save a <code>JavaRDD</code> to <code>Cassandra</code> in this way:</p>
  <pre><code>import static com.datastax.spark.connector.CassandraJavaUtil.*;
  
  JavaRDD&lt;Product&gt; productsRDD = sc.parallelize(products);
  javaFunctions(productsRDD, Product.class).saveToCassandra(&quot;java_api&quot;, &quot;products&quot;);
  </code></pre>
  <p>But the <code>com.datastax.spark.connector.CassandraJavaUtil.*</code> seems deprecated. The updated API should be:</p>
  <pre><code>import static com.datastax.spark.connector.japi.CassandraJavaUtil.*;
  </code></pre>
  <p>Can someone show me some codes to store a <code>JavaRDD</code> to <code>Cassandra</code> using the updated API above?</p>