Commit Graph

610 Commits

Author SHA1 Message Date
Paweł Dziepak
92740919eb tests/type: add test for comparing floating point values
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 17:52:45 +02:00
Avi Kivity
79dcdfd90f Merge "BatchLogMana" from Calle
"(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."
2015-07-08 14:48:33 +03:00
Calle Wilund
6cf2230cb6 Add batchlog_manager_test
Very simple, and limited, but at least checks that very basic
replay works.
2015-07-08 10:59:57 +02:00
Paweł Dziepak
b8c3d8de4b tests/cql: add test for empty sstable_compression property
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-08 10:47:50 +02:00
Avi Kivity
dd29ac9593 Merge "cqlsh" from Glauber
System table Work to make cqlsh connect.
2015-07-07 19:33:23 +03:00
Glauber Costa
ba33af1a8d service: split messaging service initialization in two parts
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>
2015-07-07 11:38:22 -04:00
Glauber Costa
fe6be361ba cql_tests: mark the client as external instead of external
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>
2015-07-07 11:38:22 -04:00
Avi Kivity
5d9222d935 Merge "Filter sstable data not belonging to current shard" from Tomasz
"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."
2015-07-07 18:12:35 +03:00
Tomasz Grabiec
4dca9f4f09 tests: Add tests for make_filtering_reader() 2015-07-07 16:56:25 +02:00
Paweł Dziepak
752d9e6699 tests/type: add test cases for validation
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-07 13:58:57 +02:00
Paweł Dziepak
a7a231f8dc tests/cql: add tests for blobAs*() and *AsBlob() functions
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-07 11:32:21 +02:00
Paweł Dziepak
9b61d4d433 tests/types: add tests for timeuuid, uuid, timestamp and inet
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:46:09 +02:00
Paweł Dziepak
00da6e24fc tests/cql: test insert and select for all types
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:38:27 +02:00
Calle Wilund
ad12b7d21c Add query_processor_test
Testing execute_internal somewhat
2015-07-06 08:21:16 +02:00
Calle Wilund
5b30326953 Add query_processor accessor to cql_test_env 2015-07-06 08:21:16 +02:00
Paweł Dziepak
36e1fdcff4 tests/cql_query: test expiring cells
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-02 17:26:26 +02:00
Paweł Dziepak
dc23574580 tests/sstable: use 0 as current timestamp
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>
2015-07-02 17:26:10 +02:00
Avi Kivity
1eabf5983f Merge seastar upstream 2015-07-02 17:07:04 +03:00
Gleb Natapov
d0003e4f29 rpc: handler smart pointer return value from rpc handler
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.
2015-07-02 16:46:23 +03:00
Tomasz Grabiec
f89ae4078f tests: Add test for querying a mutation 2015-07-02 14:51:28 +02:00
Tomasz Grabiec
f711e4e978 tests: Mark assert_that() inline instead of static 2015-07-02 14:51:28 +02:00
Tomasz Grabiec
eba6b492a6 tests: Introduce result_set assertions 2015-07-02 14:51:27 +02:00
Vlad Zolotarov
d1d8cae95e tests: network_topology_strategy_test
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>
2015-06-29 18:50:55 +03:00
Avi Kivity
b3c84bb7e1 Merge "Compression parameters in schema definitions" from Paweł
"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."
2015-06-29 12:00:30 +03:00
Avi Kivity
96ccde7a99 Merge seastar upstream 2015-06-29 11:21:23 +03:00
Paweł Dziepak
1c84a7231a tests/cql: improve compression tests
Check whether the created tables have actually the appropriate
compression parameters set.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:43:14 +02:00
Avi Kivity
7e66cc02e1 tests: close file in fileiotest 2015-06-28 20:40:37 +03:00
Avi Kivity
a7580f5dab Merge seastar upstream
Conflicts:
	test.py
2015-06-28 19:43:28 +03:00
Nadav Har'El
7327e246c1 tests: convert fileiotest.cc to Boost test case
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>
2015-06-28 12:35:03 +03:00
Tomasz Grabiec
fe8ffd475c tests: Add test for comparing decorated_key with ring_position 2015-06-25 18:45:13 +02:00
Tomasz Grabiec
9ebb7e968d tests: Switch to schema_builder in partitioner_test 2015-06-25 18:45:13 +02:00
Avi Kivity
90412a2b26 Merge "Compression parameter fixes" from Paweł 2015-06-25 18:48:30 +03:00
Paweł Dziepak
89ede1fc00 schema: rename [set, get]_compressor to [set, get]_compressor_params
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>
2015-06-25 17:05:53 +02:00
Tomasz Grabiec
6be8d30862 Merge tag 'avi/token-wraparound/v1' from seastar-dev.git
Fixes for token workaround from Avi:

"Tokens wrap around in a ring; if we have a range (t1, t2) where t1 > t2
the midpoint is not between them."
2015-06-25 16:01:20 +02:00
Avi Kivity
1a12438e5e tests: add token midpoint tests 2015-06-25 15:25:57 +03:00
Paweł Dziepak
335fe5ce50 tests/cql: add test for compression specific validation
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 14:17:59 +02:00
Nadav Har'El
0b297b9f6c sstable compaction: simplify compact_sstables() function
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>
2015-06-24 16:44:11 +03:00
Paweł Dziepak
3addb285cd tests/cql: test validation of keyspace and table creation requests
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-23 16:17:45 +02:00
Paweł Dziepak
26ff34060d tests/cql: add assert_that_failed()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-23 16:17:45 +02:00
Tomasz Grabiec
de23b54764 types: Implement to_string()/from_string() for boolean_type 2015-06-23 17:07:37 +03:00
Vlad Zolotarov
efe1696410 cql_test_env: Start the global snitch before storage service
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>
2015-06-23 16:36:27 +03:00
Tomasz Grabiec
d4e0e5957b db: Integrate cache with the read path 2015-06-23 13:49:25 +02:00
Tomasz Grabiec
d11773bc14 tests: Introduce row cache test 2015-06-23 13:49:24 +02:00
Tomasz Grabiec
2b5d9a917f tests: Convert mutation_reader_test to use seastar threads
Also extract assertions into header file.
2015-06-23 13:49:24 +02:00
Tomasz Grabiec
b9288d9fa7 db: Make column_family managed by lw_shared_ptr<>
It will be share-owned by readers.
2015-06-23 13:49:24 +02:00
Tomasz Grabiec
bdd3fd5019 tests: Add missing blank line 2015-06-23 13:44:37 +02:00
Avi Kivity
792a19d40d Merge "global snitch" from Vlad
"
   - 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.
"
2015-06-23 10:49:30 +03:00
Avi Kivity
cbd0be5a68 Merge seastar upstream 2015-06-23 10:46:39 +03:00
Nadav Har'El
9f7794752f sstables: basic compaction 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>
2015-06-23 09:48:59 +03:00
Vlad Zolotarov
319491dad7 gossiping_property_file_snitch_test: check that the distribution
Check that the distribution of the new values between shards works.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-22 23:18:40 +03:00