Commit Graph

53948 Commits

Author SHA1 Message Date
Amnon Heiman
e5007f49ae Adding the API to urchin
This adds the API to urchin, all API related files will be placed under
the api directory.

The API server uses a context object to access global parameters,
typically the different servers themselves.

After this patch the api-doc will be available, though empty under:
http://localhost:10000/api-doc

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-04-13 18:57:14 +03:00
Nadav Har'El
bae3cbf7a2 db: fix typo in set_type_impl user-visible name
Noticed this typo while browsing the code. I have no idea what this typo
broke, if anything, but it couldn't have been intentional...

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-04-13 18:53:03 +03: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
e03a23b53a future: add std::accumulate-style map_reduce variant 2015-04-13 17:11:44 +03:00
Avi Kivity
6e185d21f0 future: remove bogus when_all() forward declaration
Doesn't match the definition, and is unneeded anyway.
2015-04-13 16:23:33 +03:00
Avi Kivity
96d8f8db1a tests: add batch statement test 2015-04-13 14:58:15 +03:00
Avi Kivity
f5e585bc38 cql3: enable batch statement grammar 2015-04-13 14:58:03 +03:00
Avi Kivity
656bd17de2 cql3: convert batch_statement to C++ 2015-04-13 14:57:22 +03:00
Avi Kivity
af4061e372 cql3: make modification_statement::get_mutations() public
batch_statement wants it.
2015-04-13 14:55:47 +03:00
Avi Kivity
f1fe44a407 cql3: add batch support to query_options
Transport support yet to be wired up.
2015-04-13 14:55:07 +03:00
Asias He
5bf282c56b gossip: Drop #if 0'ed code which is converted already 2015-04-13 15:26:18 +08:00
Asias He
5cf9fbebc0 gossip: Switch to use get_cluster_name and get_partitioner_name 2015-04-13 15:20:37 +08:00
Asias He
bd16d9e291 gossip: Add cluster_id() and partioner() helper for gossip_digest_syn 2015-04-13 15:19:51 +08:00
Asias He
a2af07ba71 gossip: Convert do_shadow_round 2015-04-13 15:14:09 +08:00
Asias He
16deb4af35 gossip: Add get_cluster_name and get_partitioner_name helper
DatabaseDescriptor.getClusterName and .getPartitionerName
are not ready. Add helpers to wrap them up.
2015-04-13 15:12:04 +08:00
Asias He
d7f053a494 gossip: Implement GossipDigestSynVerbHandler 2015-04-13 14:31:02 +08:00
Asias He
3809934a05 gossip: Add operator< for gossip_digest 2015-04-13 14:31:02 +08:00
Asias He
e21d38684d gossip: Add default constructor for gossip_digest 2015-04-13 14:31:02 +08:00
Asias He
005a88699f gossip: Remove const for gossip_digest 2015-04-13 14:31:02 +08:00
Asias He
c1325f8cbe gossip: Implement GossipDigestAckVerbHandler 2015-04-13 14:31:02 +08:00
Asias He
7ee239e7e7 gossip: Implement GossipDigestAck2VerbHandler 2015-04-13 14:31:02 +08: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
Asias He
5dc18de0f8 gossip: Move some of gms/gossiper.hh code to gms/gossiper.cc
This makes it possible to call get_local_failure_detector() in gossiper.
Otherwise there is a cyclic dependency between gms/gossiper.hh and
gms/failure_detector.hh
2015-04-13 14:30:52 +08:00
Avi Kivity
de2bb71432 cql3: fix bad bracing in maps.hh
Random open and close brace, luckily no harm done.
2015-04-12 15:13:54 +03:00
Avi Kivity
5f7f925ca0 cql3: convert lists::discarder_by_index to C++ 2015-04-12 15:13:54 +03:00
Avi Kivity
6d402ab2a0 db: allow read_simple_exactly with const input
As read_simple_exactly consumes all its input, there is no need to adjust
it to communicate the amount of data consumed.
2015-04-12 15:13:54 +03:00
Avi Kivity
0bc505b5ad cql3: remove gunk from modification_statement 2015-04-12 11:18:58 +03:00
Avi Kivity
4d38dfc303 cql3: enable grammar for delete statement conditions 2015-04-12 11:12:22 +03:00
Avi Kivity
5f05fa7087 cql3: move function_call.hh code to .cc file 2015-04-11 17:31:54 +03: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
Avi Kivity
a190f2db79 db: drop compile-time dependeny on sstables
Move #include "sstables.hh" to .cc file.  Need to explicitly define
destructor for this.
2015-04-11 11:27:48 +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
Glauber Costa
a505ac487f sstables: use bytes instead of sstring
We should have done that from the start

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-04-11 11:22:30 +03:00
Avi Kivity
44eaca2204 Merge branch 'primitives' into urchin
Enable float and double.
2015-04-11 11:08:42 +03:00
Avi Kivity
88d02120f4 Merge branch 'tgrabiec/optimize-compilation' of github.com:cloudius-systems/seastar-dev 2015-04-11 11:01:35 +03:00
Avi Kivity
339bf29753 cql3: enable float and double types in grammar 2015-04-11 00:54:44 +03:00
Avi Kivity
77552d3407 db: fix float_type's implementation
Was double, should be float.
2015-04-11 00:54:10 +03:00
Avi Kivity
e5a35ea048 db: add equality compare operators to serialization_format 2015-04-10 22:26:41 +03:00
Avi Kivity
e9774fe1e1 db: adjust lexicographical_tri_compare to take a bounded type list
When comparing tuples, we don't want to overrun the type list.
2015-04-10 22:26:41 +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
Tomasz Grabiec
fd18edc652 core: Do not let exceptions out of posix thread callback
If the callback throws the program will segfault and GDB will be
useless in diagnosing the failure:

  gdb$ run
  ...
  thread_get_info_callback: cannot get thread info: generic error
  gdb$

So let's fail in a better way.
2015-04-10 18:46:13 +02:00
Calle Wilund
819bf6244e collectd: remove extra braces from parameter packing expression
Added to make clang happy, but causes compilation failure with more than
one bound value in value list. Using paranthesis instead.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-04-09 12:48:45 +03:00
Calle Wilund
1bdf366f79 reactor: fix broken errno check fixing missing file behaviour
Code checked "result" instead of "error" (where actual error code is)

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-04-09 12:46:43 +03: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
5bfd66770b Merge branch 'asias/message_v3_rebase' of github.com:cloudius-systems/seastar-dev into db
Cluster messaging service, from Asias.
2015-04-09 12:08:34 +03:00
Avi Kivity
b264aea0a3 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-04-09 12:08:24 +03:00
Glauber Costa
aa1f33df22 output_stream: generalize basic_sstring writes further
The current code assumes that the sstring will have the same char_type as the
output_stream.  That was working well, until I was forced to change the type of
my basic_sstring to another one that is backed by signed chars.

Of course, the best solution for this would be to change the output_stream (as
well as the input_stream), to take a signed char as well.

And oh boy, have I tried. The data_sink assumes a char type, and when it tries
to allocate a new buffer from it, the buffer will have no other choice than to
be of a char type. Fix that one, and another one appears.

I eventually gave up when the code wouldn't compile because struct fragment has
a char type - and both using a template for such a simple struct, as well as
sprinkling casts all over the place where it is used, sounded like horrible
ideas to me.

It's true that quitters never win, and winners never quit. But for now, my
proposal would be to generalize the write code to accept basic_sstrings of
general types. At least the cast lives in a single place.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-04-09 12:03:40 +03:00