Note that there are some explanatory texts on larger screens.

plurals
  1. POMaking a Cassandra Connection inside Hadoop MapReduce Task
    primarykey
    data
    text
    <p>I am successfully using the <a href="https://github.com/datastax/java-driver" rel="nofollow">DataStax Java Driver</a> to access Cassandra inside my Java code just before I start a MapReduce Job. </p> <pre class="lang-java prettyprint-override"><code> cluster = Cluster.builder().addContactPoint("127.0.0.1").build(); </code></pre> <p>However I am needing to check additional information to decide on a per record basis how to reduce the record. If I attempt to use the same code inside a Hadoop Reducer class it fails to connect with the error:</p> <pre><code>INFO mapred.JobClient: Task Id : attempt_201310280851_0012_r_000000_1, Status : FAILED com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1 ([/127.0.0.1] Unexpected error during transport initialization (com.datastax.driver.core.TransportException: [/127.0.0.1] Error writing))) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:186) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:81) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:662) at com.datastax.driver.core.Cluster$Manager.access$100(Cluster.java:604) at com.datastax.driver.core.Cluster.&lt;init&gt;(Cluster.java:69) at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:96) at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:585) </code></pre> <p>The MapReduce input and output will successfully read and write to Cassandra. As I mentioned I can connect before I run the job so I do not think it is an issue with the Cassandra server.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload