Commit Graph

1533 Commits

Author SHA1 Message Date
Tomasz Grabiec
ea3f83754f service: convert ClientState 2015-01-29 19:40:07 +01:00
Tomasz Grabiec
2294c6b1e0 service: Import ClientState.java 2015-01-29 19:40:07 +01:00
Tomasz Grabiec
d4b6f7abc3 cql3: Convert more of ConsistencyLevel 2015-01-29 19:40:07 +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
73a4ba8fd2 cql3: Add validation.hh
validate_cql_key() is based on validate_key() from ThriftValidation. I
didn't name it thrift_validation.hh though because it's meant to work
on CQL model, not thrift. For instance, it's using our
schema::partition_key_type, which is not thrift-compatible.
2015-01-29 19:40:07 +01:00
Tomasz Grabiec
ef430a605c db: Convert ThriftValidation 2015-01-29 19:40:07 +01:00
Tomasz Grabiec
69ba3de601 thrift: Import ThriftValidation.java 2015-01-29 19:40:07 +01:00
Tomasz Grabiec
2006a75403 Add unimplemented.hh
The problem is that while we are converting some code, we don't want
to convert some aspects of it. For example we don't want to implement
indexing supporting yet. To better track those places, we insert a
statement in those places which can be easily tracked down when the
time comes. This patch adds a header where those statements are
grouped.

Alternative is to use comments, but comments are free text so we
can't force common syntax on them.
2015-01-29 19:40:02 +01:00
Tomasz Grabiec
15bc1a8af3 db: Introduce mutation model
This model is meant to follow CQL more closely than the model in
Origin. We have direct representations for CQL rows and cells.

We avoid using thrift concepts here. Here's how some of the Origin's
classes map to this:

 Mutation -> mutation
 ColumnFamily -> partition
 CellName -> clustering_key/clustering_prefix and column_id
 Cell -> atomic_cell (not for collection types though)

Note about CounterMutation. CounterMutation is for modifying counter
tables. A counter table can only have one column, the counter
value. In Origin CounterMutation is a subclass of IMutation which
represents mutations on counter tables. The only field it adds is
consistency level. I think we don't need to have a separate class for
this, at least in the generic code, which simplifies things. We can
check whether the table is a counter table from the schema and we can
pass the consistency level from QueryOptions during serialization.
2015-01-29 18:55:24 +01:00
Tomasz Grabiec
64128dc117 cql3: Convert UpdateParameters 2015-01-29 18:55:24 +01:00
Tomasz Grabiec
2a35e4e5a4 config: Delete cf_meta_data and column_definition
Converted code should use abstractions from database.hh now.
2015-01-29 18:55:24 +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
185e443624 cql3: Allow restriction::values() to return missing values
Origin allows nulls here.
2015-01-29 18:55:24 +01:00
Tomasz Grabiec
333d1f259f Stub schema::is_dense() and schema::is_counter() 2015-01-29 18:55:24 +01:00
Tomasz Grabiec
34616107a9 Add column_definition::is_static() 2015-01-29 18:55:23 +01:00
Tomasz Grabiec
1cfcb5b09c Add column_definition.id
The ID will be used in mutation model.
2015-01-29 18:55:20 +01:00
Tomasz Grabiec
4d41d10d99 Extract schema to a separate class 2015-01-29 15:53:05 +01:00
Tomasz Grabiec
bf60d82dd0 types: Introduce tuple_type 2015-01-29 15:02:27 +01:00
Tomasz Grabiec
f61d637cdb types: Mark bytes_type as byte order comparable 2015-01-29 15:02:27 +01:00
Tomasz Grabiec
22b7010c6d types: Introduce non-polymorphic serialization/deserialization helper functions
All usages I could find which deserialize value are
non-polymorphic. So there is no need to use boost::any() indirection
and polymorphic calls in most, if not all, cases.

