Commit Graph

2265 Commits

Author SHA1 Message Date
Avi Kivity
e6828d7ad0 Merge branch 'master' of github.com:cloudius-systems/seastar into db
Conflicts:
	configure.py
2015-03-15 20:39:30 +02:00
Avi Kivity
d2c0e485f8 posix: fix posix::recv return
Shuts up warning in gcc 5, and is aligned with the other methods.
2015-03-15 20:18:17 +02:00
Avi Kivity
24bc1b4126 build: improve seastar.pc generation
Generate at build time, so it gets rebuilt even if build/ is wiped out.
2015-03-15 18:13:29 +02:00
Nadav Har'El
25c37c92f5 core: fix engine_exit()
engine_exit() without a parameter is meant to do engine().exit(0).
We do this, but forget to return from this function, so after calling
engine().exit(0), it continued on and crashed.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-15 16:17:25 +02:00
Avi Kivity
f8c69904cd build: fix seastar.pc generation
Need to ensure the directory is there first.
2015-03-15 16:16:41 +02:00
Nadav Har'El
3578d3d016 build: make it easy to compile a Seastar-based project
This patch makes compiling a file "hello.cc" using seastar as simple as:

g++ `pkg-config --cflags --libs build/release/seastar.pc` hello.cc

Our current build system makes it very hard for users to build a project
*using* Seastar - basically requiring them to integrate their project into
the Seastar tree and its Makefile into our "ninja" framework.

This patch simplifies things considerably by doing two things:

First it builds an archive of all Seastar objects - build/$mode/libseastar.a.

But this in itself is not enough - the user wouldn't know how to use it
(currently, -Wl,--whole-archive is needed, unfortunately, because of reliance
of C++ static constructors), and will also need a long list of other
libraries, as wall as various definitions and include paths during compilation.

The solution is to use pkg-config, which has become the de-facto standard
method on Linux for makefiles to figure out how to compile with a certain
library. With this patch, someone can do this for example, to compile
tests/fileiotests.cc:

g++ `pkg-config --cflags --libs build/release/seastar.pc` tests/fileiotest.cc

Note how we have a different ".pc" file for each mode, with the appropriate
compile and link flags. A more eleborate example with separate compile and
link stages will use "pkg-config --cflags" on the compilation stage, and
"--libs" on the linking stage.

Eventually, we should have a "ninja install", which will install libseastar.a
and seastar.pc to their system-wide default location, and then the above
command line will become as simple as:

g++ `pkg-config --cflags --libs seastar` tests/fileiotest.cc

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-15 15:49:48 +02:00
Nadav Har'El
d1601b46f2 net: implement net::packed<> in terms of unaligned<>
The previous patch moved most of the functionality of net::packed<>
into a new template unaligned<> (in core/unaligned.hh). So in this
patch we implement net::packed<> in terms of unaligned<>. The former
is basically the same as the latter, with the addition of the
"adjust_endianness" feature that the networking code expects.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-15 15:45:14 +02:00
Nadav Har'El
1f8e0dbbab unaligned: new header file for unaligned access
This patch adds a new header file, "core/unaligned.hh", which defines a
new operation, unaligned_cast<T*>(p). This works exctly like
reinterpret_cast<T*>(p) except it is safe to use even when the address
of p is not a multiple of alignof(T).

A long comment in the header file explains why this unaligned_cast<>
is necessary on some esoteric architectures and to quiet gcc's
-fsanitize=alignment.

The header file also defines a new template for holding an unaligned
version of type - unaligned<T>. unaligned<T> is almost identical to our
existing net::packed<>, so the next patch will implement net::packed
in terms of unaligned<>.

The unaligned_cast<> and unaligned<> templates are of course generally
useful outside the network code, which is why I wanted them out of the
networking header files and namespace.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-15 15:44:56 +02:00
Avi Kivity
bd00d90806 Merge branch 'gleb/future' of github.com:cloudius-systems/seastar-dev
Future implementation cleanup, from Gleb.
2015-03-15 15:33:25 +02:00
Avi Kivity
d3acb5acc2 linecount: better error handling 2015-03-15 14:48:52 +02:00
Avi Kivity
0537a8ffe5 linecount: don't try to create the file.
It's read-only.
2015-03-15 14:48:31 +02:00
Gleb Natapov
c3ba8678e4 core: consolidate finally() implemetations 2015-03-15 14:44:58 +02:00
Gleb Natapov
186e25717e core: consolidate then() and then_wrapped() code 2015-03-15 14:18:43 +02:00
Gleb Natapov
ad63b70d53 core: remove unused structure future_task 2015-03-15 14:11:51 +02:00
Gleb Natapov
c138e31a2a core: check future_avail_count in then_wrapped 2015-03-15 12:41:26 +02:00
Gleb Natapov
ecb72e995a core: drop superfluous qualifier from or_terminate 2015-03-15 12:18:44 +02:00
Glauber Costa
bcf7e42933 column mask
Each column has a byte in the file that determines how to process whatever
data comes next. In the actual file, we can see one of those values, or a
combination of them.

