Commit Graph

54 Commits

Author SHA1 Message Date
Asias He
c19f5edefe messaging_service: Add wrapper for READ_MUTATION_DATA verb 2015-07-16 17:23:26 +08:00
Asias He
85c6dc0b7e messaging_service: Add wrapper for READ_DATA verb 2015-07-16 17:23:26 +08:00
Asias He
0707c15000 messaging_service: Add wrapper for MUTATION_DONE verb 2015-07-16 17:23:26 +08:00
Asias He
196c7d6f2b messaging_service: Add wrapper for MUTATION verb 2015-07-16 17:23:22 +08:00
Asias He
857fa5ccbb messaging_service: Add wrapper for STREAM_MUTATION verb 2015-07-16 17:19:51 +08:00
Asias He
1f6a76f2a0 messaging_service: Add wrapper for PREPARE_MESSAGE verb 2015-07-16 17:19:51 +08:00
Asias He
49b80535d9 messaging_service: Add wrapper for DEFINITIONS_UPDATE verb 2015-07-16 17:19:51 +08:00
Asias He
47503d0eaf messaging_service: Add wrapper for verbs used by gossip
Tested with tests/urchin/gossip.cc.
2015-07-16 17:19:51 +08:00
Asias He
ec0c1187ff messaging_service: Add out of line destructor 2015-07-16 17:19:50 +08:00
Tomasz Grabiec
c304b83e8d messaging_service: Fix read_serializable()
The "v" parameter points to uninitialized object in RPC deserializer,
but db::serializer<>::read() variant with output parameter assumes it
is initialized.

Spotted by Gleb. Should fix #21.
2015-07-16 06:50:28 +03:00
Asias He
5d68f33fd1 messaging_service: Introduce wrapper for rpc::protocol::{client, server}
In order to make user of incomplete types of them, we need the wrappers.

Later, we can move the definition of the wrappers to .cc files.
2015-07-15 14:17:04 +03:00
Asias He
6191fcb62e messaging_service: Add wrapper for STREAM_INIT_MESSAGE verb
This patch serves as an example of how we can add wrappers for
ms.send_message and ms.register_handler.

When we convert all the users of them, we can make messaging_service.hh
do not include rpc.hh.
2015-07-15 14:17:04 +03:00
Asias He
3376b15157 messaging_service: Define _server as unique_ptr 2015-07-15 14:56:40 +08:00
Asias He
569a533d89 messaging_service: Switch rpc_protocol _rpc to std::unique_ptr<rpc_protocol> _rpc
Preparation for not including rpc.hh. Make it a pointer so we can use
rpc_protocol as incomplete type.
2015-07-15 14:56:37 +08:00
Asias He
91de9fe94f messaging_service: using rpc_protocol = rpc::protocol<serializer, messaging_verb> 2015-07-15 14:56:35 +08:00
Asias He
ef8cfb3db9 messaging_service: Move code of messaging_service to source file 2015-07-15 14:22:35 +08:00
Asias He
c0335f38d6 messaging_service: Move code for shard_id into source file
Also, no reason to keep shard_id inside messaging_service class, move
it out.
2015-07-15 14:22:02 +08:00
Tomasz Grabiec
5b332c6f7c messaging_service: Add RPC call for mutation queries. 2015-07-12 12:54:38 +02:00
Tomasz Grabiec
82a61e92fa messaging_service: Use generic serializer adaptor for frozen_mutation 2015-07-12 12:54:38 +02:00
Tomasz Grabiec
0573844deb messaging_service: Add adaptors for types having db::serializer<> 2015-07-12 12:54:38 +02:00
Tomasz Grabiec
e865740abe messaging_service: Extract integral reading logic 2015-07-12 12:54:38 +02:00
Asias He
cdf50aa078 messaging_service: Add STREAM_MUTATION verb
It is used by streaming service to send frozen_mutation.
2015-07-09 15:52:28 +08:00
Asias He
c41872a64d messaging_service: Move serialization code frozen_mutation to source file 2015-07-09 15:52:27 +08:00
Asias He
a773c151a3 messaging_service: Move serialization code for sstring to source file 2015-07-09 15:52:27 +08:00
Asias He
ff5e80bd35 messaging_service: Move serialization code for messaging_verb to source file
It is *HUGE* pain to modify one line of the code in messaging_verb.hh and
wait like forever until urchin compiles.
2015-07-09 15:52:27 +08:00
Avi Kivity
dd29ac9593 Merge "cqlsh" from Glauber
System table Work to make cqlsh connect.
2015-07-07 19:33:23 +03:00
Glauber Costa
ba33af1a8d service: split messaging service initialization in two parts
The messaging service is initialized very early, before we have the
proxy or query processor initialized. It is mostly fine, except for
the fact that the messaging service also finishes the initialization
of the storage service. That part will issue queries agains the system
tables, (as soon as we support them), and need to happen later.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Avi Kivity
c77761a8b1 messaging: improve serialization for vectors
Various enable_if overload take precedence if a non-const frozen_mutation
is provided (instead of matching the const frozen_mutation& signature).

