Commit Graph

25 Commits

Author SHA1 Message Date
Duarte Nunes
bc90d6a730 udt: type_parser handles user defined types
This patch ensures type_parser can handle user defined types. It also
prefixes user_type_impl::make_name() with
org.apache.cassandra.db.marshal.UserType.

Fixes #631

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
2016-04-20 18:07:07 +02:00
Pekka Enberg
38a54df863 Fix pre-ScyllaDB copyright statements
People keep tripping over the old copyrights and copy-pasting them to
new files. Search and replace "Cloudius Systems" with "ScyllaDB".

Message-Id: <1460013664-25966-1-git-send-email-penberg@scylladb.com>
2016-04-08 08:12:47 +03:00
Paweł Dziepak
725129deb7 type_parser: accept sstring_view
Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com>
2016-01-18 08:35:27 +01:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Avi Kivity
73dfa66b8a remove "reversed_type.hh"
Not used (and fix one accidental use).
2015-07-25 17:34:56 +03:00
Glauber Costa
7669563900 type_parser: support reversed types
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-24 22:55:08 -04:00
Glauber Costa
c71dace86c type_parser: reword exception message
The current message makes exactly at least no sense.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-17 10:23:11 +02:00
Glauber Costa
e5dbbc61a2 type_parser: parse tuples
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-16 09:47:00 -04:00
Glauber Costa
8b94cc8654 type_parser: don't duplicate parsing code.
According to the comments, we are doing this for simplicity, to avoid
creating a new type_parse object.

However, while this approach works well for the simple case where we expect
a single token, it won't work as the parser becomes more able to recognize
other cases.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-16 09:47:00 -04:00
Glauber Costa
9b96a2441a type parser: detect frozen types
Note that the multicell attribute can't be part of the parse instance, because
otherwise we would either freeze every subsequent element, or complicate the
flow considerably to handle it.

It is instead, passed as a parameter to get_instance_types(), which will then
have to be propagated to parse() and get_abstract_type()

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-16 09:47:00 -04:00
Glauber Costa
31e22034f2 type_parser: fix a bug with recursive parsing
We currently have a bug when parsing collection types that contains collections
themselves.

We call the recursion correctly, but get_abstract_type gets its value by copy, not
reference. Therefore, all work it does in the _idx manipulation is done in the copy,
and when the callee returns, the caller, with its _idx unchanged, will try recursing
again.

Fix it by passing by reference

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-16 09:47:00 -04:00
Glauber Costa
85be9f55e8 type_parser: find - and ignore strings in the form <hex>:type
Collections can at times have the form <hex>:type. This is the case,
for instance, for the strings that compose the comparator string. The
actual hex number isn't terribly interesting: it is used as a key to
hash the collection types, but since we hash them by their types anyway,
we can safely ignore them.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-16 09:47:00 -04:00
Pekka Enberg
0fb6d6f2cb db/marshal: Convert TypeParser to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
506a8f4598 db/marshal: Import TypeParser.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Avi Kivity
6290dee438 db: const correctness for abstract_type and friends
Types are immutable.
2015-04-29 15:40:38 +03:00
Tomasz Grabiec
9309a2ee6f Remove obselete files 2015-04-17 15:08:06 +02:00
Tomasz Grabiec
6b30b4a2cd types: Introduce types::is_reversed() 2015-03-11 14:56:10 +01:00
Tomasz Grabiec
1610a58293 types: Relax include 2015-02-04 10:28:47 +01:00
Asias He
bf78e14d17 db: Switch to seastar shared_ptr from std::shared_ptr 2015-01-15 09:05:48 +08:00
Pekka Enberg
275caedd8c db: convert ListType to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 13:00:16 +02:00
Pekka Enberg
ec22f9123e db: Import db/marshal/ListType.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 13:00:13 +02:00
Pekka Enberg
2bf11ddac5 db: convert CollectionType to C++
Minimal conversion to have the type available.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 12:26:57 +02:00
Pekka Enberg
c245518948 db: Import db/marshal/CollectionType.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 11:17:53 +02:00
Pekka Enberg
ca1c54ac7c db: convert ReversedType to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 16:23:48 +02:00
Pekka Enberg
4984184603 db: import db/marshal/ReversedType.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 16:23:33 +02:00