Commit Graph

349 Commits

Author SHA1 Message Date
Asias He
9377cdcc45 tests: Add exception tests to tests/urchin/message.cc 2015-04-23 14:55:27 +08:00
Asias He
346d00cc8c tests: Add listen-address option to tests/urchin/message.cc 2015-04-23 14:55:27 +08:00
Asias He
5bb42de010 tests: Update load info over the time in tests/urchin/gossip.cc 2015-04-23 14:55:26 +08:00
Avi Kivity
74edad888f Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-04-22 10:12:16 +03:00
Amnon Heiman
8a0538a218 http: fix query parameter parsing of last parameter
When serving a request with multiple query parameters the last parameter
was parsed incorectly.

This fix the issue and add a test to verify it

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-04-21 10:29:14 +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
Asias He
1fb970459c tests: Move tests/message.cc under tests/urchin 2015-04-20 15:30:07 +03:00
Avi Kivity
5d9ab992e8 Merge branch 'tgrabiec/schema-id-fixes-v2' of github.com:cloudius-systems/seastar-dev into db
Fixes related to column_family ID handling, from Tomasz.
2015-04-20 14:33:07 +03:00
Asias He
8ea0d94ece message: Listen on single port 2015-04-20 16:11:01 +08:00
Asias He
b38dae4a2b gossip: Dump failure detector info 2015-04-20 15:49:27 +08:00
Tomasz Grabiec
af6cafd993 tests: Add test for name-based UUID generation 2015-04-17 14:22:29 +02: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
Avi Kivity
2c8b3a8e22 Merge branch 'tgrabiec/tuple_type_iterator' of github.com:cloudius-systems/urchin into db
Iterators for composites, from Tomasz.
2015-04-16 17:52:38 +03:00
Tomasz Grabiec
bacede04b2 types: Expose component iterators in tuple_wrapper
This automatically exposes them in partition_key and clustering_key too.

The iterators return bytes_view to components.

For example:

  schema s;
  partition_key k;

  for (bytes_view component : boost::make_iterator_range(key.begin(s), key.end(s))) {
     // ...
  }
2015-04-16 14:04:04 +02:00
Asias He
6a2eed05fd tests: Gossip around node load info
$ ./gossip --seed 127.0.0.1  --listen-address 127.0.0.1
$ ./gossip --seed 127.0.0.1  --listen-address 127.0.0.2
$ ./gossip --seed 127.0.0.1  --listen-address 127.0.0.3

After a few seconds, all the 3 nodes will know each other's load info
by gossip.

----------- endpoint_state_map dump beg -----------
ep=127.0.0.1, eps=EndpointState: HeartBeatState = generation = 1, version = 0, AppStateMap =  { 1 : Value(0.5,1) }
ep=127.0.0.2, eps=EndpointState: HeartBeatState = generation = 1, version = 0, AppStateMap =  { 1 : Value(0.5,1) }
ep=127.0.0.3, eps=EndpointState: HeartBeatState = generation = 1, version = 0, AppStateMap =  { 1 : Value(0.5,1) }
----------- endpoint_state_map dump end -----------
2015-04-16 17:44:20 +08:00
Asias He
65be3ab711 tests: Allow gossip to listen on a specific IP address 2015-04-16 14:58:52 +08:00
Asias He
0ffa75f3b7 gossip: Allow specify seeds node IP address 2015-04-16 14:58:52 +08:00
Tomasz Grabiec
0f99570555 Introduce bytes_ostream 2015-04-15 20:33:49 +02: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
64579026e6 tests: Rework perf_simple_query to be more parametrizable
It also now supports testing of the write path.
2015-04-15 20:33:47 +02:00
Tomasz Grabiec
699fd10f24 tests: Remove junk code 2015-04-15 20:33:47 +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
Avi Kivity
4a544b3655 tests: add type test for tuples 2015-04-15 15:36:04 +03:00
Tomasz Grabiec
d086f131cf tests: Optimize includes
boost/test/unit_test.hpp is sufficient for tests which link with boost
UTF dynamically. It includes much less headers than
boost/test/included/unit_test.hpp.
2015-04-15 14:27:08 +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
0ce2884b92 tests: Move cql_test_env implementation to .cc file 2015-04-14 15:36:44 +02:00
Tomasz Grabiec
90feb92f48 tests: Move CQL assertions definitions to .cc file 2015-04-14 15:36:44 +02:00
Tomasz Grabiec
6c3b92dccd tests: cql_query_test: Optimize includes 2015-04-14 15:36:43 +02:00
Avi Kivity
1dd3f013c4 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-04-14 15:16:47 +03:00
Avi Kivity
b8f310870a tests: add map_reduce() test 2015-04-14 15:13:15 +03: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
Tomasz Grabiec
aebb05813d Merge branch 'master' of git@github.com:cloudius-systems/seastar.git
Conflicts:
	configure.py
2015-04-14 10:12:27 +02:00
Avi Kivity
e56a81857d Merge branch 'asias/gossip_v1_more' of github.com:cloudius-systems/seastar-dev into db
More gossip conversions, from Asias.
2015-04-13 18:12:18 +03:00
Nadav Har'El
486e6271a1 sstables: data file row reading and streaming
The previous implementation could read either one sstable row or several,
but only when all the data was read in advance into a contiguous memory
buffer.

