I'm trying to use the Datastax driver cassandra-driver-core-3.0.0.jar with the Squirrel SQL client.
The problem is that I don't know what to put in the class name field. Does anyone know? Or does anyone know how I would figure it out?
I think it's probably something like com.datastax.driver.core.___ but I can't get that last piece.
I'm not sure that you can. I think the Datastax driver allows connections from Java but is not JDBC compliant, as there is no class in the com.datastax.driver.core package that implements java.sql.Driver. If there were, this would be the class to use in SQuirreL.
Related
In datastax 3.x there used to be mappingManager. We used it to get different mappers using com.datastax.driver.mapping.MappingManager.
Can someone help me, What can I use in datastax 4.x.
In order to configure kundera for Cassandra, I notice there are 3 possible options for kundera.client.lookup.class as below
com.impetus.client.cassandra.pelops.PelopsClientFactory
com.impetus.kundera.client.cassandra.dsdriver.DSClientFactory
com.impetus.client.cassandra.thrift.ThriftClientFactory
I am not sure of the Pros and Cons of the above 3 and hence not sure which one to use. Please help me decide
I suggest you to use com.impetus.client.cassandra.thrift.ThriftClientFactory. It is the implementation using just Cassandra's thrift api.
PelopsClient is not in active development.
DSClient is built over datastax driver of cassandra.
There is no real advantage of using either DSClient or ThriftClient.
After further research, I found the following
Don't use PelopsClient as its not in active development as mentioned by #karthik , but more importantly because of the issue reported here
Data Stax Driver is better than thrift client as it over comes few limitations of thrift and they use a different binary protocol specific to cassandra which gives a better performance. Refer Datastax java driver support for Cassandra using Kundera
I am looking for a java API which can handle collections in Cassandra. Which has methods to read/update/insert/delete collections like list/set/map in a column value. I am using Hector client now, I did not find any methods which could perform the above requirement. The API should be able to handle mixed column types (like one column value can be utf8 and other can be collection). Any example or tutorial will be appreciated as well.
C* collections are part of the CQL spec v.3. The only Java driver, that I'm aware of, supporting this spec completely is the open source DataStax Java driver. The driver offers 2 ways of working with CQL statements: one based on Statements/PreparedStatements/etc. and one using a fluent API.
If you are using Cassandra 1.2.x then look for the version 1.x of the driver. In case you are on Cassandra 2.0.x look for the version 2.0 of the driver (this is currently RC2, soon to go final).
I'm currently starting a project that use Cassandra Apache. So I'm interesting in accessing to my database cassandra from Java. For that, I'm using Hector Cassandra. However, I've some doubts about what's the differences between the access via Hector or JDBC Cassandra (specifically this: https://code.google.com/a/apache-extras.org/p/cassandra-jdbc/).
I believe the following (although I not sure if I'm right):
one difference between both could be that are API of different level (I consider that Hector Cassandra is an API of higher-level than JDBC Cassandra)?
in JDBC Cassandra is used CQL for accessing/modifying the database, while Hector Cassandra don't use CQL (only use the methods provided for that).
I'll be thankful if someone can help me and tell me if I'm right/wrong in the previous lines and more differences between both (Hector and JDBC Cassandra).
Thank in advance!
Official Cassandra Java Driver (https://github.com/datastax/java-driver) is probably the best (IMHO, the only) choice for a new project for several reasons:
New features
All other Cassandra clients (Hector, Astyanax, etc) are based on legacy Thrift RPC protocol. RPC "One response per one request" model has severe limitations, for example it doesn't allow processing several requests at the same time in a single connection or streaming large ResultSets.
So, DataStax developed a new protocol that doesn't have RPC limitations. Thrift API won't be getting new features, it's only kept for backward-compatibility. In contrast, Java Driver is actively developed to incorporate the new features of Cassandra 2.0, like conditional updates, batching prepared statements, etc. The overview of new features is here: http://www.datastax.com/dev/blog/cql-in-cassandra-2-0
Convenience
In early Cassandra days (0.7) in our company we have used in-house low-level Thrift client. Later on we have used Hector, Pelops and Astyanax in various projects. I can say that the clients based on Java Driver look the most simple and clean to me.
Performance
We have made some performance testing of Cassandra Java Driver vs other clients. In most scenarios the performance is roughly the same. However, there are certain situations when Cassandra Java Driver significantly outperforms other clients due to its asynchronous nature.
Btw, there's a couple of related questions with excellent answers:
Advantages of using cql over thrift
Cassandra Client Java API's
EDIT: When I wrote this, I wasn't aware that Achilles (https://github.com/doanduyhai/Achilles) mentioned in another answer has CQL implementation that works via Java Driver. For the same of completeness I must say that Achilles' DAO on top of CQL might be (or might became one day) viable alternative to plain CQL via Java Driver.
#mol
Why do you restrict to Hector and cassandra-jdbc if you're starting a new project ?
There are many other interesting choices:
Astyanax as Martin mentioned (Thrift & CQL3)
FireBrand (Thrift via Hector)
Achilles I've just developed (CQL3 & Cassandra 2.0 via Java driver core)
Java Driver Core for plain CQL3
Hector is indeed a higher-level API. Internally it will use Cassandra's Thrift API to execute its functions. It will not convert them to equivalent CQL calls. But its API also provides access to CQL. In this case it will pass the CQL (via Thrift) to Cassandra's APIs for CQL.
CQL in Cassandra is a SQL-like language that works via the Cassandra APIs. So it does not provide any additional capability in the use of Cassandra than the APIs but does make it easier at times to use. If you are considering using Hector I would also look at Astyanax which is a newer take on a high-level Java API to Cassandra.
Since you are starting a new project, it is best to start with CQL as Java native driver:
http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#common/drivers/introduction/introArchOverview_c.html
Per DataStax, it is 10-15% faster than Thrift APIs, as it uses Binary Protocol.
I'm considering to use JDBC-compliant driver with JDO to connecto to Cassandra. Is this possible and is this going to cause huge overhead? I was looking astyanax made by Netflix, and it looks good, but it is not easy as JDO seems to be.
If using a JDBC driver you need to write an RDBMS adapter class for Cassandra to communicate with it (see the DN docs).
Alternatively use a Cassandra plugin for DataNucleus https://github.com/pulasthi/Datanucleus-Cassandra-Plugin
Note that this plugin was not provided by the DataNucleus project (so some things in it may be non-optimal due the people concerned not necessarily understanding how a store plugin ought to be written) and only works for DataNucleus v2.x.
Update [Jan 2014] : there is now an official DataNucleus Cassandra plugin under development, already providing many things, and using CQL3
The Cassandra CQL JDBC driver is located at http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/