Commit Graph

53948 Commits

Author SHA1 Message Date
Tomasz Grabiec
426cb73983 tests: Fix misspelled path to bytes_ostream_test in test.py 2015-04-16 09:58:51 +02:00
Avi Kivity
4144711b16 Merge branch 'net-stats-v1' of github.com:cloudius-systems/seastar-dev
DPDK network statistics, from Vlad:

   - Re-arranges and adds a few new queue networking statistics counters.
   - Adds port networking statistics counters for DPDK backend.
   - Rework the collectd registration and representation of networking statistics:
      - Use Rx/Tx statistics tuples where possible.
2015-04-16 10:41:04 +03:00
Avi Kivity
a087a0a4dd Merge branch 'asias/gossip_v1' of github.com:cloudius-systems/seastar-dev into db
Allow gossip to bind to a specific address, from Asias.
2015-04-16 10:16:22 +03:00
Asias He
65be3ab711 tests: Allow gossip to listen on a specific IP address 2015-04-16 14:58:52 +08:00
Asias He
7fd4c0a402 message: Allow listen on a specific IP address 2015-04-16 14:58:52 +08:00
Asias He
b18a7bf6c8 gossip: Fix namespace of get_next_version 2015-04-16 14:58:52 +08:00
Asias He
0a1fffa443 gossip: Use get_cluster_name and get_partitioner_name helper 2015-04-16 14:58:52 +08:00
Asias He
e60f1db994 gossip: Drop two hacks which were used to test before 2015-04-16 14:58:52 +08:00
Asias He
8705077517 gossip: Pass reference in send_all and request_all 2015-04-16 14:58:52 +08:00
Asias He
0ffa75f3b7 gossip: Allow specify seeds node IP address 2015-04-16 14:58:52 +08:00
Avi Kivity
2f079e2810 Add missing maps.cc 2015-04-16 08:17:14 +03:00
Gleb Natapov
1dbad40513 gossip: add missing namespace
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2015-04-15 22:37:30 +03:00
Gleb Natapov
d0a1e35a86 class factory
In Java it is possible to create an object by knowing its class name in
runtime. Replication strategies are created this way (I presume class
name comes from configuration somehow), so when I translated the code to
urchin I wrote replication_strategy_registry class to map a class name to
a factory function. Now I see that this is used in other places too (I
see that snitch class created in the same way), so instead of repeating
the same code for each class hierarchy that is created from its name in
origin this patch tries to introduce an infrastructure to do that easily.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2015-04-15 22:37:28 +03:00
Avi Kivity
3d134a797e Merge branch 'tgrabiec/query-format-v2' of github.com:cloudius-systems/seastar-dev into db 2015-04-15 21:59:34 +03:00
Avi Kivity
e50be70de2 cql3: move cql3_type's raw classes to .cc 2015-04-15 21:52:04 +03:00
Tomasz Grabiec
ee906471ab cql3: Move method implementations to .cc 2015-04-15 20:44:59 +02:00
Tomasz Grabiec
00f99cefd4 db: split query.hh to reduce header dependencies 2015-04-15 20:44:59 +02:00
Tomasz Grabiec
878a740b9d db: Write query results in serialized form
This gives about 30% increase in tps in:

  build/release/tests/perf/perf_simple_query -c1 --query-single-key

This patch switches query result format from a structured one to a
serialized one. The problems with structured format are:

  - high level of indirection (vector of vectors of vectors of blobs), which
    is not CPU cache friendly

  - high allocation rate due to fine-grained object structure

On replica side, the query results are probably going to be serialized
in the transport layer anyway, so this change only subtracts
work. There is no processing of the query results on replica other
than concatenation in case of range queries. If query results are
collected in serialized form from different cores, we can concatenate
them without copying by simply appending the fragments into the
packet. This optimization is not implemented yet.

On coordinator side, the query results would have to be parsed from
the transport layer buffers anyway, so this also doesn't add work, but
again saves allocations and copying. The CQL server doesn't need
complex data structures to process the results, it just goes over it
linearly consuming it. This patch provides views, iterators and
visitors for consuming query results in serialized form. Currently the
iterators assume that the buffer is contiguous but we could easily
relax this in future so that we can avoid linearization of data
received from seastar sockets.

The coordinator side could be optimized even further for CQL queries
which do not need processing (eg. select * from cf where ...)  we
could make the replica send the query results in the format which is
expected by the CQL binary protocol client. So in the typical case the
coordinator would just pass the data using zero-copy to the client,
prepending a header.

We do need structure for prefetched rows (needed by list
manipulations), and this change adds query result post-processing
which converts serialized query result into a structured one, tailored
particularly for prefetched rows needs.