Let the type class define deserialize_value/serialize_value
non-polymorphic members which work direclty on "value_type" and not
boost::any.
2015-01-29 15:02:27 +01:00
Tomasz Grabiec
37ef4bf635 types: Rename simple_compare to serialized_compare
To be in line with serialized_equal and serialized_hash
2015-01-29 15:02:27 +01:00
Tomasz Grabiec
65d2707794 types: Add support for equality and hashing of serialized values 2015-01-29 15:02:27 +01:00
Tomasz Grabiec
c14891adfd types: Mark is_byte_order_comparable() as const 2015-01-29 15:02:26 +01:00
Tomasz Grabiec
b0215f0fdc types: Mark string_type as byte order comparable 2015-01-29 15:02:26 +01:00
Tomasz Grabiec
ddcc750210 types: Mark date_type as byte order comparable and compare as such 2015-01-29 15:02:26 +01:00
Tomasz Grabiec
17b9babd91 Extract types related stuff from database.{cc,hh} to types.{cc,hh} 2015-01-29 15:02:19 +01:00
Tomasz Grabiec
c75468160a db: Use memcmp for comparing bytes
My bench-lie shows it's:
  - 1.2x faster for values of size 4 bytes
  - 4x faster for values of size 16 bytes
  - 9x faster for values of size 64 bytes
2015-01-29 14:43:36 +01:00
Tomasz Grabiec
3c3e3e5140 cql3: add missing multi-inclusion guard to function_call.hh 2015-01-25 18:46:15 +01:00
Tomasz Grabiec
506ac2ea9a exceptions: Fix include 2015-01-25 12:51:23 +01:00
Avi Kivity
f957332e64 Merge branch 'tgrabiec/cql3' of github.com:cloudius-systems/seastar-dev into db
cql3 Conversions and Cleanups, from Tomek.
2015-01-25 13:17:07 +02:00
Avi Kivity
be6f8d0613 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-01-25 13:16:48 +02:00
Tomasz Grabiec
24227fd933 shared_ptr: Add helpers for hashing shared_ptr<> by value 2015-01-25 13:12:04 +02:00
Raphael S. Carvalho
be7dbcbf50 core: improve reactor::receive_signal()
receive_signal() uses the unordered map _signal_handlers (signo mapped to
signal_handler) to either register a signal or find an existing one, and
from there get a future from the promise associated with that signal.
The problem is _signal_handlers.emplace() being called unconditionally,
resulting in the constructor from signal_handler always being called to
needlessly re-register the same handler, even when the signo is already
inserted in the map.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-01-25 13:10:55 +02:00
Tomasz Grabiec
903af87e30 cql3: Expose query_options::get_consistency() 2015-01-23 18:45:28 +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
90a43b5556 cql3: Make column_identifier printable 2015-01-23 18:45:28 +01:00
Tomasz Grabiec
f081902a26 cql3: Implement equality and hashing for column_identifier 2015-01-23 18:45:28 +01:00
Tomasz Grabiec
612f68b869 db: Convert ConsistencyLevel to C++ 2015-01-23 18:45:28 +01:00
Tomasz Grabiec
4b9dd3e978 db: Import ConsistencyLevel 2015-01-23 18:45:27 +01:00
Tomasz Grabiec
7df2a86209 cql3: Convert restrictions/Restriction.java to C++ 2015-01-23 18:45:27 +01:00
Tomasz Grabiec
4623401c1a cql3: Convert statements/Bound.java to C++ 2015-01-23 18:45:27 +01:00
Tomasz Grabiec
ab3d53edf5 shared_ptr: Add helpers for hashing shared_ptr<> by value 2015-01-23 18:45:27 +01:00
Tomasz Grabiec
8c63459b3b Introduce GC clock
The clock used to expire tombstones and cells with time-to-live.

Origin uses 32-bit precision for this clock counting seconds since the
epoch. This means the clock will overflow not that far in the future,
but if we want to maintain compatibility on sstable level we need to
follow that.
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
Avi Kivity
0addc7d77f Merge branch 'penberg/cql3' of github.com:cloudius-systems/seastar-dev into db
More cql conversions from Pekka:

"Here's some more Cql.g conversions. In particular, we now support
 constants."
2015-01-22 15:39:04 +02:00
Pekka Enberg
8fda9fd97d cql3: Convert constant parser rule to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-22 13:48:40 +02:00
Pekka Enberg
7bcc5d7397 cql3: Convert STRING_LITERAL lexer rule to C++
Note! I did not convert "pg-style string literals" (whatever those are)
because it's using Java-specific regex.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-22 13:48:40 +02:00
Pekka Enberg
1646361b88 cql3: Convert QUOTED_NAME lexer rule to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-22 13:48:40 +02:00