Note that there are some explanatory texts on larger screens.

plurals
  1. POError while trying to connect to cassandra through hector API
    primarykey
    data
    text
    <p>I have written java code for reading records from cassandra. But it is giving run-time error.. Here is java code:- </p> <pre><code>import javax.naming.spi.DirStateFactory.Result; import me.prettyprint.cassandra.serializers.StringSerializer; import me.prettyprint.hector.api.*; import me.prettyprint.hector.api.Cluster; import me.prettyprint.hector.api.Keyspace; import me.prettyprint.hector.api.beans.HColumn; import me.prettyprint.hector.api.factory.HFactory; import me.prettyprint.hector.api.mutation.Mutator; import me.prettyprint.hector.api.query.ColumnQuery; import me.prettyprint.hector.api.query.QueryResult; public class HectorConnect { public static void main(String args[]){ try{ Cluster c = HFactory.getOrCreateCluster("Test", "localhost:9160"); Keyspace ko = HFactory.createKeyspace("myspace", c); StringSerializer se = StringSerializer.get(); ColumnQuery&lt;String, String&gt; q = HFactory.createColumnQuery(ko, se, se); QueryResult&lt;HColumn&lt;String, String&gt;&gt; r = q.setKey("cara"). setName("customername"). setColumnFamily("customer"). execute(); } catch(Exception e){ e.printStackTrace(); } } } </code></pre> <p>and error it throws is as folows:-</p> <p>log4j:WARN No appenders could be found for logger (me.prettyprint.cassandra.service.CassandraClientPoolFactory). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Cassandra$Client.describe_keyspaces()Ljava/util/Set; at me.prettyprint.cassandra.service.CassandraClientImpl.getKeyspaces(CassandraClientImpl.java:141) at me.prettyprint.cassandra.service.CassandraClientImpl.getKeyspace(CassandraClientImpl.java:114) at me.prettyprint.cassandra.service.CassandraClientImpl.getKeyspace(CassandraClientImpl.java:104) at me.prettyprint.cassandra.model.ExecutingKeyspace.doExecute(ExecutingKeyspace.java:57) at me.prettyprint.cassandra.model.thrift.ThriftColumnQuery.execute(ThriftColumnQuery.java:34) at HectorConnect.main(HectorConnect.java:30)</p> <p>Anyone knows solution to this?? </p>
    singulars
    1. This table or related slice is empty.
    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.
 

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