Commit Graph

639 Commits

Author SHA1 Message Date
Avi Kivity
6257ef1d83 Merge "Add mutation::live_row_count()" from Tomasz 2015-07-16 10:32:11 +03:00
Tomasz Grabiec
e065480341 tests: Add test for mutation::live_row_count() 2015-07-15 18:56:10 +02:00
Glauber Costa
04c0fbcb8c remove calls to seal_active_memtable
It should not be called directly: externall callers should be calling flush()
instead.

To be sure it doesn't happen again, make seal_active_memtable private.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-15 10:24:20 -04:00
Glauber Costa
ad46daa6aa column_family: add the commitlog as a parameter
When we create a column family, we can pass as an extra parameter, the
commitlog - or lack thereof. Because the commitlog is optional to begin with -
it won't exist if we don't call init_commitlog, we can have this to be empty
meaning no commit log.

The creation of a column family should be always done through
add_column_family. And if that is the case, we have the database's commitlog
right there and can get the pointer through the db. Only tests are not creating
the column family this way, and for them, it is fine.

We want to do that, because some column family operations will use the commit log.
Right now, they are forcing us to add parameters to APIs that would be much cleaner
without it. So while separation is good, this level of coupling is a net win as it
allows us to clean up some visible APIs.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-15 10:24:20 -04:00
Tomasz Grabiec
c206699c9d Merge tag 'avi/logger-config/v1' from seastar-dev.git
Logger configuration from Avi.
2015-07-15 11:27:09 +02:00
Tomasz Grabiec
e1b4d0c29b Merge branch 'pdziepak/order-by-fixes/v2' from seastar-dev.git
"Fixes for ORDER BY clauses" from Pawel.

"The patches fix several issues in CQL3 frontend related to ORDER BY
clauses. Also, column component indexes are now handled properly and it
is possible to create tables with more than one column in clustering key."
2015-07-15 12:09:55 +03:00
Tomasz Grabiec
161744e8f9 tests: Add more tests for sstable range queries 2015-07-14 19:58:18 +02:00
Tomasz Grabiec
0bd4b77498 tests: Introduce reader_assertions::produces() which takes a vector 2015-07-14 19:58:18 +02:00
Tomasz Grabiec
19efb43354 tests: Add missing include to mutation_reader_assertions.hh 2015-07-14 19:58:18 +02:00
Tomasz Grabiec
6a5943267a tests: Extract tmpdir class from commitlog_test to tmpdir.hh
It will be useful in other tests too.
2015-07-14 19:58:18 +02:00
Tomasz Grabiec
0dc49434ad tests: Make tmpdir more generic 2015-07-14 19:58:17 +02:00
Tomasz Grabiec
5cab8bc759 tests: Deal with non-empty directory in ~tmpdir 2015-07-14 19:58:17 +02:00
Paweł Dziepak
56bcf40c5e tests/cql: add test cases for ORDER BY
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-14 19:34:28 +02:00
Avi Kivity
99a15de9e5 logger: de-thread_local-ize logger
The logger class constructor registers itself with the logger registry,
in order to enable dynamically setting log levels.  However, since
thread_local variables may be (and are) initialized at the time of first
use, when the program starts up no loggers are registered.

Fix by making loggers global, not thread_local.  This requires that the
registry use locking to prevent registration happening on different threads
from corrupting the registry.

Note that technically global variables can also be initialized at the
point of first use, and there is no portable way for classes to self-register.
However this is the best we can do.
2015-07-14 17:18:11 +03:00
Avi Kivity
0171dfbf81 tests: drop http server from messaging test
Not needed, and doesn't compile.
2015-07-13 13:20:56 +03:00
Avi Kivity
8c7bcf52e2 Merge seastar upstream 2015-07-12 17:06:14 +03:00
Avi Kivity
35f29dcdb4 fstream: add read-until-end tests without knowning the file size beforehand 2015-07-12 16:52:24 +03:00
Tomasz Grabiec
18c48dbb14 tests: Add test for inserting a row without setting any regular column 2015-07-12 15:04:38 +02:00
Tomasz Grabiec
28c1c3eaf1 tests: Use 'update' instead of 'insert' in test_ttl
We don't really handle expiration of entrie rows yet, due to issue #17.

Fixing a bug in 'insert' made this test start to fail because the
expired row started to appear in the results. Until #17 is fixed,
let's use 'update' to create the row, so that the expectations are
met.
2015-07-12 15:04:38 +02:00
Tomasz Grabiec
674dfdcf25 tests: Test consistent ordering of partitions in range queries
In Origin, partitions in range query results are ordered using
decorated_key ordering. This allows the use of token() function for
incremental iterating over results, as mentioned here:

http://www.datastax.com/dev/blog/client-side-improvements-in-cassandra-2-0
2015-07-12 12:54:39 +02:00
Tomasz Grabiec
6f5c00c515 tests: Add test for mutation queries 2015-07-12 12:54:38 +02:00
Tomasz Grabiec
c084a86de6 tests: Add more tests for data queries 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
9a0c48d829 tests: Switch to partition_slice_builder in mutation_test 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
31081f91c4 tests: Fix row_assertion::matches() to deal with empty boost::any properly 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
197196c6b0 tests: Introduce result_set_assertions::has_size() 2015-07-09 19:55:00 +02:00
Tomasz Grabiec
5af1769326 tests: Add more CQL query tests 2015-07-09 19:55:00 +02:00
Tomasz Grabiec
c742529e52 bytes_ostream: Introduce retract()
Useful for optimistic writers, where it's easier/cheaper to retract
later than to calculate the decision up front.
2015-07-09 19:55:00 +02:00
Tomasz Grabiec
da937897cf memtable: Introduce as_data_source() 2015-07-09 19:46:29 +02:00
Tomasz Grabiec
c3f7856853 bytes_ostream: Introduce fragment iterator 2015-07-09 18:53:03 +02:00
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