Commit Graph

1575 Commits

Author SHA1 Message Date
Tomasz Grabiec
a89ea75494 validation: Fix incorrect format specifier 2015-02-04 10:24:08 +01:00
Tomasz Grabiec
5049ed8ae6 Merge branch 'master' of github.com:cloudius-systems/seastar 2015-01-30 09:34:58 +01:00
Tomasz Grabiec
af7f315339 Merge branch 'tgrabiec/cql3' of github.com:cloudius-systems/seastar-dev
Mutation data model and cql3 conversions.
2015-01-30 08:42:49 +01:00
Tomasz Grabiec
e38fb6bdbf cql3: Convert DeleteStatement 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
b70b4c1957 cql3: Convert UpdateStatement 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
7dae2d0923 cql3: Convert Setter 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
ab1bdf1b82 cql3: expose Operation.execute() interface 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
d8982abf81 cql3: Allow bind_and_get() to return an optional value
In Origin it can be null and it has a different meaning than empty
value. See org.apache.cassandra.cql3.Constants.Setter#execute.
2015-01-29 19:41:00 +01:00
Tomasz Grabiec
496e5c651f cql3: Convert more of ModificationStatement 2015-01-29 19:41:00 +01:00
Tomasz Grabiec
58677dc911 service: Convert StorageProxy 2015-01-29 19:40:58 +01:00
Tomasz Grabiec
09a893aed4 service: Import StorageProxy.java 2015-01-29 19:40:07 +01:00
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
Gleb Natapov
89763c95c9 core: optimise timer completions vs periodic timers
The way periodic timers are rearmed during timer completion causes
timer_settime() to be called twice for each periodic timer completion:
once during rearm and second time by enable_fn(). Fix it by providing
another function that only re-adds timer into timers container, but do
not call timer_settime().
2015-01-29 12:43:28 +02:00
Avi Kivity
94e01e6d0e tests: exit after timertest ends 2015-01-29 12:24:03 +02:00
Avi Kivity
070eb7d496 tests: serialize timer tests
Otherwise the output gets interspersed.
2015-01-29 12:20:39 +02:00
Avi Kivity
59c0d7e893 smp: fix work item deletion
Delete it after completion, not after responding.
2015-01-29 12:14:05 +02:00
Gleb Natapov
bcae5f2538 smp: fix memory leak in smp queue
Delete completed items. Fixes regression from ff4aca2ee0.
2015-01-29 11:49:24 +02:00
Avi Kivity
42bc73a25d dpdk: initialize _tx_burst_idx
Should fix random segfault.
2015-01-29 11:18:54 +02:00
Asias He
0ab01d06ac tcp: Rework segment arrival handling
Follow RFC793 section "SEGMENT ARRIVES".

There are 4 major cases:

1) If the state is CLOSED
2) If the state is LISTEN
3) If the state is SYN-SENT
4) If the state is other state

Note:

- This change is significant (more than 10 pages in RFC793 describing
  this segment arrival handling).
- More test is needed. Good news is, so far, tcp_server(ping/txtx/rxrx)
  tests and httpd work fine.
2015-01-29 10:59:31 +02:00
Tomasz Grabiec
661bb3d478 tests: Use test_runner to run boost tests 2015-01-29 10:30:14 +02:00
Tomasz Grabiec
a1fecad8cb tests: Introduce test_runner class
It uses app_template to launch seastar framework and can be used from
outside threads to inject tasks.
2015-01-29 10:30:14 +02:00
Tomasz Grabiec
8ad50d6614 core: Add exchanger class 2015-01-29 10:30:13 +02:00
Avi Kivity
b3dd1c8285 Merge branch 'signal' of ../seastar
Simplify signal handling.
2015-01-29 10:08:27 +02:00