"(Partial?) implementation of BatchLogManager.
Requires the token function/restriction series.
Functional as in that it can create batchlog mutations, and do replay
of data in this system table.
Since range queries does not yet work, it only handles a very small
table contents.
It is not used yet either, but will eventually be needed for batch statements
etc."
The messaging service is initialized very early, before we have the
proxy or query processor initialized. It is mostly fine, except for
the fact that the messaging service also finishes the initialization
of the storage service. That part will issue queries agains the system
tables, (as soon as we support them), and need to happen later.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
What "internal" really means here, is queries that operate on the system tables.
Up until now, there wasn't really an issue because we weren't really checking
on this flag, and the internal calls were all unimplemented.
Now that we are about to hook up the internal calls, leaving this state marked
as internal will lead us to fail when we try to issue statements - like create
table - that are not, and will not be implemented in their internal
counterparts.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
"We don't want multiple shards to respond with the same data. Higher level code
assumes that shard data is non-overlapping. It's cheaper to drop duplicates as
soon as possible. Memtable reader for example will never have overlapping
data, so cache hitting queries will never need to pay for this. Compaction
process may also rely on this."
For simplicity in expiration time computations 0 is used as current
timestamp, make sure that sstable write code is aware of that and
doesn't consider cells as already expired.
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
Currently if rpc handler returns smart pointer rpc will try to serialize
the pointer object as opposite to an object the ptr is pointing to.
This patch fixes it by serializing real object instead of a pointer.
Unit test for NetworkTopologyStrategy class.
Creates a dummy cluster topology: token ring, token_metadata, snitch (RackInferringSnitch).
Then requests a natural endpoints for tokens that lay between each two adjacent ring tokens
and verifies the output.
It also checks the natural_endpoints caching:
1) Verifies that the result is calculated when we query the specific token_ring point
for the first time.
2) Verifies that the result is taken from the cache when we query the specific token_ring
point for the second time.
3) Verifies that the results in (1) and (2) are identical.
4) Verifies that the cache is invalidated after token_metadata::invalidate_cached_rings()
is called.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
"When compressor_parameters was introduced it only performed properties
validation, but wasn't properly wired to the rest of the code and the
compression information never made it to the final schema object.
This patchset changes that, now compression parameters are correctly processed
by schema builder as well written and read from system tables. Updated test
case makes sure that not only incorrect values are rejected during validation,
but also that correct values really are set in the created schema."
Check whether the created tables have actually the appropriate
compression parameters set.
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
convert fileiotest.cc to Boost test case, making it easier to see what
is being tested, and to add more file io tests.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Compressor type is only a part of the information kept in compressor
parameters and things like schema.get_compressor().get_compressor()
do not look very good.
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
Instead of requiring the user to subclass a "sstable_creator" class to
specify how to create a new sstable (or in the future, several of them),
switch to an std::function.
In practice, it is much easier to specify a lambda than a class, especialy
since C++11 made it easy to capture variables into lambdas - but not into
local classes.
The "commit()" function is also unnecessary. Then intention there was to
provide a function to "commit" the new sstables (i.e., rename them).
But the caller doesn't need to supply this function - it can just wait
for the future of the end of compaction, and do his own committing code
right then.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
This order is required since 5e1348e741
(storage_service: Use get_local_snitch_ptr in gossip_snitch_info).
This fixes the breakage in the cql_query_test.
Reported-by: Asias He <asias@cloudius-systems.com>
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
"
- Introduce a global distributed snitch object.
- Add the corresponding methods in i_endpoint_snitch class needed to work with
this object.
- Added additional check to gossiping_property_file_snitch_test.
"
This tests the basic compaction functionality: I created three small
tables using Cassandra (see commands below), compact them into one,
load the resulting table and check its content.
This test demonstrates, but is commented out to make the test succeed,
a bug: If a partition had old values and then a newer deletion (tombstone)
in another sstable, both values and tombstones are left behind in the
compacted table. This will be fixed (and the test uncommented) in a later
patch.
The three sstables were created with:
USE try1;
CREATE TABLE compaction (
name text,
age int,
height int,
PRIMARY KEY (name)
);
INSERT INTO compaction (name, age) VALUES ('nadav', 40);
INSERT INTO compaction (name, age) VALUES ('john', 30);
<flush>
INSERT INTO compaction (name, height) VALUES ('nadav', 186);
INSERT INTO compaction (name, age, height) VALUES ('jerry', 40, 170);
<flush>
DELETE FROM compaction WHERE name = 'nadav';
INSERT INTO compaction (name, age) VALUES ('john', 20);
INSERT INTO compaction (name, age, height) VALUES ('tom', 20, 180);
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>