Commit Graph

2402 Commits

Author SHA1 Message Date
Pekka Enberg
ea9dc7062f db: Fix abstract_type and native_cql3_type cyclic dependency
Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-24 11:24:44 +02:00
Avi Kivity
550e97b840 Merge branch 'tgrabiec/to_string' of github.com:cloudius-systems/seastar-dev into db
join() implementation unification, from Tomasz.
2015-03-24 10:58:38 +02:00
Avi Kivity
1985f22a41 cql: use set_cell()
Instead of set_static_cell()/set_clustered_cell().
2015-03-24 08:35:20 +01:00
Avi Kivity
f983ab41a3 db: get rid of object_opt
As Tomasz noticed, boost::any can be empty, so optional<> functionality is
not needed.
2015-03-24 08:23:34 +01:00
Tomasz Grabiec
786e3eac16 transport: cql3: Fix write_value()
Current code dereferences iterators which results in the wrong
overlaod of insert() to be invoked.
2015-03-24 08:22:25 +01:00
Avi Kivity
9752c52743 cql3: operation: move code to .cc file 2015-03-23 23:22:48 +02:00
Tomasz Grabiec
868955658a Merge tag 'refs/tags/avi/collections/lists/v3'
From Avi:

This patchset does some initial conversions for values and operations on
list types.  Also included is the collection tombstone patchset, which is
needed to make setters work.

setter_by_index is an RMW operation, which is not implemented yet, so it
is not tested.
2015-03-23 21:43:55 +01:00
Avi Kivity
24506efc43 uuid: fix serialization of least significant bytes
Shift amount was incorrect.
2015-03-23 22:42:34 +02:00
Avi Kivity
21f1888f88 cql: fix lists::setter to use a tombstone
Properly squash existing value
2015-03-23 21:54:22 +02:00
Avi Kivity
fec79ac147 cql: introduce update_parameters::make_tombstone_just_before()
Addresses a quirk in how collection tombstones are compared vs. cells:
a timestamp tie goes to the tombstone.  Matches origin.
2015-03-23 21:54:22 +02:00
Avi Kivity
c77648da6e db: add collection tombstones 2015-03-23 21:54:22 +02:00
Avi Kivity
62ee57b953 db: wrap collection_type_impl::mutation's vector in a struct
This will allow us to introduce a tombstone alongside.
2015-03-23 21:54:22 +02:00
Avi Kivity
c701152d50 db: don't use stringstream for collection mutation serialization 2015-03-23 21:54:22 +02:00
Avi Kivity
6f7187fa43 db: drop unused atomic_cell::is_dead() parameter 2015-03-23 21:54:22 +02:00
Avi Kivity
00695c247a tests: add list tests to cql_query_test
List update currently not tested due to lack of collection tombstones.
2015-03-23 21:54:22 +02:00
Avi Kivity
b0bd19cbad cql3: wire up operation::set_value() for lists 2015-03-23 21:54:22 +02:00
Avi Kivity
39dbb40483 cql3: convert lists::setter to C++ 2015-03-23 21:54:22 +02:00
Avi Kivity
69841017dd cql3: convert operation::set_element() (for lists) to C++ 2015-03-23 21:54:22 +02:00
Avi Kivity
86ea3406d6 cql3: convert lists::setter_by_index() to C++ 2015-03-23 21:54:22 +02:00
Avi Kivity
83607705bc cql3: convert lists literal grammar to C++ 2015-03-23 21:54:22 +02:00
Avi Kivity
30e0bf6a3c cql3: lists: convert literal, delayed_value, and value to C++ 2015-03-23 21:54:22 +02:00
Avi Kivity
4fb7aba0f5 cql3: convert update_parameters::get_prefetched_list() to C++ 2015-03-23 21:54:14 +02:00
Avi Kivity
65a2c68df2 cql3: fix update_parameters prefetched rows type
We may be required to work on multiple rows (IN (row_key_1, row_key_2)) so
use a query::result for prefetched rows.
2015-03-23 19:34:29 +02:00
Avi Kivity
1d5f94bad1 db: add mutation_partition::get_cell()
While most mutations don't need existing column values, some (SET my_list[3]=2)
do.  Add an accessor function for them.
2015-03-23 16:04:29 +02:00
Tomasz Grabiec
cae5565e06 Switch query.cc to use join() from to_string.hh 2015-03-23 11:05:03 +01:00
Tomasz Grabiec
c32d0497d2 Switch templates from to_string.hh to rely on operator<< only 2015-03-23 11:04:51 +01:00
Tomasz Grabiec
10a01c31d4 cql3: Implement operator<< for base classes defining to_string() methods 2015-03-23 11:00:54 +01:00
Tomasz Grabiec
375f1db51a cql3: Add const qulifier to to_string() methods 2015-03-23 11:00:54 +01:00
Tomasz Grabiec
100437ddfe Merge remote-tracking branch 'seastar/master' 2015-03-23 10:58:24 +01:00
Tomasz Grabiec
6692435757 core: Implement operator<< for smart pointers
It will allow to implement generic join(), which works with
sequences of things, and use it on std::vector<shared_ptr<printable>>
2015-03-23 11:49:18 +02:00
Avi Kivity
e8764371e7 Merge branch 'gleb/rpc' of github.com:cloudius-systems/seastar-dev
no_wait and client info support for rpc, from Gleb.
2015-03-22 16:35:00 +02:00
Gleb Natapov
406fbf76f7 rpc: add no_wait and client_info tests 2015-03-22 16:16:30 +02:00
Gleb Natapov
9f0900ee0f rpc: add logger and log exception in no_wait callback 2015-03-22 16:16:23 +02:00
Gleb Natapov
12885b924c rpc: add a possibly to pass client_info to an rpc handler
If rpc handler needs locally held information about rpc client that
making a call it may have client_info as a first parameter of rpc
handler. Rpc framework will pass it to the callback during invocation.
2015-03-22 16:16:17 +02:00
Gleb Natapov
7fe06f006e rpc: introduce rpc::no_wait
If registered callback returns rpc::no_wait a client will not wait
for remote function execution and will get immediately ready future.
2015-03-22 16:16:09 +02:00
Gleb Natapov
7f90c314da net: provide const versions of socket_address functions 2015-03-22 16:16:05 +02:00
Avi Kivity
fe1e6c0686 Merge branch 'tgrabiec/range-query' of github.com:cloudius-systems/seastar-dev into db
Range queries on clustering columns, from Tomasz.
2015-03-22 09:45:35 +02:00
Pekka Enberg
ada3513d36 transport: Use std::vector<char> for response building
Optimize CQL response building by switching from std::stringstream to
std::vector<char>. Improves single core cassandra-stress write
throughput by ~8%.

