Commit Graph

530 Commits

Author SHA1 Message Date
Gleb Natapov
b7155ad862 pass partitions_ranges separately from from read_command
partitions_ranges will be manipulated upon to be split for different
destination, so provide it separately from read_command to not copy the
later for each destination.
2015-06-11 15:18:07 +03:00
Pekka Enberg
d088cb8181 Fix keyspace strategy options to preserve key-value ordering
Fix keyspace strategy options to preserve key-value ordering by
switching to std::map. We need this to be able to store the map in
database as JSON because unordered maps can cause the schema merging
code to attempt a keyspace update, which we don't support, even though
the values did not change.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-11 13:02:42 +03:00
Pekka Enberg
9bcb590efe cql3: Fix column identifier lookups
We're looking up shared_ptr<column_identifier> type so make sure we
lookup by value, not by pointer.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-08 09:23:33 +03:00
Pekka Enberg
07e4286f9e cql3: Make 'create table' include columns in schema_ptr
Make 'create table' statements also specify the following for
schema_ptrs:

  - Partition keys
  - Regular columns
  - Static columns

Please note that clustering keys are _not_ included because we seem to
lack infrastructure like CompoundType and CellNameType to properly
enable them.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-05 15:15:12 +03:00
Pekka Enberg
4365b8bb69 cql3: Use schema_builder for create table statements
Switch to using schema_builder in create_table_statement in preparation
for also defining columns in the resulting schema_ptr.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-05 15:15:12 +03:00
Pekka Enberg
cf6cdc6541 cql3: Move create_table_statement code out-of-line
Move create_table_statement code out-of-line in preparation for
modifying the implementation.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-05 15:15:12 +03:00
Pekka Enberg
c7a54448e2 cql3: Fix cql3_type::raw_type::is_counter()
We can simply delegate to the underlying type.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-05 15:15:12 +03:00
Calle Wilund
a157386f29 CreateIndexStatement Java -> c++
Initial translation. More or less complete, though dependent on some
schema attribtues with currently partial implementation. I.e. thrift.
2015-06-03 10:13:53 +02:00
Calle Wilund
15b8267dab Add thrift_schema and placeholder "has_compound_comparator()"
thrift_schema == place to collect thrift compatibility aspects of
schema definition.
2015-06-03 10:13:53 +02:00
Calle Wilund
61c1035c4f IndexName Java -> c++
Initial translation
2015-06-03 10:13:52 +02:00
Calle Wilund
e378ce70d6 IndexTarget Java -> c++
Initial translation
2015-06-03 10:13:52 +02:00
Calle Wilund
b28c71bf4c IndexPropDefs Java -> c++
Initial translation
2015-06-03 10:13:52 +02:00
Calle Wilund
1631ce132e Add "storage_proxy&" argument to cql_statement::validate
To make db, schemas etc reachable
2015-06-03 10:13:52 +02:00
Calle Wilund
1d30b85ac6 Unify column_definition::column_kind and ::column_kind enums 2015-06-02 11:22:41 +02:00
Avi Kivity
db46ced43c cql3: fix shared_ptr misuse in select_statement
A shared_ptr is mutable, so it must be thread_local, not static.
2015-06-01 17:34:00 +02:00
Avi Kivity
750543fc04 cql3: fix shared_ptr misuse in modification_statement
A shared_ptr is mutable, so it must be thread_local, not static.
2015-06-01 17:31:57 +02:00
Avi Kivity
b261bc9f42 cql3: fix shared_ptr misuse in cql3::constants
Global shared_ptrs are mutable, so make them shared_local.
2015-06-01 17:18:46 +02:00
Pekka Enberg
42cfcfb32d database: Remove compose() function
Convert code to use the deserialize() function and drop the duplicate
compose() wrapper that we inherited from Origin.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-27 16:22:35 +03:00
Asias He
898233ddcf Remove redundant const in static constexpr const
From http://en.cppreference.com/w/cpp/language/constexpr:

  A constexpr specifier used in an object declaration implies const.