This change also introduces partition_slice options. In some queries
(maybe even in typical ones), we don't need to send partition or
clustering keys back to the client, because they are already specified
in the query request, and not queried for. The query results hold now
keys as optional elements. Also, meta-data like cell timestamp and
ttl is now also optional. It is only needed if the query has
writetime() or ttl() functions in it, which it typically won't have.
2015-04-15 20:44:50 +02:00
Tomasz Grabiec
0f99570555 Introduce bytes_ostream 2015-04-15 20:33:49 +02:00
Tomasz Grabiec
d287fd4c39 utils: Extend data_input() with more methods 2015-04-15 20:33:49 +02:00
Tomasz Grabiec
a22a9bd3fb cql3: Cache contains_static_columns() 2015-04-15 20:33:49 +02:00
Tomasz Grabiec
f9afd82231 cql3: Remove unnecessary indirection to result_set_builder 2015-04-15 20:33:49 +02:00
Tomasz Grabiec
6c3d57696f enum_set: Introduce enum_set::of<>() 2015-04-15 20:33:49 +02:00
Tomasz Grabiec
a720f24c3c enum_set: Introduce frozen<>::unfreeze() 2015-04-15 20:33:48 +02:00
Tomasz Grabiec
57e74d2096 enum_set: Introduce set_if()
This:

  set_if<item>(cond);

is a more efficient version of:

  if (cond) {
     set<item>();
  }

The implementation can leverage internal representation to avoid
branching and thus make the operation cheaper.
2015-04-15 20:33:48 +02:00
Tomasz Grabiec
ecc5d23456 db: Avoid copying of column_definition
Spotted in the perf profile.
2015-04-15 20:33:48 +02:00
Tomasz Grabiec
7ebc7830b7 db: Optimize column family lookup in query path 2015-04-15 20:33:48 +02:00
Tomasz Grabiec
06f198b10c schema: Add id field
It uniquely identifies column_family globally. Will be used for
column_family lookups.
2015-04-15 20:33:48 +02:00
Tomasz Grabiec
a11aa768dc db: Remove outdated comment 2015-04-15 20:33:48 +02:00
Tomasz Grabiec
f5a45ae6e8 schema: Leave a warning about across core access of schema 2015-04-15 20:33:48 +02:00
Tomasz Grabiec
4f774c3053 cql3: Reset timestamp and ttl when adding missing cell 2015-04-15 20:33:48 +02:00
Tomasz Grabiec
b34cdd76ae db: Make the whole database printable
For debugging purposes.
2015-04-15 20:33:48 +02:00
Tomasz Grabiec
0be6cec13f db: Add const qualifier to mutation_partition::range() 2015-04-15 20:33:48 +02:00
Tomasz Grabiec
e0720e8a9b utils: Make UUID ostream-printable 2015-04-15 20:33:47 +02:00
Tomasz Grabiec
5300caadf6 utils: Fix UUID::get_time_UUID() creating conflicting UUIDs in SMP
UUID_gen::create_time_safe() does not synchronize across cores. The
comment says that it assumes it runs on a single core. This is no
longer true, we can run urchin on many cores. This easily leads to
UUID conflicts with more than one core. Fix by adding a per-core
unique number to the node part of the UUID.
2015-04-15 20:33:47 +02:00
Tomasz Grabiec
64579026e6 tests: Rework perf_simple_query to be more parametrizable
It also now supports testing of the write path.
2015-04-15 20:33:47 +02:00
Tomasz Grabiec
699fd10f24 tests: Remove junk code 2015-04-15 20:33:47 +02:00
Avi Kivity
a5b675b988 cql3: move maps.hh code to .cc 2015-04-15 21:21:05 +03:00
Avi Kivity
6866fd4620 cql3: enable IN marker grammar and some call sites 2015-04-15 18:01:50 +02:00
Tomasz Grabiec
560c972bb3 Merge tag 'avi/tuples/v3' from seastar-dev.git
Resolved trivial conflicts in:
	cql3/lists.cc
	tests/urchin/cql_query_test.cc
2015-04-15 18:01:37 +02:00
Avi Kivity
2520f81368 doc: don't document internal classes 2015-04-15 17:14:58 +03:00
Avi Kivity
5afc4c7181 Add doxygen configurarion file 2015-04-15 16:50:23 +03:00
Avi Kivity
51b8c4c230 cql3: fix #include directive syntax in single_column_restriction.hh 2015-04-15 15:53:31 +03:00
Avi Kivity
74b26af532 tests: add cql tuple tests 2015-04-15 15:36:06 +03:00
Avi Kivity
4a544b3655 tests: add type test for tuples 2015-04-15 15:36:04 +03:00
Avi Kivity
1c630fa42a cql3: enable tuple-related grammar 2015-04-15 15:35:31 +03:00
Avi Kivity
609bda59f5 cql3: convert tuples.hh to C++ 2015-04-15 15:35:30 +03:00
Avi Kivity
7bd1d0b2ad cql3: support for tuple cql3_type 2015-04-15 15:35:30 +03:00
Avi Kivity
4e43fab7f1 db: add tuple_type_impl
cql3_type integration is deferred to the next patch.
2015-04-15 15:35:30 +03:00
Avi Kivity
4abad8f357 db: add collection_type_impl::reserialize()
Allows switching between serialization formats.
2015-04-15 15:35:30 +03:00