Commit Graph

23 Commits

Author SHA1 Message Date
Amnon Heiman
45b3e8cd11 query_options: Allows creating query_options from query_options
query_options object cannot be changed after it was created. For
internal uses, like internal query paging, it is needed to create a new
object based on some of the data from an existing one with a new paging
state.

This patch adds a constructor from a unique_ptr and paging state.

using unique_ptr behave similar to move modify constructor.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2017-07-13 14:02:11 +03:00
Vlad Zolotarov
fcef9d3b05 cql3::query_options: add a factory method for creation of options for a BATCH statement
Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
2017-04-12 12:24:08 -04:00
Pekka Enberg
be0351b49c cql3: Introduce raw_value and raw_value_view types
Currently, the code is using bytes_opt and bytes_view_opt to represent
CQL values, which can hold a value or null. In preparation for
supporting a third state, unset value introduced in CQL v4, introduce
new raw_value and raw_value_view types and use them instead.

The new types are based on boost::variant<> and are capable of holding
null, unset values, and blobs that represent a value.
2017-01-26 13:50:04 +02:00
Duarte Nunes
2e7cb32601 query_options: Adjust value_views after prepare()
query_options::prepare() changes the values array, but this is not the
one used by query_options internally (e.g., in get_value_at). So we
need to also recalculate the value_views after prepare() is called.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
2016-06-27 15:24:27 +02:00
Duarte Nunes
2683a49c69 query_options: Remove value_views arg from ctor
Having both the values and value_views arguments in the query_options
ctor is confusing, since query_options uses only the value_views field
but that is not communicated to the caller.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
2016-06-27 15:24:27 +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
Tomasz Grabiec
6709c0ac15 cql_serialization_format: Make it CQL protocol version aware
We want to serialize it as a single number, the CQL binary protocol
version to which it corresponds, so it needs to be aware of the
version number.
2016-02-15 17:05:55 +01:00
Tomasz Grabiec
9d11968ad8 Rename serialization_format to cql_serialization_format 2016-02-15 16:53:56 +01:00
Calle Wilund
32e480025f cql3::query_options: Add constructors for internal processing 2016-01-13 08:49:01 +00:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Calle Wilund
7f3ce3935e query_options: Add constructor for batch mode options (multi-level)
Added explicit move constructors as well as prohibit copy to help
disambiguate the constructor delegation
2015-09-15 11:20:13 +02:00
Pekka Enberg
10c6eee221 transport/server: Use sstring_view for query option names
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-24 09:06:13 +03:00
Pekka Enberg
23e9bf7162 cql3/query_options: make_temporary() helper
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-24 09:06:13 +03:00
Pekka Enberg
6dee204db2 cql3/query_options: Store values as bytes view
Store values as bytes view when possible. This improves the CQL protocol
option parsing path by avoiding allocating memory and copying individual
values as "bytes" objects.

Please note that we retain the non-view version for internal queries
where performance is not as important.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-24 09:06:13 +03:00
Pekka Enberg
ed92f8516c cql3/query_options: Fix formatting
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-17 09:48:59 +03:00
Pekka Enberg
b165d22443 cql3/query_options: Move implementation to source file
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-08-17 09:48:59 +03:00
Glauber Costa
0cb43b42d0 query_options: use native_protocol instead of 3 for internal options as well.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Glauber Costa
ffdd2eaacb query_options: use version::native_protocol() for version
Now that we have it, we can reuse here instead of hard coding the number 3.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Calle Wilund
53c3067fc4 cql3::query_options - add convinience constructor for internals 2015-07-06 08:21:16 +02:00
Avi Kivity
ff9536fffc cql3: de-virtualize query_options
query_options is needlessy organized as a class hierarchy, even though it's
really a simple value type.

Fix by folding all the derived classes into it.
2015-04-09 09:31:48 +02:00
Avi Kivity
538c7fdf2a cql3: fix query_options::DEFAULT not smp safe
Contains a shared_ptr (inside specific_options), so cannot be global.  Make
it thread_local instead.
2015-04-09 09:31:11 +02:00
Avi Kivity
0710704311 transport: propagate serialization_format to query_options 2015-03-16 18:10:09 +02:00
Tomasz Grabiec
0c5e2da0e0 cql3: Convert more of query_options
Needed by query_processor.
2015-02-12 19:40:58 +01:00