This patch changes the row read implementation into a state machine,
which can work on either a pre-read buffer, or data streamed via the
input_stream::consume() function:

The sstable::data_consume_rows_at_once() method reads the given byte range
into memory and then processes it, while the sstable::data_consume_rows()
method reads the data piecementally, not trying to fit all of it into
memory. The first function is (or will be...) optimized for reading one
row, and the second function for iterating over all rows - although both
can be used to read any number of rows.

The state-machine implementation is unfortunately a bit ugly (and much
longer than the code it replaces), and could probably be improved in the
future. But the focus was parsing performance: when we use large buffers
(the default is 8192 bytes), most of the time we don't need to read
byte-by-byte, and efficiently read entire integers at once, or even larger
chunks. For strings (like column names and values), we even avoid copying
them if they don't cross a buffer boundary.

To test the rare boundary-crossing case despite having a small sstable,
the code includes in "#if 0" a hack to split one buffer into many tiny
buffers (1 byte, or any other number) and process them one by one.
The tests still pass with this hack turned on.

This implementation of sstable reading also adds a feature not present
in the previous version: reading range tombstones. An sstable with an
INSERT of a collection always has a range tombstone (to delete all old
items from the collection), so we need this feature to read collections.
A test for this is included in this patch.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-04-13 17:40:46 +03:00
Avi Kivity
96d8f8db1a tests: add batch statement test 2015-04-13 14:58:15 +03:00
Asias He
1ad7af3bca gossip: Initial hook of gossip and messaging_service
Register the handler of gossip verbs using ms::register_handler.
Implement send_gossip using ms::send_message. The handlers are only
placeholders for now. Will implement them later.

A periodic timer (1 seconds) is added to send gossip message
periodically.
2015-04-13 14:31:02 +08:00
Raphael S. Carvalho
2ecc93523f sstables: add support to write the component TOC
The on-disk format is about name of the components, where each is
followed by a new line character. The text is encoded using ASCII
code.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-04-11 11:34:38 +03:00
Raphael S. Carvalho
c6e31346d8 sstables: add support to write the component Summary
The definition of summary_la at types.hh provides a good explanation
on the on-disk format of the Summary file.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-04-11 11:24:53 +03:00
Tomasz Grabiec
3a211c4db5 tests: Move seatar-boost test framework to a separate compilation unit
So that it's compiled only once and not for every test. This change
reduced recompilation time for a dummy test module from 40 seconds to
4 on my laptop.

This change also makes it now possible to pass seastar framework command
line arguments to every test using this framework.
2015-04-10 19:34:04 +02:00
Tomasz Grabiec
e87f76ac46 tests: Fix deadlock in ~test_runner
If the engine exits premauterly the _task exchanger may be occupied by
a pending task in which case give() will block indefinitely. Fix by
using interruption.
2015-04-10 19:34:04 +02:00
Tomasz Grabiec
026d169638 tests: exchanger: Add support for interrupting the parties 2015-04-10 19:34:03 +02:00
Avi Kivity
40a0dd1f6f Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-04-09 12:40:33 +03:00
Avi Kivity
ff9536fffc cql3: de-virtualize query_options
query_options is needlessy organized as a class hierarchy, even though it's
really a simple value type.

Fix by folding all the derived classes into it.
2015-04-09 09:31:48 +02:00
Asias He
2f56a360e7 message: Introduce messaging_service
It is built on top of seastar rpc infrastructure. I've sorted out all
the message VERBs which Origin use. All of them can be implemented using
this messaging_service.

Each Verb contains a handler. There are two types of handlers, one
will return a message back to sender, the other will not. The former
can be registered using ms.register_handler(), the latter can be
registered using ms.register_handler_oneway().

Usage example:
To use messaging_service to send a message. All you need is:

messaging_service& ms = get_local_messaging_service();

1) To register a message hander:
   ms.register_handler(messaging_verb::ECHO, [] (int x, long y) {
       print("Server got echo msg = (%d, %ld) \n", x, y);
       std::tuple<int, long> ret(x*x, y*y);
       return make_ready_future<decltype(ret)>(std::move(ret));
   });

   ms.register_handler_oneway(messaging_verb::GOSSIP_SHUTDOWN, [] (empty_msg msg) {
       print("Server got shutdown msg = %s\n", msg);
       return messaging_service::no_wait();
   });

2) To send a message:
    using RetMsg = std::tuple<int, long>;
    return ms.send_message<RetMsg>(messaging_verb::ECHO, id, msg1, msg2).then([] (RetMsg msg) {
        print("Client sent echo got reply = (%d , %ld)\n", std::get<0>(msg), std::get<1>(msg));
        return sleep(100ms).then([]{
            return make_ready_future<>();
        });
    });

    return ms.send_message_oneway<void>(messaging_verb::GOSSIP_SHUTDOWN, std::move(id), std::move(msg)).then([] () {
        print("Client sent gossip_shutdown got reply = void\n");
        return make_ready_future<>();
    });

Tests:
   send to cpu 0
   $ ./message --server 127.0.0.1  --cpuid 0  --smp 2
   send to cpu 1
   $ ./message --server 127.0.0.1  --cpuid 1  --smp 2
2015-04-09 10:54:17 +08: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