-
Notifications
You must be signed in to change notification settings - Fork 16
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
[feature] protocol v3 #57
Conversation
- move query/execute/batch representations to separate functions in protocol.lua and add some documentation as to what they are supposed to represent - notify of some eventual errors in specs
This reverts commit acd1c43.
- necessary changes to switch to v3 - 9 bytes long headers - 2 bytes ([short]) stream ids - <flag> for BATCH statements for <serial_consistency> and <timestamp> (none is yest supported) - new serialization format for collections - new serialization for SCHEMA_CHANGE results - add tests for SCHEMA_CHANGE results - some linting (shadowed variables and redefinitions)
ce16eeb
to
3d1ad98
Compare
3d1ad98
to
195e02c
Compare
Damn, travis-ci installs Cassandra 2.0.9, which apparently does not support the v3. This is how we install Cassandra for Kong, so let me know what you want to do about that. |
Updated the PR with infos about cassandra versions/protocol versions infos. |
+1 |
Let me know how you feel about dropping v2 (I'm pretty sure we don't want to do that) and my suggestion to support both protocols @jbochi 😄 |
+1 |
just a quick check - what's the status of this PR? |
The project was forked to https://github.com/thibaultCha/lua-cassandra, with added features and bugfixes, and has recently been entirely re-written with many new features thibaultcha/lua-cassandra#15. |
Implements #22. Discussions about it already started at thibaultcha#5 so just copy pasting what I've written there so far:
About this PR
Drop v2 support for v3 only with:
<flags>
(like QUERY and EXECUTE) and a corresponding optional<serial_consistency>
parameters (see Section 4.1.7).protocol.lua
for example, which makes more sense since the query representation is already there.serial_consistency
flagconsistency
andbatch_types
About dropping v2
In regards of the v3: I wanted to support both v2 and v3 (and we still can) but I was struggling with the current structure and I wasn't sure how. I just came up with an idea: we could have a
Protocol
class as an attribute of a session, and a subclass for v2 and v3 implementations, overriding what needs to be.Dropping v2 means losing support for cassandra 2.0:
So let me know how you feel about it and my suggested solution because I'm pretty sure we still want to support 2.0.
About the file structure
In any case I think a refactor of the structure should be done to have a cleaner code base. I would like to have such a structure (I'm just making this up, haven't given it much thought yet):
We could breakup the project into smaller, more maintainable and documentable files.
Types could also be classes. That way it gets easy and elegant to serialize/deserialize them, do bit operations on them etc. A simple example:
would become