Commit Graph

41 Commits

Author SHA1 Message Date
Avi Kivity
5d9ab992e8 Merge branch 'tgrabiec/schema-id-fixes-v2' of github.com:cloudius-systems/seastar-dev into db
Fixes related to column_family ID handling, from Tomasz.
2015-04-20 14:33:07 +03:00
Tomasz Grabiec
ef05c5b919 db: Lookup column family by UUID
It's a bit faster.
2015-04-20 12:12:55 +02:00
Gleb Natapov
d75ccb0047 the very beginning of StorageService conversion 2015-04-20 09:18:23 +03:00
Gleb Natapov
d13422773d copy StorageSrvice.java over 2015-04-20 09:18:23 +03:00
Tomasz Grabiec
00f99cefd4 db: split query.hh to reduce header dependencies 2015-04-15 20:44:59 +02:00
Gleb Natapov
47ac784425 replication strategy
This patch converts (for very small value of 'converts') some
replication related classes. Only static topology is supported (it is
created in keyspace::create_replication_strategy()). During mutation
no replication is done, since messaging service is not ready yet,
only endpoints are calculated.
2015-04-02 16:16:39 +02:00
Calle Wilund
d3fe0c5182 Refactor db/keyspace/column_family toplogy
* database now holds all keyspace + column family object
* column families are mapped by uuid, either generated or explicit
* lookup by name tuples or uuid
* finder functions now return refs + throws on missing obj
2015-04-01 10:08:00 +02:00
Pekka Enberg
6b0ad02019 cql3: Remove QueryHandler class
Cassandra added support for specifying user-specified query handlers
instead of the default QueryProcessor in CASSANDRA-6659. We don't really
need that now and as we're C++, we cannot even support existing custom
query handlers. Therefore, remove the QueryHandler class and references
to it.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-30 14:49:49 +02:00
Tomasz Grabiec
2902395129 Relax includes 2015-03-30 09:01:59 +02:00
Pekka Enberg
d0fef3e31b db: Apply mutations in legacy_schema_tables::merge_schema()
Pass a reference to storage_proxy and apply mutations in
legacy_schema_tables::merge_schema().

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-26 13:33:48 +02:00
Pekka Enberg
5dfe06d5f1 service: Convert MigrationManager to C++, take 2
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-26 13:33:48 +02:00
Pekka Enberg
d20d835331 service: Add mutate_local() to storage proxy
Schema mutations are applied locally so add a mutate_local() function to
storage proxy.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-26 13:33:48 +02:00
Pekka Enberg
49fbe52088 service: Convert MigrationManager.announceNewColumnFamily to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-24 15:02:33 +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
Tomasz Grabiec
1b1af8cdfd db: Introduce types to hold keys
Holding keys and their prefixes as "bytes" is error prone. It's easy
to mix them up (or use wrong types). This change adds wrappers for
keys with accessors which are meant to make misuses as difficult as
possible.

Prefix and full keys are now distinguished. Places which assumed that
the representation is the same (it currently is) were changed not to
do so. This will allow us to introduce more compact storage for non-prefix
keys.
2015-03-17 15:56:29 +01:00
Tomasz Grabiec
a195df836d service: Cleanup formatting in storage_proxy.cc 2015-03-17 15:56:28 +01:00
Pekka Enberg
bcb6c1b9c3 service: Convert MigrationManager to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
5bdf0e4429 service: Import MigrationManager.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Tomasz Grabiec
2f6d9a4113 db: Introduce query interface 2015-03-11 16:01:13 +01:00
Tomasz Grabiec
03c70bb71f service: Stub paging_state::serialize() 2015-03-11 16:01:13 +01:00
Tomasz Grabiec
609e893055 unimplemented: Separate subject from behavior
You can now do:

  fail(unimplemented::cause::PAGING);

and:

  warn(unimplemented::cause::PAGING);
2015-02-27 10:48:56 +01:00
Avi Kivity
2720ba34bf db: shard data
Add database::shard_of() to compute the shard hosting the partition
(with a simplistic algorithm, but perhaps not too bad).

Convert non-metadata invoke_on_all() and local calls on the database
to use shard_of().
2015-02-23 11:37:12 +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
Avi Kivity
8f9f794a73 db: make column_family::apply(mutation) not steal the contents
With replication, we want the contents of the mutation to be available
to multiple replicas.

(In this context, we will replicate the mutation to all shards in the same
node, as a temporary step in sharding a node; but the issue also occurs
when replicating to other nodes).
2015-02-19 16:23:09 +02:00
Tomasz Grabiec
f943555571 service: Convert client_state constructors 2015-02-16 12:15:08 +01:00
Tomasz Grabiec
b3544238d1 service: Implement query_state:: get_client_state() and get_timestamp()
Needed by query_options and query_processor.
2015-02-12 19:40:58 +01:00
Tomasz Grabiec
0b39d284b8 service: Return keyspace name by const&
It should be up to the caller if copy is needed.
2015-02-12 19:40:57 +01:00
Tomasz Grabiec
43e693e72d service: Implement client_state::get_timeout() 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
7c7c23b5b6 service: Stub PagingState 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
b7e3c46a42 service: Import PagingState.java 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
1b66f33455 db: Apply mutations locally from storage_proxy
Eventually we should rather send them to replicas, but for now we just
apply locally.
2015-02-09 10:28:44 +01:00
Tomasz Grabiec
9530a372cc cql3: Take reference to storage_proxy and call instance methods 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
d5a7f37c45 db: Merge api.hh into database.hh 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
800ba79efa db: Drop api:: namespace from mutation model classes
In preparation for merging into database.hh
2015-02-09 10:28:44 +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
Pekka Enberg
de4f0f8455 cql3: convert CFStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-30 15:53:59 +02:00
Pekka Enberg
cff499989d cql3: convert UseStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-30 15:53:58 +02:00
Pekka Enberg
bf3112f331 cql3: convert CQLStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-30 10:03:44 +02:00