Before:

  [penberg@nero urchin]$ taskset -c 1 ./build/release/seastar --data data --smp 1

  [penberg@nero apache-cassandra-2.1.0]$ ./tools/bin/cassandra-stress write -mode cql3 simplenative prepared -rate threads=32

  Results:
  op rate                   : 73538
  partition rate            : 73538
  row rate                  : 73538
  latency mean              : 0.4
  latency median            : 0.4
  latency 95th percentile   : 0.7
  latency 99th percentile   : 1.1
  latency 99.9th percentile : 4.9
    latency max               : 147.8
    Total operation time      : 00:00:30
    END

After:

  [penberg@nero urchin]$ taskset -c 1 ./build/release/seastar --data data --smp 1

  [penberg@nero apache-cassandra-2.1.0]$ ./tools/bin/cassandra-stress write -mode cql3 simplenative prepared -rate threads=32

  Results:
  op rate                   : 79447
  partition rate            : 79447
  row rate                  : 79447
  latency mean              : 0.4
  latency median            : 0.3
  latency 95th percentile   : 0.7
  latency 99th percentile   : 1.0
  latency 99.9th percentile : 4.2
  latency max               : 87.1
  Total operation time      : 00:00:30
  END

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-21 17:22:56 +02:00
Tomasz Grabiec
bc8df8c25c tests: cql: Add tests for range queries 2015-03-20 19:20:59 +01:00
Tomasz Grabiec
0330568977 db: Handle range queries on clustering key
That also includes prefix range queries (partially constrained keys).
2015-03-20 19:20:59 +01:00
Tomasz Grabiec
3176be2610 keys: Use trichotomic comparators where possible
Trichotomic version reduces comparison count almost by half.
2015-03-20 18:59:58 +01:00
Tomasz Grabiec
c656674ab6 types: Introduce tri_compare() 2015-03-20 18:59:58 +01:00
Tomasz Grabiec
d8fd79a072 keys: Fix prefixable_full_tuple::is_prefixed_by()
Spotted during code review.
2015-03-20 18:59:57 +01:00
Tomasz Grabiec
cee4885346 cql3: Enable use of slice restrictions in a query 2015-03-20 18:59:29 +01:00
Tomasz Grabiec
403355398a cql3: Convert SingleColumnRestriction.Slice 2015-03-20 18:59:29 +01:00
Tomasz Grabiec
f006b10349 cql3: Convert TermSlice 2015-03-20 18:59:29 +01:00
Tomasz Grabiec
ebfc1ffb20 query: Add facilities for printing query request 2015-03-20 18:59:29 +01:00
Tomasz Grabiec
bdbd5547e3 db: Cleanup key names
clustering_key::one -> clustering_key
clustering_key::prefix::one -> clustering_key_prefix
partition_key::one -> partition_key
clustering_prefix -> exploded_clustering_prefix
2015-03-20 18:59:29 +01:00
Tomasz Grabiec
90298af614 db: Cleanup atomic_cell naming
atomic_cell -> atomic_cell_type
atomic_cell::one -> atomic_cell
atomic_cell::view -> atomic_cell_view
2015-03-20 18:59:29 +01:00
Avi Kivity
75ea8848bd Merge branch 'tgrabiec/opti' of github.com:cloudius-systems/seastar-dev into urchin
Cleanups and optimizations, from Tomasz.
2015-03-20 15:38:16 +02:00