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>
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>
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>
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>
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>
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.
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>
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.
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>
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>
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
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.