Commit Graph

46 Commits

Author SHA1 Message Date
Tomasz Grabiec
987cdaa6cb cql3: Optimise includes 2015-02-09 10:28:09 +01:00
Tomasz Grabiec
12af207219 cql3: Add missing virtual/override 2015-02-09 10:28:09 +01:00
Tomasz Grabiec
208fdfab45 cql3: Move methods from header to source file 2015-02-09 10:28:09 +01:00
Pekka Enberg
b98d82190f cql3: Convert SelectStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-02-06 10:46:12 +02:00
Tomasz Grabiec
bad22fe50e cql3: Convert ModificationStatement.Parsed.prepare()
Together with ParsedInsert descendant.
2015-02-04 10:29:05 +01:00
Tomasz Grabiec
654372f368 schema: Allow regular column names to have arbitrary type
Regular columns may have names of arbitrary type. See
https://issues.apache.org/jira/browse/CASSANDRA-8178

Primary key columns are UTF8.

This change also does some refactoring of the schema object to make
the change easier to digest (more encapsulation).
2015-02-04 10:29:00 +01:00
Tomasz Grabiec
d243fb7a01 cql3: Pass sstrings as const& where applicable 2015-02-04 10:29:00 +01:00
Tomasz Grabiec
4478da3c45 cql3: make modification_statement::_column_operations mutable
Note: "final" in Java means that the reference can't change, but the
object pointed to by the reference can.
2015-02-04 10:29:00 +01:00
Tomasz Grabiec
3a6cb52c28 cql3: Make cql_statement::prepare() accept a database reference 2015-02-04 10:28:59 +01:00
Tomasz Grabiec
8655825a2a cql3: Remove already converted code 2015-02-04 10:28:59 +01:00
Tomasz Grabiec
e11e5ff269 cql3: Drop redundant optional<> 2015-02-04 10:28:51 +01:00
Tomasz Grabiec
5710a99f44 cql3: Fix mis-overrides of cql_statement::execute*()
The method may defer so the result is wrapped in future<>.

I think we don't need to wrap arguments in shared_ptr<> because they
may come from the request state object.
2015-02-04 10:28:51 +01:00
Tomasz Grabiec
e38fb6bdbf cql3: Convert DeleteStatement 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
b70b4c1957 cql3: Convert UpdateStatement 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
496e5c651f cql3: Convert more of ModificationStatement 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
64412ff3dd cql3: Cleanup modification_statement 2015-01-29 19:40:07 +01:00
Tomasz Grabiec
a738365e6f cql3: Convert ModificationStatement.processedKeys 2015-01-29 19:40:07 +01:00
Tomasz Grabiec
159099e854 cql3: use our schema classes instead of the converts from config:: 2015-01-29 18:55:24 +01:00
Tomasz Grabiec
78eaabf9d9 cql3: Make statement_type printable 2015-01-23 18:45:28 +01:00
Tomasz Grabiec
fc2bc5558e cql3: cleanup: Drop redundant optional<>
shared_ptr<> is already optional.
2015-01-23 18:45:28 +01:00
Tomasz Grabiec
4623401c1a cql3: Convert statements/Bound.java to C++ 2015-01-23 18:45:27 +01:00
Tomasz Grabiec
7654cc490d cql3: Drop redundant optional<>
shared_ptr<> is already optional.
2015-01-23 18:38:16 +01:00
Pekka Enberg
129c27d1c4 cql3: Convert UpdateStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-20 11:49:42 +02:00
Pekka Enberg
e4a8d7cf71 cql3: Convert ModificationStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-20 11:48:26 +02:00
Pekka Enberg
74f8799324 cql3: Make cql::statement::uses_function const
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-20 11:47:38 +02:00
Pekka Enberg
6211dd68df cql3: Fix parsed_statement type
Parsed statements are not CQL statements so we shouldn't inherit from the
latter although commit 485620a ("cql3: Fix cql_statement and parsed_statement
confusion") claims otherwise.

This is needed to convert classes such as UpdateStatement.ParsedInsert.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-20 11:41:08 +02:00
Pekka Enberg
485620abcf cql3: Fix cql_statement and parsed_statement confusion
Cassandra's ParsedStatement does not implement CqlStatement. Classes
such as UseStatement extend ParsedStatement and implement CqlStatement
which causes JVM to dispatch methods such as usesFunction to
ParsedStatement.

This doesn't happen in C++, of course, which leaves classes such as
use_statement abstract and thus uninstantiable.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-14 09:01:18 +02:00
Pekka Enberg
d1969c0158 cql3: Convert AlterTypeStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 15:58:22 +02:00
Pekka Enberg
dc7646a0c4 cql3: Convert AlterKeyspaceStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 15:26:32 +02:00
Pekka Enberg
db12a1ac2d cql3: Convert KSPropDefs to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 15:21:48 +02:00
Pekka Enberg
ff714bdd35 cql3: Convert PropertyDefinitions to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 15:21:12 +02:00
Pekka Enberg
92ebf7989c cql3: Fix shared_from_this in schema_altering_statement
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 15:15:48 +02:00
Pekka Enberg
ee953e2e7f cql3: Add missing include to schema_altering_statement.hh
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 15:15:48 +02:00
Pekka Enberg
677264fb3b cql3: Use shared_from_this for parsed_statement::prepare()
Use shared_from_this instead of the synthetic unique_ptr argument for
parsed_statement::prepare() to preserve the original Cassandra API for
parsed statements.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 15:02:52 +02:00
Pekka Enberg
3b67331e50 cql3: convert VariableSpecifications to C++, take 2
This is the second conversion pass over the VariableSpecifications
class. I also had to fix up callers in parsed_statement class.

Note: I did not convert the toString() function as there's no toString()
in the column_specification class so Cassandra is just printing out list
of references here.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-08 11:43:04 +02:00
Pekka Enberg
36359850e6 cql3: Switch to our own shared_ptr implementation
Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-04 10:45:19 +02:00
Pekka Enberg
3368d44af7 cql3: Use optional for cf_name
Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-04 10:45:18 +02:00
Pekka Enberg
537cc42397 cql3: convert SchemaAlteringStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Pekka Enberg
479c370212 cql3: use unique_ptr for cf_name to allow nullptr
There are cf_statement derived classes that pass 'null' as 'cf_name'.
Switch to unique_ptr to allow that.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Pekka Enberg
046d827be6 cql3: Fix use_statement class override annotations
Add a missing override annotation to the use_statement class.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Pekka Enberg
5e4fc9b88c cql3: convert TruncateStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Pekka Enberg
c5d8506086 cql3: use unique_ptr for parsed_statement::prepare()
We cannot keep a C++ reference to the statement object because we then
lose ownership information. Start using unique_ptr as suggested by Avi
instead.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-30 16:27:47 +02:00
Pekka Enberg
de4f0f8455 cql3: convert CFStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-30 15:53:59 +02:00
Pekka Enberg
cff499989d cql3: convert UseStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-30 15:53:58 +02:00
Pekka Enberg
a17c3f8993 cql3: convert ParsedStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-30 15:53:58 +02:00
Avi Kivity
792f606a64 Import cql3 package and sub-packages
Contains the cql3 grammer and supporting classes, which will be converted
one by one.

From commit bf599fb5b062cbcc652da78b7d699e7a01b949ad.
2014-12-24 14:18:21 +02:00