Commit Graph

21 Commits

Author SHA1 Message Date
Avi Kivity
3c60310e38 key: relax some APIs to accept partition_key_view instead of const partition_key&
Using a partition_key_view can save an allocation in some cases.  We will
make use of it when we linearize a partition_key; during the process we
are given a simple byte pointer, and constructing a partition_key from that
requires an allocation.
2016-02-09 19:55:13 +02:00
Glauber Costa
f6cfb04d61 add a priority class to mutation readers
SSTables already have a priority argument wired to their read path. However,
most of our reads do not call that interface directly, but employ the services
of a mutation reader instead.

Some of those readers will be used to read through a mutation_source, and those
have to patched as well.

Right now, whenever we need to pass a class, we pass Seastar's default priority
class.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2016-01-25 15:20:38 -05:00
Glauber Costa
58fdae33bd mutation_source: turn it into a class
Its definition as a lambda function is inconvenient, because it does not allow
us to use default values for parameters.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2016-01-25 15:20:38 -05:00
Tomasz Grabiec
4e5a52d6fa db: Make read interface schema version aware
The intent is to make data returned by queries always conform to a
single schema version, which is requested by the client. For CQL
queries, for example, we want to use the same schema which was used to
compile the query. The other node expects to receive data conforming
to the requested schema.

Interface on shard level accepts schema_ptr, across nodes we use
table_schema_version UUID. To transfer schema_ptr across shards, we
use global_schema_ptr.

Because schema is identified with UUID across nodes, requestors must
be prepared for being queried for the definition of the schema. They
must hold a live schema_ptr around the request. This guarantees that
schema_registry will always know about the requested version. This is
not an issue because for queries the requestor needs to hold on to the
schema anyway to be able to interpret the results. But care must be
taken to always use the same schema version for making the request and
parsing the results.

Schema requesting across nodes is currently stubbed (throws runtime
exception).
2016-01-11 10:34:52 +01:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Tomasz Grabiec
802a9db9b0 Fix spelling of 'definitely_doesnt_exist' 2015-09-06 21:24:58 +02:00
Avi Kivity
7090dffe91 mutation_reader: switch to a class based implementation
Using a lambda for implementing a mutation_reader is nifty, but does not
allow us to add methods.

Switch to a class-based implementation in anticipation of adding a close()
method.
2015-08-31 15:53:53 +03:00
Avi Kivity
b22a598efb mutation_reader: make noncopyable
Many mutation_reader implementations capture 'this', which, if copied,
becomes invalid.  Protect against this error my making mutation_reader
a non-copyable object.

Fix inadvertant copied around the code base.
2015-08-25 15:49:08 +03:00
Avi Kivity
4390be3956 Rename 'negative_mutation_reader' to 'partition_presence_checker'
Suggested by Tomek.
2015-08-24 18:03:22 +03:00
Avi Kivity
29ce425862 db: introduce negative_mutation_reader concept
Similar to a mutation_reader, but limited: it only returns whether a key
is sure not to exist in some mutation source.  Non-blocking and expected
to execute fast.  Corresponds to an sstable bloom filter.

To avoid ambiguity, it doesn't return a bool, instead a longer but less
ambiguous "definitely_doesnt_exists" or "maybe_exists".
2015-08-09 22:00:44 +03:00
Avi Kivity
951eef2945 mutation_reader: add make_lazy_reader
Construct the reader on first use.  Useful with make_joining_reader().
2015-08-04 16:55:31 +03:00
Avi Kivity
318cc489c8 mutation_reader: add make_joining_reader()
Reads from provided readers, in order (assumes provided readers are
disjoint and in required order).
2015-08-04 15:49:09 +03:00
Asias He
ee699eb0ac mutation_reader: Take vector instead of initializer_list 2015-07-08 17:07:48 +03:00
Tomasz Grabiec
ed463ac3a7 mutation_reader: Introduce make_filtering_reader() 2015-07-07 16:56:25 +02:00
Tomasz Grabiec
01c698def4 mutation_reader: Make consume() work with deferring callbacks too 2015-07-03 12:38:36 +02:00
Tomasz Grabiec
d4e0e5957b db: Integrate cache with the read path 2015-06-23 13:49:25 +02:00
Tomasz Grabiec
8fd466338d mutation_reader: Introduce helper for consuming all mutations 2015-06-23 13:49:23 +02:00
Tomasz Grabiec
df0243d90e mutation_reader: Introduce simple reader adaptors
Useful for testing.
2015-06-18 15:47:40 +02:00
Tomasz Grabiec
96ab69d39d mutation_reader: Introduce make_combined_reader()
Based on column_family::for_all_partitions().
2015-06-18 15:47:40 +02:00
Tomasz Grabiec
b35bc8e75a mutation_reader: State monotonicy requirement in the interafce contract
Currently column_family::for_all_partitions() relies on monotonicity
of keys. Adding strict monotonicity requirement doesn't hurt
implementaitons, but makes some consumers simpler.
2015-06-18 15:47:40 +02:00
Tomasz Grabiec
7f1ff0401e db: Move mutation_reader definition to separate header 2015-06-18 15:47:40 +02:00