Commit Graph

38 Commits

Author SHA1 Message Date
Avi Kivity
fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.

Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.

The changes we applied mechanically with a script, except to
licenses/README.md.

Closes #9937
2022-01-18 12:15:18 +01:00
Avi Kivity
a55b434a2b treewide: extent copyright statements to present day 2021-06-06 19:18:49 +03:00
Kamil Braun
e74b5deb5d cql3: enable non-frozen UDTs.
Add a cluster feature for non-frozen UDTs.

If the cluster supports non-frozen UDTs, do not return an error
message when trying to create a table with a non-frozen user type.
2019-10-25 12:04:44 +02:00
Kamil Braun
a8c7670722 types: add multi_cell field to user_type_impl.
is_value_compatible_with_internal and update_user_type were generalized
to the non-frozen case.

For now, all user_type_impls in the code are non-multi-cell (frozen).
This will be changed in future commits.
2019-10-25 12:04:44 +02:00
Calle Wilund
1afc899e37 type_parser: Fix/improve exception messages
Removes long-standing FIXME for message detail
Also simplifies some code, removing duplication.

Message-Id: <20190812134144.2417-1-calle@scylladb.com>
2019-08-12 17:03:43 +03:00
Piotr Jastrzebski
ad016a732b Move set_type_impl out of types.hh to types/set.hh
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2019-01-24 09:56:38 +01:00
Piotr Jastrzebski
b1e1b66732 Move list_type_impl out of types.hh to types/list.hh
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2019-01-24 09:56:38 +01:00
Piotr Jastrzebski
147cc031db Move map_type_impl out of types.hh to types/map.hh
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2019-01-24 09:56:38 +01:00
Piotr Jastrzebski
e92b4c3dbc Move user_type_impl out of types.hh to types/user.hh
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2019-01-24 09:04:04 +01:00
Avi Kivity
775b7e41f4 Update seastar submodule
* seastar d59fcef...b924495 (2):
  > build: Fix protobuf generation rules
  > Merge "Restructure files" from Jesse

Includes fixup patch from Jesse:

"
Update Seastar `#include`s to reflect restructure

All Seastar header files are now prefixed with "seastar" and the
configure script reflects the new locations of files.

Signed-off-by: Jesse Haber-Kucharsky <jhaberku@scylladb.com>
Message-Id: <5d22d964a7735696fb6bb7606ed88f35dde31413.1542731639.git.jhaberku@scylladb.com>
"
2018-11-21 00:01:44 +02:00
Avi Kivity
d77e044cde db: convert sprint() to format()
sprint() recently became more strict, throwing on sprint("%s", 5). Replace
with the more modern format().

Mechanically converted with https://github.com/avikivity/unsprint.
2018-11-01 13:16:17 +00:00
Calle Wilund
f9b83e299e type_parser: Origin expects empty string -> bytes_type 2017-05-10 16:44:48 +00:00
Vlad Zolotarov
d5b76d5198 type_parser: catch exceptions by reference and not by value
Found by PVS-Studio static analyzer:

Type slicing. An exception should be caught by reference rather than by value.

Fixes #2288

Reported-by: Phillip Khandeliants
Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
2017-04-26 15:12:15 -04:00
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