Because it is an enum, no new parser is needed.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-03-15 10:47:34 +02:00
Glauber Costa
4e73bf8b11 sstables: deletion_time structure
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-03-15 10:47:33 +02:00
Tomasz Grabiec
74e34ed6a4 core: Use futurize<> to simplify smp::submit_to() 2015-03-14 11:40:48 +02:00
Tomasz Grabiec
7bc7951192 core: Use perfect forwarding in invoke_on()/submit_to()
Makes invoking non-copyable lambdas possible:

  distributed<T> t;

  non_copyable_type x;
  t.invoke_on(0, [x = std::move(x)] (auto& t) {});

As a side effect this could save some copyable lambdas from being
needlesly copied.
2015-03-13 19:20:13 +02:00
Pekka Enberg
be1e8362bb cql3: Use copy semantics for CF name
Use copy semantics for CF name because in some cases we are passing a
reference to another class instance field (e.g. for create table
statements).

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-13 09:43:47 +01:00
Avi Kivity
9e6b529f91 build: reduce merge conflicts in configure.py test specification 2015-03-12 16:31:43 +02:00
Avi Kivity
df7bb8cc58 Merge branch 'master' of github.com:cloudius-systems/seastar into db
Conflicts:
	configure.py
2015-03-12 16:31:17 +02:00
Avi Kivity
d5817ab965 Merge branch 'gleb/rpc' of github.com:cloudius-systems/seastar-dev
Conflicts:
	configure.py
2015-03-12 16:30:15 +02:00
Tomasz Grabiec
24c29f8947 Merge remote-tracking branch 'dev/penberg/cleanups' 2015-03-12 15:16:42 +01:00
Shlomi Livne
83998a8934 tests: Boostify the fstream_test
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-12 15:56:25 +02:00
Gleb Natapov
7adf4f935d rpc test program 2015-03-12 15:38:18 +02:00
Gleb Natapov
36b76af7cc Implementation of rpc
To register rpc handler func(param1, param2, param3) both server and client

auto remote_func = myrpc.register_handler(id, func);

This call will return another function that client can use to invoke RPC
calls like this:

remote_func(client, param1, param2, param3);

This call will return future<> with func() result.
2015-03-12 15:38:18 +02:00
Shlomi Livne
83c0196255 tests: make sure each SEASTAR_TEST_CASE has at least a single BOOST_XXX check
SEASTAR_TEST_CASE that did not execute a single BOOST_XXX check was
maakred as "[Message] - Test case .... did not check any assertions" and
is placed in /usr/include/boost/test/impl/results_collector instead of
the correct test file.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-12 15:21:29 +02:00
Pekka Enberg
84d402447f exceptions: Remove TransportException.java
The class was converted to C++ in commit 6601e6a ("exceptions: Convert
SyntaxException and its base classes").

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 13:03:52 +02:00
Pekka Enberg
22a6066730 Revert "cql3: Fix create_keyspace_statement::prepare()"
This reverts commit c72f5796c4. It is no
longer needed after commit 8628d98 ("shared_ptr: fix reference count
loss when creating a derived type with e_s_f_t").

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>

Conflicts:
	cql3/statements/schema_altering_statement.hh
2015-03-12 13:02:53 +02:00
Tomasz Grabiec
2ee58d66d6 Merge tag 'avi/collections/v3'
Conflicts:
	tests/urchin/cql_query_test.cc

[tgrabiec: fixed compilation error in cql3/maps.hh]
2015-03-12 11:30:17 +01:00
Tomasz Grabiec
ca046f00fc Merge remote-tracking branch 'dev/penberg/create-keyspace-stmt'
From Pekka:

This series adds 'create keyspace' support to the CQL parser and AST
executor. As a side-effect, we pull metadata classes from config as well
as migration manager from services.

Please note that migration manager is a stub for now so no actual
keyspace is created in the database internals.
2015-03-12 10:31:32 +01:00
Pekka Enberg
3f019ee9c0 tests: create keyspace statement test case
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:30:25 +02:00
Pekka Enberg
e1948dcc0c cql3: Convert create_keyspace_statement to C++, take 2
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:30:25 +02:00
Pekka Enberg
f2d0f325d4 exceptions: Add already_exists_exception class
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
5b3922f860 transport: Convert Event.SchemaChange constructors, take #2
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
07e73bdb26 cql3/Cql.g: Implement convert_property_map() helper
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
bcb6c1b9c3 service: Convert MigrationManager to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
5bdf0e4429 service: Import MigrationManager.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
2bff7888b6 unimplemented: Add MIGRATIONS
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
6f15c18f0a cql3: Convert KSPropDefs to C++, take #2
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
57e6c63b7a cql3: Convert statements.PropertyDefinitions to C++, take 3
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Pekka Enberg
75a3595691 config: Convert KSMetaData to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-12 10:29:51 +02:00
Avi Kivity
d41b4e57ad tests: add test for map literal and setting a map value by key 2015-03-12 10:22:17 +02:00
Avi Kivity
20e616131f cql3: convert grammar for map literals and setting a map value by key 2015-03-12 10:22:17 +02:00
Avi Kivity
6e646efb85 cql3: implement operation::setter::prepare() for maps 2015-03-12 10:22:17 +02:00
Avi Kivity
1172f65d50 cql3: convert maps::setter_by_key to C++ 2015-03-12 10:22:17 +02:00
Avi Kivity
a64cd8f22f cql3: convert maps::literal to C++ 2015-03-12 10:22:17 +02:00
Avi Kivity
0f793f1aa7 cql3: convert maps::delayed_value to C++ 2015-03-12 10:22:15 +02:00