2015-05-25 13:09:23 +03:00
Pekka Enberg
8a896e4ed5 cql: Remove obsolete cql3.cc
The cql3.cc file was used to make sure CQL header files were being
compiled in early stages of the translation. It's obsolete now and only
slows down compilation so lets get rid of it.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 15:58:04 +03:00
Pekka Enberg
8380df84b4 database: Rename ks_meta_data to keyspace_metadata
Follow the naming convention set by user_types_metadata and rename
ks_meta_data to keyspace_metadata.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 11:24:06 +03:00
Pekka Enberg
032af4d53b database: Move ks_meta_data definition to database.hh
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 11:03:28 +03:00
Tomasz Grabiec
f656ae8ed4 db: Encapsulate deletable_row fields 2015-05-13 08:56:54 +02:00
Tomasz Grabiec
56bea440a7 mutation_partition: Pass schema by const& where applicable
If method doesn't want to share schema ownership it doesn't have to
take it by shared pointer. The benefit is that it's slightly cheaper
and those methods may now be called from places which don't own
schema.
2015-05-13 08:56:54 +02:00
Pekka Enberg
11b633208d cql3: Remove Java imports from C++ files
Remove left-over Java imports from files that are already translated to
C++.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-12 16:41:12 +03:00
Pekka Enberg
c6da7e6844 cql3: Use std::nullopt constant
There's a std::nullopt constant for unset optionals. Use it.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-12 16:37:29 +03:00
Pekka Enberg
d50139351f cql3: Use pragma once everywhere
There's no benefit to using C include guards so switch to pragma once
everywhere for consistency.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-12 16:32:56 +03:00
Tomasz Grabiec
b1e45e4401 db: Store ttl in atomic_cell
Origin does that, so should we. Both ttl and expiry time are stored in
sstables. The value of ttl seems to be used to calculate the read
digest (expiry is not used for that).

The API for creating atomic_cells changed a bit.

To create a non-expiring cell:

  atomic_cell::make_live(timestamp, value);

To create an expiring cell:

  atomic_cell::make_live(timestamp, value, expiry, ttl);

or:

  // Expiry is calculated based on current clock reading
  atomic_cell::make_live(timestamp, value, ttl_optional);
2015-05-06 19:42:38 +02:00
Tomasz Grabiec
5ba1486ae7 db: Rename "ttl" to "expiry" when it's used as time point
To avoid confusion with "ttl" the duration.
2015-05-06 17:27:22 +02:00
Tomasz Grabiec
d6a003dc59 gc_clock: Store max_ttl as duration rather than time_point
Extra wrapping in time_point has no point.
2015-05-06 17:22:35 +02:00
Avi Kivity
bc669add40 schema: const correctness
Make schema accessors const, and make schema_ptr refer to a const schema.
2015-05-06 13:52:59 +02:00
Avi Kivity
4593d52444 cql3: remove gunk from lists.hh 2015-04-29 16:31:36 +03:00
Avi Kivity
6290dee438 db: const correctness for abstract_type and friends
Types are immutable.
2015-04-29 15:40:38 +03:00
Avi Kivity
ab60ed8813 db: s/shared_ptr<abstract_type>/data_type/
Also replace derived types (map_type, collection_type, etc.).

As we'll change data_type's definition, this reduces the number of places
that need to be modified later, and is more readable.
2015-04-29 15:09:04 +03:00
Tomasz Grabiec
f00f5f39d9 Merge tag 'avi/remedial-collections-2/v1' from seastar-dev.git
Collection support remedial from Avi.
2015-04-28 17:48:07 +02:00
Avi Kivity
0b09296f5d cql3: enable grammer for collection conditions
map['key'] IN (1, 2, 3)

etc.
2015-04-28 18:17:25 +03:00
Avi Kivity
993db76ef8 cql3: fix column_condition::collection_in_condition() naming 2015-04-28 18:16:49 +03:00
Avi Kivity
44f44bbeeb cql3: convert collection-related items in single_column_relation to C++ 2015-04-28 18:01:54 +03:00
Avi Kivity
97f689eb03 cql3: convert single_column_restriction::IN_with_marker to C++ 2015-04-28 18:00:35 +03:00
Avi Kivity
9c446a5465 cql3: convert RequestValidations.java to C++ 2015-04-28 17:05:32 +03:00
Tomasz Grabiec
02eb356cae Merge tag 'avi/remedial-collections-1/v1' from seastar-dev.git
Implementation of missing collections functionality from Avi.
2015-04-28 14:28:14 +02:00
Avi Kivity
448d67053f cql3: convert operation::prepend to C++ 2015-04-28 12:13:38 +03:00
Avi Kivity
abca68458e cql3: convert lists::prepender to C++
Note the original code contains a bug, causing the prepended literal to
be reversed.  The conversion (and Origin) are fixed.
2015-04-28 12:13:38 +03:00
Avi Kivity
4736504f4a cql3: convert lists::marker::bind() to C++ 2015-04-28 12:13:38 +03:00
Avi Kivity
9131c094a7 cql3: convert lists::precision_time to C++ 2015-04-28 12:13:38 +03:00
Avi Kivity
38a09a6c1a cql3: remove gunk from lists.hh 2015-04-28 12:10:33 +03:00
Avi Kivity
47f1fe8eb5 cql3: implement list append operation
UPDATE tab SET mylist = mylist + [1, 2, 3]
2015-04-27 14:54:16 +03:00
Avi Kivity
dc9e705952 cql3: convert lists::appender to C++ 2015-04-27 14:53:51 +03:00
Avi Kivity
f1219c1d74 cql3: enable collections in column_condition 2015-04-27 14:43:43 +03:00
Tomasz Grabiec
6e78344c87 Merge tag 'avi/usertypes-addendum/v1' from seastar-dev.git 2015-04-27 12:53:00 +02:00