Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Datastax java driver #385

Closed
mevivs opened this issue Sep 10, 2013 · 22 comments
Closed

Support for Datastax java driver #385

mevivs opened this issue Sep 10, 2013 · 22 comments
Assignees
Milestone

Comments

@mevivs
Copy link
Collaborator

mevivs commented Sep 10, 2013

Analyze and see if this is feasible to provide Datastax java driver support.

@pires
Copy link
Contributor

pires commented Sep 25, 2013

+1

@kadiyams
Copy link

Hello, I have recently worked on the Datastax Java driver. Can I work on this enhancement.

@mevivs
Copy link
Collaborator Author

mevivs commented Oct 17, 2013

@kadiyams
👍

Please let us know, if case we need to discuss something during implementation.

-Vivek

@kadiyams
Copy link

Thanks Vivek.
Using the DStax Driver we dont need to worry about the following things since it would automatically be handled at the driver level:
connection pooling
node discovery
automatic failover
load balancing
Coupled with it once we use the CQLTranslator in Thrift client we could have the clean client code.

@kadiyams
Copy link

kadiyams commented Nov 3, 2013

Vivek,
I have gotten started with this and making good progress.
Quick comment/question: Datastax driver exclusively supports only CQL3.0 as defined by their git page "A Java client driver for Apache Cassandra. This driver works exclusively with the Cassandra Query Language version 3 (CQL3) and Cassandra's binary protocol."

  1. Shall I make sure that this is checked while loading the configuration
    If there are any super columns or CQL2.0 stuff in the column families etc then should I just throw a not supported error for the Datastax client. That way we are putting it out there upfront and then then entire implementation should not worry about the CQL3.0 enabled check.
  2. Untill the above question is answered, I will move forward and throw an "Unsupported: Only CQL3.0 is supported by Datastax client" error and bubble it up.

@mevivs
Copy link
Collaborator Author

mevivs commented Nov 4, 2013

1. Shall I make sure that this is checked while loading the configuration
If there are any super columns or CQL2.0 stuff in the column families etc then should I just throw a not supported error for the Datastax client. That way we are putting it out there upfront and then then entire implementation should not worry about the CQL3.0 enabled check.

Looks fine to me.

Thanks,
-Vivek

@mevivs
Copy link
Collaborator Author

mevivs commented Dec 11, 2013

@kadiyams

Any update on this?

-Vivek

@jfgosselin
Copy link

+1

I’m also interested into this mainly for the new feature like automatic paging (http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0) which is only available with the CQL java driver.

Any update ?

Thanks

@mevivs
Copy link
Collaborator Author

mevivs commented Dec 12, 2013

Thanks for the link, will have a look. BTW, pagination is supported by Kundera over Cassandra in both ways(Thrift and CQL3).

https://github.com/impetus-opensource/Kundera/blob/trunk/src/kundera-cassandra/src/test/java/com/impetus/kundera/query/ResultIteratorTest.java

-Vivek

@jfgosselin
Copy link

Thanks Vivek , I'll take a look .

Based on this post from Datastax I thought it was only available via the CQL Native Protocol:
http://stackoverflow.com/questions/20394233/does-cql3-client-support-native-protocol

@kadiyams
Copy link

Vivek,
I lost the traction on this, since my job (changed jobs recently) has gotten hectic and am struggling with the dead lines. it would be another month before I could touch this. So please if anyone else is proceeding with continue. I will loop back in here after a month. Sorry for the delay in providing this feature.

@mevivs mevivs self-assigned this Feb 5, 2014
@mevivs mevivs closed this as completed in ae6150d Feb 25, 2014
@jfgosselin
Copy link

Hi Vivek,

Are you adding support for the Datastax java driver ?

JF

@mevivs
Copy link
Collaborator Author

mevivs commented Feb 25, 2014

Yes. I have started work on it

-Vivek

@mevivs mevivs reopened this Feb 25, 2014
mevivs added a commit that referenced this issue Feb 27, 2014
@ganeshkannan
Copy link

Hi Vivek,
Adding support for Datastax driver will be really helpful. I have been looking for something like Kundera for Cassandra for a while, and I think support for Datastax driver needs to be provided so enterprises like ours can easily start adopting Kundera.

