When using the set_routes with the registry builder, the shared_ptr of
the registry builder should be captured.
In the original implementation the api_registery_builder captured this
parameter, but as the shared_ptr was not captured it was deleted,
causing the http to crash when running in debug.
In this implementation the method that use the registry creates a lambda
function and inside it calls the set_api_doc method, this allows to
catch the shared_ptr so it lives until the function complete.
It also replaces the c style cast to static_cast and add a FIXME note to
the routes implementation, that handlers should be deleted to prevent
memory leak.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Use decorated_key in partition maps, from Tomasz:
"Partitions should be ordered using Origin's ordering, which is the natural
ordering of decorated_key. This is achieved by switching column_family's
partition map to use decorated_key instead of a bare partition_key.
This also includes some cleanups."
[avi] trivial adjustments to sstables/keys.cc
Partitions should be ordered using Origin's ordering, which is first
by token, then by Origin's representation of the key. That is the
natural ordering of decorated_key.
This also changes mutation class to hold decorated_key, to avoid
decoration overhead at different layers.
Make sure that, for selected Summary files, the first key is always found to be
in position 0. In order to do that, we need to create an sstable::key. By having
this test using multiple data types (including collections and composites), we also
make sure that the serialization is sound.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Search code is trivially taken from Origin, but adapted so that the comparison
is done explicitly.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
It has been determined that we will store partition_keys in the decorated_keys.
That is totally fine, but the token needs to be generatable from an sstable::key
as well.
Since both types convert well to a bytes_view - and the first thing get_token() does
is precisely to generate that view, let's generate the token from a bytes_view instead.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We have our own representation of a partition_key, clustering_key, etc. They
may different slightly from a legacy sstable key because we don't necessarily
serialize composites in our internal representation the same way as Origin
does. This patch encodes the Origin composite serialization, so we can create
keys that are compatible with Origin's understanding of what a partition key
should look like.
This whould be used when serializing or deserializing to/from an sstable.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
If we end up including more than one boost::<>::join, like
boost::range::join and boost::string::join, that will create an ambiguity.
The compiler doesn't like it very much.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Gossip update, from Asias:
"With this series, gossip now can:
1) Detect if remote node is down, if so deletes that node.
2) Update heat beat version number properly.
3) application_state::Load info is updated periodically and
gossiped around correctly."
When call to marshall fails with an exception the exception future is
stored in dst.out_ready(). During next send sent future will not be
signaled because marshall() will never be called. Fix that by moving
sent future signaling to consider dst.out_ready() state too.