Commit Graph

86 Commits

Author SHA1 Message Date
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
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
5af1769326 tests: Add more CQL query tests 2015-07-09 19:55:00 +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
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
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
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
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
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
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
Pekka Enberg
6a65b0e684 cql_query_test: Use CQL table with static columns
Use CQL for table creation now that static columns actually work.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 16:34:22 +03:00
Pekka Enberg
fcb18e9550 cql_query_test: Use CQL for table creation where possible
Use CQL for creating tables instead of the low-level in-memory APIs
where possible.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 16:01:36 +03:00
Pekka Enberg
3d9785677a cql_query_test: Verify 'create table' statement operation
Add a require_table_exists() assertion after 'create table' statement is
executed to ensure in-memory schema is updated accordingly.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 15:48:18 +03:00
Gleb Natapov
c2f975bee9 test querying of multiple singular ranges 2015-06-11 15:18:07 +03:00
Pekka Enberg
d088cb8181 Fix keyspace strategy options to preserve key-value ordering
Fix keyspace strategy options to preserve key-value ordering by
switching to std::map. We need this to be able to store the map in
database as JSON because unordered maps can cause the schema merging
code to attempt a keyspace update, which we don't support, even though
the values did not change.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-11 13:02:42 +03:00
Vlad Zolotarov
a2594015f9 locator: futurize snitch creation
- Forbid explicit snitch creation with constructor.
   - Allow the creation of snitches only with locator::make_snitch() template
     function.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v4:
   - Make sure the snitch is stopped before it's destroyed when _snitch_is_ready
     is returned in an exceptional state.

New in v2:
   - Change snitch_ptr to be std::unique_ptr<i_endpoint_snitch>
   - abstract_replication_strategy::create_replication_strategy(): explicitly
     specify (template) types of create_object() parameters.
   - Re-arrange the loop in marge_keyspaces() so that lambdas that depend on
     "this" complete before there is a chance that "this" gets destroyed.
   - create_keyspace(): Don't add a new keyspace if a keyspace with this name
     already exists.
   - i_endpoint_snitch: added a stop() virtual method
      - Added a stop() pure virtual method.
      - Added an enum class snitch_state and a _state member initialized to snitch_state::initializing,
        added an assert() in a destructor requiring _state to become snitch_state::stopped,
        which should be set when stop() is complete.
   - rack_inferring_snitch: added a stop() method.
   - simple_snitch: added a stop() method.
   - Added stop() methods to abstract_replication_strategy and keyspace.
   - Updated database::stop() to wait for all keyspaces in _keyspaces to stop.
2015-06-09 15:33:38 +03:00
Pekka Enberg
4dc488afb2 database: Store metadata in 'struct keyspace'
Store a lw_shared_ptr<keyspace_metadata> in struct keyspace so callers
in migration manager, for example, can look it up.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-25 09:12:29 +02:00
Pekka Enberg
cd35617855 database: Use keyspace_metadata for creation functions
Use the keyspace_metadata type for keyspace creation functions. This is
needed to be able to have a mapping from keyspace name to keyspace
metadata for various call-sites.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-19 15:27:47 +03:00
Pekka Enberg
33b37f7954 cql: Fix replication strategy class lookup
Fix replication strategy class lookup to support unqualified names such
as "SimpleStrategy". The AbstractReplicationStrategy.getClass() method
in origin does the same thing.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-06 10:01:00 +03:00
Tomasz Grabiec
cae462c534 Merge remote-tracking branch 'dev/penberg/keyspace-merging/v5' from seastar-dev.git
From Pekka:

"This patch series converts LegacySchemaTables keyspace merging code to
C++. After this series, keyspaces are actually created as demonstrated
by the newly added test in cql_query_test.cc."
2015-04-28 18:06:23 +02:00
Pekka Enberg
987d7ba698 tests: Make create keyspace test case more robust
Add an assertion to check that the newly created keyspace actually
exists.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-04-28 15:49:34 +03:00
Tomasz Grabiec
02eb356cae Merge tag 'avi/remedial-collections-1/v1' from seastar-dev.git
Implementation of missing collections functionality from Avi.
2015-04-28 14:28:14 +02:00
Avi Kivity
4e91a3b005 tests: add test for list append/prepend operations 2015-04-28 12:13:38 +03:00
Avi Kivity
803481792b tests: test cql3 type-cast with user-defined types 2015-04-26 19:25:39 +03:00
Avi Kivity
fcaf33328f tests: fix test_user_type comment 2015-04-26 19:25:39 +03:00
Avi Kivity
08932571c1 tests: add user type literal test 2015-04-20 16:15:35 +03:00
Avi Kivity
55ec6bb923 tests: add user type test 2015-04-20 16:15:35 +03:00
Avi Kivity
1aaa8c2f13 tests: fix cql_query_test tuple_test using a data_type on multiple cores
Pointed out by Tomek.
2015-04-16 18:39:43 +03: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
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
74b26af532 tests: add cql tuple tests 2015-04-15 15:36:06 +03:00
Tomasz Grabiec
452507ceb6 Merge tag 'avi/element_deletion/v2' from seastar-dev.git to db 2015-04-14 15:59:53 +02:00
Tomasz Grabiec
6c3b92dccd tests: cql_query_test: Optimize includes 2015-04-14 15:36:43 +02:00
Avi Kivity
1e0bd3503a tests: add deletion operation tests for maps, sets, and lists 2015-04-14 12:25:30 +03:00
Tomasz Grabiec
9ad074f062 Merge tag 'avi/batch_statement/v1' from git@github.com:cloudius-systems/seastar-dev.git
From Avi:

Note transport support for per-statement bind variables is not there yet.
2015-04-14 11:20:39 +02:00
Tomasz Grabiec
3758fb5dcf tests: Fix build failure caused by the merge 2015-04-14 10:28:20 +02:00
Avi Kivity
96d8f8db1a tests: add batch statement test 2015-04-13 14:58:15 +03:00
Avi Kivity
f0e10b34d4 tests: clean up test_writetime_and_ttl
- correct comment
- use with_rows()
- use USING WRITETIME syntax instead of hacking up the query_options
2015-04-08 13:28:44 +02:00
Avi Kivity
dad3a3dd38 tests: test cql3 type cast
(text)'foo' is itself.  Wow!
2015-04-08 09:34:45 +02:00
Avi Kivity
e66fb58423 tests: test cql3 collection type syntax in "create table" 2015-04-07 20:14:37 +03:00
Avi Kivity
14d668c07a tests: add WRITETIME test 2015-04-07 16:17:56 +03:00
Avi Kivity
50b8ddd62a tests: add test for COUNT(*) and COUNT(1) 2015-04-06 19:09:35 +03:00
Avi Kivity
9e3c41436b cql3: test aggregate functions in select path 2015-04-05 16:07:31 +03:00
Avi Kivity
5198292165 tests: add function call test
Test now() function.
2015-04-01 21:06:37 +03:00
Avi Kivity
2642f82d89 Merge branch 'tgrabiec/tests' of github.com:cloudius-systems/seastar-dev into db
Use cql_test_env in tests, from Tomasz.
2015-03-31 18:14:24 +03:00
Tomasz Grabiec
7b6d340d8a tests: Convert all test cases in cql_query_test.cc to use cql_test_env
Reduces duplication.
2015-03-31 15:58:44 +02:00
Tomasz Grabiec
eddb479ec4 tests: Move CQL response assertions to cql_assertions.hh 2015-03-31 15:56:59 +02:00
Tomasz Grabiec
3da0c3035f tests: Add test for querying static row with limit and many ranges 2015-03-30 18:38:26 +02:00