Thank you.

@ganeshkannan
Copy link

Hi Vivek,
When do you think tentatively this issue will be closed?
Thanks

@mevivs
Copy link
Collaborator Author

mevivs commented Mar 2, 2014

Team is working on it and first version of Data stax java driver support is planned with 2.11 release

-Vivek

@trajar
Copy link

trajar commented Mar 2, 2014

For those interested, I started a project 'normandra' (https://github.com/trajar/normandra) which provides a kind of 'JPA-light' API for cassandra via the DataStax 2.x driver. It started out of a need to have simple JPA operations (but not the full stack) via the DataStax library, which at the time wasn't available with Kundera. It reads JPA annotations, creates CQL3 schemas, and supports save/get operations. I recently added one-to-one and one-to-many relationships, id generators (using counters), and embedded ids. I am in the process of adding many-to-one relationships and simple queries. It could be a good starting point for Kundera team for adding DataStax support.

@mevivs
Copy link
Collaborator Author

mevivs commented Mar 4, 2014

Update on this
Added first cut support. Still working to add more junits and functionalities.

How to use?
Have a look at https://github.com/impetus-opensource/Kundera/blob/trunk/src/kundera-cassandra/cassandra-ds-driver/src/test/java/com/impetus/kundera/client/cassandra/crud/PersonEntityTest.java

Wiki page will be published with 2.11 release.

-Vivek

@mevivs
Copy link
Collaborator Author

mevivs commented Mar 6, 2014

Support added for most of features as:

  1. Pagination
  2. Id auto generation
  3. Association
  4. Composite key
  5. Batch processing

a3d0043

-Vivek

mevivs added a commit that referenced this issue Mar 11, 2014
Added support for Many to many association.
mevivs added a commit that referenced this issue Mar 21, 2014
mevivs added a commit that referenced this issue Mar 21, 2014
@mevivs mevivs closed this as completed Mar 28, 2014
@brunocrt
Copy link

I'm testing the pagination on a table with composite partition key and I'm getting just one row (1) as result set. I'm setting the fetch size for 500 but the iterator just return 1 item. There is not exception/erro on logs! I don't understand why! the table has thousands of rows already inserted on it.

String queryString= "SELECT e FROM OrderEvent e WHERE e.primaryKey.partitionKey.location='US' AND e.primaryKey.partitionKey.year=2015"; com.impetus.kundera.query.Query query = (com.impetus.kundera.query.Query) em.createQuery(queryString, entityClass); query.setFetchSize(500); Iterator<OrderEvent> rows = query.iterate(); while(rows.hasNext()) { resultList.add( rows.next() ); }

I'm using kundera-cassandra-ds-driver version 3.4 with cassandra-driver-core (com.datastax.casssandra) version 2.1.10.3

In my driver configuration I'm using the DSClientFactory and CQL version 3.0.0

@brunocrt
Copy link

It seems that the issue is related to the composite partition key, because I tried a similar query with other table without composite partition key and it worked perfectly

@brunocrt
Copy link

brunocrt commented Sep 23, 2016

I captured more details after removing the WHERE clause from my query and an exception occured! The query generated by the Kundera driver seems to be limiting the results using LIMIT 1. That could be causing the issue.

11:10:11.556 [main] ERROR c.i.k.c.c.d.DSClient - Error while executing query SELECT * FROM "order_event" WHERE token("partitionKey") > token(OrderPartitionKey [year=2016, input_location=US]) LIMIT 1 ALLOW FILTERING.

Caused by: com.impetus.kundera.KunderaException: com.datastax.driver.core.exceptions.SyntaxError: line 1:90 no viable alternative at input '[' (... token("partitionKey") > token([OrderPartitionKey] [...)
at com.impetus.kundera.client.cassandra.dsdriver.DSClient.execute(DSClient.java:724)
at com.impetus.kundera.client.cassandra.dsdriver.DSClient.executeQuery(DSClient.java:526)
at com.impetus.client.cassandra.query.ResultIterator.populateEntities(ResultIterator.java:280)
at com.impetus.client.cassandra.query.ResultIterator.onCheckRelation(ResultIterator.java:226)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants