Commit Graph

12 Commits

Author SHA1 Message Date
Glauber Costa
cdeab4a3d3 cql3: provide a mechanism to get a timestamp higher than any
It is common for some operations, like system table updates, to try and guarantee
some particular ordering of operations.

The way Origin does it, is by simply incrementing one to the current timestamp.
Our calls, however, are being dispatched through our internal query processor, which
has a builtin client_state.

Our client_state has a mechanism to guarantee monotonicity, by adding 1 if needed
to operations that happen subsequentially. By using a clock that is not wired up
to this mechanism, we can't really guarantee that if other operations happened to
get in between.

If we expose this mechanism through the query_processor, we will be able to guarantee
that.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Calle Wilund
3253474eda query_processor : implement execute_internal
For internal CQL queries dispatched almost like external
2015-07-06 08:21:16 +02:00
Gleb Natapov
a338407e29 make storage_proxy object distributed
storage_proxy holds per cpu state now to track clustering, so it has to
be distributed otherwise smp setup does not work.
2015-06-17 15:14:06 +02:00
Tomasz Grabiec
cf2f2b1cf7 cql3: Take prepared statement id by const& 2015-03-25 10:36:19 +01:00
Tomasz Grabiec
e6bca5721c main: Stop distributed<query_processor> on exit
Fixes assertion failure on ^C
2015-03-20 13:00:53 +01:00
Pekka Enberg
9d17a4e6da transport: Use constant for CQL version
There's a CQL version constant in query processor. Use it when
advertising CQL version to clients.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-20 11:21:18 +02:00
Pekka Enberg
d04c41d8a8 transport: CQL prepared statements
This patch adds initial support for PREPARE and EXECUTE requests which
are used by the CQL binary protocol for prepared statements. The use of
prepared statement gives a nice 2.5x single core performance boost for
Urchin:

  $ ./build/release/seastar --data data --smp 1

  $ ./tools/bin/cassandra-stress write -mode cql3 simplenative -rate threads=32

  Results:
  op rate                   : 31728
  partition rate            : 31728
  row rate                  : 31728
  latency mean              : 1.0
  latency median            : 0.9
  latency 95th percentile   : 1.8
  latency 99th percentile   : 1.8
  latency 99.9th percentile : 5.6
  latency max               : 181.7
  Total operation time      : 00:00:30
  END

  $ ./tools/bin/cassandra-stress write -mode cql3 simplenative prepared -rate threads=32

  Results:
  op rate                   : 75033
  partition rate            : 75033
  row rate                  : 75033
  latency mean              : 0.4
  latency median            : 0.4
  latency 95th percentile   : 0.7
  latency 99th percentile   : 0.8
  latency 99.9th percentile : 3.4
  latency max               : 205.0
  Total operation time      : 00:00:30
  END

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-19 15:54:46 +02:00
Pekka Enberg
4efaccaff6 cql3: Use forward declaration for result_message
There's a cyclic dependency between cql3 and transport namespaces when
we introduce prepared statements. The latter pulls
parsed_statement::prepared from the former. Break the cycle by using
a forward delcaration in cql_statement.hh.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-18 11:14:40 +02:00
Pekka Enberg
b40661c330 cql3: Use shared_ptr for prepared statements
Query processor needs to store prepared statements as part of a client
session for PREPARE and EXECUTE requests. Switch from unique_ptr to
shared_ptr in preparation for that.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-18 10:49:41 +02:00
Avi Kivity
70381a6da5 db: distribute database object
s/database/distributed<database>/ everywhere.

Use simple distribution rules: writes are broadcast, reads are local.
This causes tremendous data duplication, but will change soon.
2015-02-19 17:53:13 +02:00
Tomasz Grabiec
f074aa6a15 cql3: Add missing header inclusion guard 2015-02-16 12:00:03 +01:00
Tomasz Grabiec
5e742cc13d cql3: Convert QueryProcessor 2015-02-12 19:40:58 +01:00