Provide a non-const frozen_mutation& signature to work around the issue.
2015-07-07 16:48:41 +03:00
Avi Kivity
228762421c messaging: support complex types in vector<> serialization
do_with() required a movable type, but the union U is not movable if the
vector element type is not, with out help from us.
2015-07-07 16:48:41 +03:00
Pekka Enberg
8a897f2979 message/messaging_service: Add versioning stubs
We only support one version for now but it's easier to convert callers
if the APIs are there.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-07 16:27:58 +03:00
Gleb Natapov
e5ab062f05 messaging: fix vector serialization
Hold on U with do_with since having it in capture is incorrect in case
lambda is moved.
2015-07-05 11:58:08 +03:00
Gleb Natapov
4b9661c608 initial read clustering code
Works only if all replicas (participating in CL) has the same live
data. Does not detects mismatch in tombstones (no infrastructure yet).
Does not report timeout yet.
2015-07-01 13:36:30 +03:00
Gleb Natapov
730170ff1a serialize data structures needed for read clustering 2015-07-01 13:36:28 +03:00
Gleb Natapov
d8dcceea09 stop storage and messaging services during exit 2015-06-18 15:13:02 +03:00
Gleb Natapov
89c74707d0 message: terminate all connections while stopping 2015-06-18 15:13:02 +03:00
Asias He
2dd2c8551a messaging_service: Add messageing verb used by streaming 2015-06-17 16:08:37 +08:00
Amnon Heiman
896f562de7 Adding dropped messages counter to messaging_service
This adds a drop messages counter per verb type to the messaging
service. It will be used by the API to return the number of dropped
messages.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-16 14:35:21 +03:00
Amnon Heiman
b236e85961 Add a foreach_client method to the messaging service
The messaging service holds a table of clients which the API needs
information from. This adds a foreach_client method that recieve a
functions and itererate over all the clients calling the given function
on each of them.

This implementation support the current table that holds unique ptr.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-16 14:35:21 +03:00
Gleb Natapov
969134280a initial mutation clustering code 2015-06-15 12:53:10 +03:00
Gleb Natapov
0657396fcb message: add generic std::vector serializer 2015-06-15 12:51:09 +03:00
Gleb Natapov
238a9d5d30 move init_messaging_service from main 2015-06-15 12:48:00 +03:00
Gleb Natapov
699a47342d message: drop tuple<int, long> serializer
It is used only in test and even there it is not needed.
2015-05-31 17:53:51 +03:00
Asias He
898233ddcf Remove redundant const in static constexpr const
From http://en.cppreference.com/w/cpp/language/constexpr:

  A constexpr specifier used in an object declaration implies const.
2015-05-25 13:09:23 +03:00
Gleb Natapov
59f4b9af46 messaging: bind rpc client to listen-address 2015-05-21 15:17:42 +03:00
Gleb Natapov
8d9fb8a96c message: consolidate send_message() and send_message_oneway()
send_message() and send_message_oneway() are almost identical, implement
the later in terms of the former. The patch also fixes send_message() to
work properly with MsgIn = void.

Reviewed-by: Asias He <asias@cloudius-systems.com>
2015-05-13 13:41:24 +03:00
Asias He
cce98e19e4 message: Remove more leftover
class handler_base and handler are not used anymore.
2015-05-10 12:03:27 +03:00
Asias He
f12e955b4e message: Drop register_handler_oneway 2015-05-07 13:16:18 +03:00
Gleb Natapov
1a8c4b75f5 message: do not erase client's rpc call type
Currently we cast rpc call lambda to std::function (to put all lambdas
in one container) which removes its template properties and gives it
strictly typed interface. This is inconvenient since interface may either
receive an object by value (which requires copy during invocation),
or by reference (which require lifetime management), but not both. This
patch changes the implementation to no store lambda in one central
place, but create it with rpc::make_client() call when used. This way
template properties are preserved and send_message() arguments are
forwarded to rpc call with original types.

Reviewed-by: Asias He <asias@cloudius-systems.com>
2015-05-07 13:16:16 +03:00
Gleb Natapov
78d36eabc2 Merge remote-tracking branch 'origin/master' into tmpmerge
message_service: create object using placement new()

Object reference may point to a unit member that was not properly
created, so assign will not work on it. Use placement new() instead.
2015-05-05 10:39:51 +03:00
Asias He
3d36debcf8 message: Do not call remove_rpc_client() under exception
We can not remove the rpc client while the client might still "active".
2015-04-23 14:55:26 +08:00