-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
CQL storage backend #166
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
CQL storage backend #166
Conversation
|
Committer of one or more commits is not listed as a CLA signer, either individual or as a member of an organization. |
mbrukman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! This is a massive contribution. Please also add yourselves to CONTRIBUTORS.txt and your company to AUTHORS.txt in the root of this repo.
I am far from a Cassandra/CQL expert (so I'm hoping @fppt can weigh in on this, and anyone else who's proficient with Cassandra), but I'd like to ask a few things:
- this repo uses a 4-space indent, this PR uses tabs exclusively; would it be possible to switch to 4-space indent everywhere so we don't diverge from a single standard?
- can you please add the module to
.travis.ymlat the root of the repo and mark it optional so that it gets automatically tested? Then we can also see what Travis has to say about this change (I'm guessing it wasn't tested with the PR, as we specifically address each module in a separate build).
|
We'll get onto those changes and update the PR, thanks for the feedback. |
|
@pkendall64 – why did you delete the branch and close the PR? You can just update the code on your side and You can probably re-open this PR (since you created it), recreate the branch and force-push to it via |
|
Yeah, thats what I did and it just disappeared! |
|
@pkendall64 – you pushed "delete branch" button on GitHub, so it deleted the branch in You can also fetch PR on the CLI using In the worst case scenario, if you've deleted the branch in the |
|
Sorry about that, all fixed now. I had to checkout the old hash and force push that, then force push the new stuff over the top and now it's ok again. |
|
Great to hear your PR is back, @pkendall64! :-) |
amcp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good contribution. I think you need to add some more tests, there is some hairy logic in store manager regarding computing supported feature set. perhaps find a way to test enabled/disabled of features that depend on configuration.
janusgraph-cql/.classpath
Outdated
| @@ -0,0 +1,32 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this an eclipse specific file? should we be committing this to the repo, or should people be able to determine their own IDE configurations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll remove the eclipse files
janusgraph-cql/.project
Outdated
| @@ -0,0 +1,24 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, eclipse specific
janusgraph-cql/pom.xml
Outdated
| </plugins> | ||
| </pluginManagement> | ||
| </build> | ||
| </project> No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add newline to the end of file
|
|
||
| package org.janusgraph.diskstorage.cql; | ||
|
|
||
| import static com.datastax.driver.core.querybuilder.QueryBuilder.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please import specific things and not wildcard
| this.tableName = tableName; | ||
| this.getter = new Getter(storeManager.getMetaDataSchema(this.tableName)); | ||
|
|
||
| initialiseTable(this.session, this.storeManager.getKeyspaceName(), tableName, configuration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelled initialized elsewhere in this project so please match existing spelling
| } | ||
|
|
||
| private Cluster initialiseCluster() throws PermanentBackendException { | ||
| // XXX: Deal with retry policy and potentially others |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XXX?
| fb.keyOrdered(false).orderedScan(false).unorderedScan(true); | ||
| break; | ||
| } | ||
| case "org.apache.cassandra.dht.ByteOrderedPartitioner": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create string constants that get the canonical name from the actual classes. that way if version update changes the package of ByteOrderedPartitioner, you can catch it as compile time error here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you want to have compile time dependencies on these classes as they are internals to cassandra and we really only want this depend on the driver jar and not the cassandra internals.
Perhaps it would be better to get the simplename of the class and switch on that accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes switch on simplename please
| return builder.build(); | ||
| } | ||
|
|
||
| private Session initialiseSession(@SuppressWarnings("hiding") final Cluster cluster, final String keyspaceName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is hiding the member cluster ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just our eclispe settings. I'll remove the annotation.
| .flatMap(addTime -> Iterator.ofAll(keyMutations.getAdditions()).map(addition -> columnValueStore.insertColumn(key, addition, addTime))); | ||
|
|
||
| return Iterator.concat(deletions, additions) | ||
| .grouped(20) // XXX Pull this out as a configuration option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please pull out the batch size into configuration
| import com.datastax.driver.core.ConsistencyLevel; | ||
| import com.google.common.base.Preconditions; | ||
|
|
||
| public class CQLTransaction extends AbstractStoreTransaction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add classdoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added classdoc.
|
should the CQL storage Backend just a part of the module |
|
Please verify the committer name, email, and GitHub username association are all correct and match CLA records. |
|
We have seperated the CQL backend because we don't want to bring in cassandra-all, we only want the driver. We are also working on a PR that creates a janusgraph-cassandra parent that has embedded, thrift, astyanax and CQL as child projects along with a core project which will contain common configuration and other cassandra helper and abstract classes. There will also be a common test project which will contain common test code. This should make the while cassandra section a lot cleaner. Our ultimate goal is that you should be able to have maven dependencies on the backends you require (e.g. cassandra-cql and elasticsearch) and have a minimal set of transitive dependencies pulled in to create a runnning instance if JanusGraph. |
|
Committer of one or more commits is not listed as a CLA signer, either individual or as a member of an organization. |
sjudeng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hard work on this! At some point before merge please squash commits where possible.
|
Ok, thanks for the thorough review! We'll look into squashing where
appropriate to minimise it to the actual functional commits.
…On Sun, May 7, 2017 at 1:08 PM sjudeng ***@***.***> wrote:
***@***.**** approved this pull request.
Thanks for the hard work on this! At some point before merge please squash
commits where possible.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#166 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAfS5O1v3s0AjZGF6K4NbfEZsp5cuXwFks5r3RmIgaJpZM4MecTi>
.
|
… and prepared statements Signed-off-by: Samant Maharaj <samant.maharaj@orionhealth.com> Signed-off-by: Paul Kendall <paul.kendall@orionhealth.com> Signed-off-by: Jason Plurad <pluradj@us.ibm.com>
Signed-off-by: Paul Kendall <paul.kendall@orionhealth.com>
|
I have squashed a lot of the commits so it shows the initial implementation included a lot of the fixes we applied along the way, and then the reviews and extra functionality. If there's any other squashing or rearranging, please let us know and we'll get them done. |
Signed-off-by: Paul Kendall <paul.kendall@orionhealth.com> Signed-off-by: Samant Maharaj <samant.maharaj@orionhealth.com>
…control the thread lifecycle Signed-off-by: Samant Maharaj <samant.maharaj@orionhealth.com>
… deployment Various cleanup as per review comments Signed-off-by: Paul Kendall <paul.kendall@orionhealth.com>
Signed-off-by: Paul Kendall <paul.kendall@orionhealth.com>
…esting Signed-off-by: Paul Kendall <paul.kendall@orionhealth.com>
|
Squashed commits as suggested |
|
@mbrukman Has all your feedback been resolved here? @hsaputra,@fppt,@dylanht Are there any objections to merging this PR (pending thumbs up from @mbrukman)? I'm not a Cassandra user myself (@amcp not sure if you are) so current reviews might not have covered all aspects of the contribution. But that said there has been a lot of community interest on this and I think once merged these users will be able to try it out and provide additional feedback that can be tracked in subsequent issues/PRs if necessary. |
|
@sjudeng The code in general looks good, I didn't have check for correctness on runtime since I am not Cassandra user. But, one main comment is the dependency on |
|
@hsaputra Good call. Looks like the first version under io.vavr just came out yesterday so ... way to be on top of it! @pkendall64, @samant-orionhealth I added #271 to track work to make this dependency update. Hopefully you'll be able to help out with this work after this PR is merged. |
|
Sure, we can start on that now in preparation for the merge.
…On Fri, May 12, 2017 at 10:38 AM sjudeng ***@***.***> wrote:
@hsaputra <https://github.com/hsaputra> Good call. Looks like the first
version under io.vavr just same out yesterday so ... way to be on top of it!
@pkendall64 <https://github.com/pkendall64>, @samant-orionhealth
<https://github.com/samant-orionhealth> I added #271
<#271> to track work to
make this dependency update. Hopefully you'll be able to help out with this
work after this PR is merged.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#166 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAfS5EUJpnY8aZNgu_RFcg9FM1wSlCQVks5r443JgaJpZM4MecTi>
.
|
hsaputra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With tracked issue to update javaslang dependency, LGTM
| <artifactId>guava</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.javaslang</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one has been changed to vavr.io so not sure if you want to change it now given potential naming conflict from Oracle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated ticked #271 with a link to a branch in our repo with this migration. I'll create a PR once this is merged.
|
@pkendall64 Thanks for jumping on that. Do hold it for another PR though as I think we're about ready to go on this and I wouldn't want to hold it up to wait for another set of reviews on the new update. |
|
@mbrukman It looks like your feedback has been addressed here. Can you confirm? |
|
@pkendall64 A minor conflict in .travis.yml was created with merge of separate PR. I resolved it but it created another commit. I think it's fine but you're also welcome to rebase/squash to remove the merge commit if you'd like. Separately we'll need to look at getting the module covered better under Travis. @mbrukman Unless you have any objections I'd like to move forward with the merge here. We have four approvals and I've confirmed that your feedback has been addressed. |
mbrukman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@sjudeng I'm ok with the merge commit. Thanks for getting this merged and the thorough reviews from everyone involved. |
CQL storage backend
CQL storage backend
Adds a CQL stotage backend that is compatible with the table structure of the Astynanx code.
This PR addresses issue #35.
A new library (javaslang) is introduced which provides very nice functional library which makes the code a lot more concise and understandable.