Commit Graph

2980 Commits

Author SHA1 Message Date
Asias He
bc034aeaec locator: Convert AbstractNetworkTopologySnitch.java to C++ 2015-04-27 14:57:25 +08:00
Asias He
23ae3da303 locator: Import AbstractNetworkTopologySnitch.java 2015-04-27 14:15:00 +08:00
Avi Kivity
b3b553821f Merge branch 'master' of github.com:cloudius-systems/seastar into db
Contains patch from Amnon to update the calls to http set_routes().
2015-04-26 13:16:35 +03:00
Amnon Heiman
f06c12e031 http: fix crash due to set_routes() not managing lifetime correctly
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>
2015-04-26 13:09:26 +03:00
Avi Kivity
65b8b19ca7 Merge branch 'tgrabiec/order-partitions-by-decorated-key' of github.com:cloudius-systems/seastar-dev into db
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
2015-04-25 19:22:51 +03:00
Avi Kivity
53eb59e8ab Merge branch 'bsearch' of github.com:glommer/urchin into db
sstable index/summary binary search, from Glauber.
2015-04-25 18:54:43 +03:00
Avi Kivity
adfd737ad9 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-04-25 18:54:11 +03:00
Glauber Costa
2b8035a718 sstring: add a fill constructor
std::string has it, we don't.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-04-25 02:02:04 +03:00
Tomasz Grabiec
5a7e3d3278 db: Order partitions by decorated_key
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.
2015-04-24 18:01:01 +02:00
Tomasz Grabiec
474dbbbc88 db/serializer: Avoid unnecessary lookup of column family ID
We can now get it from schema.
2015-04-24 18:01:01 +02:00
Tomasz Grabiec
9f3053a867 db/serializer: Fix coding style 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
1c3275c950 mutation: Encapsulate fields 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
2b157a5526 locator: Take token by const& 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
71041eb0d6 dht: Implement operator<< for decorated_key 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
841a13da93 dht: Implement operator!= for decorated_key 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
4641bc6f95 database: Move implementation to source file 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
88b9966c38 keys: Avoid unnecessary lw_shared_ptr copy 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
a9972b4b28 Relax header dependencies 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
6c07f4ae5d Introduce database_fwd.hh with forward declarations 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
731a63e371 schema: Embed raw_schema inside schema
Public fields got encapsulated.
2015-04-24 18:01:01 +02:00
Glauber Costa
00f8c148d6 tests: test summary binary search.
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>
2015-04-24 10:11:50 -04:00
Glauber Costa
28f936d6d2 sstables: summary binary search
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>
2015-04-24 10:11:50 -04:00
Glauber Costa
8508a246bb sstable: convenient view for types
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-04-24 10:11:49 -04:00
Glauber Costa
7c7da26347 dht: generate a token from a bytes_view
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>
2015-04-24 10:11:49 -04:00
Glauber Costa
5b8b2e835a sstable: add sstable::key type
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>
2015-04-24 10:11:49 -04:00
Glauber Costa
7677a3423e schema: specify the kind of join we want
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>
2015-04-24 10:11:49 -04:00
Tomasz Grabiec
c963821e1d db: Extract schema-specific code to schema.cc 2015-04-23 20:54:12 +02:00
Avi Kivity
a93f7e5525 Merge branch 'asias/gossip_v2' of github.com:cloudius-systems/seastar-dev into db
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."
2015-04-23 19:19:19 +03:00
Avi Kivity
da8782b9e5 Merge branch 'tgrabiec/code-moves' of github.com:cloudius-systems/seastar-dev into db
Cleanups in preparation for memtables, from Tomasz.
2015-04-23 18:44:40 +03:00
Pekka Enberg
d23b7796f8 dht/i_partitioner.hh: Make decorated key operators visible
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-04-23 10:34:34 +02:00
Asias He
9377cdcc45 tests: Add exception tests to tests/urchin/message.cc 2015-04-23 14:55:27 +08:00
Asias He
346d00cc8c tests: Add listen-address option to tests/urchin/message.cc 2015-04-23 14:55:27 +08:00
Asias He
5bb42de010 tests: Update load info over the time in tests/urchin/gossip.cc 2015-04-23 14:55:26 +08: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
Asias He
bf3d6a4c06 gossip: Disable sleep and retry logic in do_status_check
We do not have the ThreadPoolExecutor logic. Disable the sleep and retry
logic.
2015-04-23 14:55:26 +08:00
Asias He
0060eac413 gossip: Set last processed time when receiving gossip message 2015-04-23 14:55:26 +08:00
Asias He
622ec0111d gossip: Fix apply_new_states
We should take a reference, otherwise remote's endpoint_state will not
be updated locally.
2015-04-23 14:55:26 +08:00
Asias He
5f0050dc97 gossip: Fix add_application_state
If the key exists, we should update the new value.
2015-04-23 14:55:26 +08:00
Asias He
7b75df6bd4 gossip: Update heart beat 2015-04-23 14:55:26 +08:00
Asias He
f2e840de54 gossip: Switch from fail to warn
Warn is enough for now.
2015-04-23 14:55:26 +08:00
Asias He
a800fbfe64 gossip: Set get_phi_convict_threshold to 8
It is the default value.
2015-04-23 14:55:26 +08:00
Asias He
5a54ae3214 gossip: Fix string serializer in messaging_service 2015-04-23 14:55:26 +08:00
Asias He
ea08c7e000 utils: Fix bounded_stats_deque::add 2015-04-23 14:55:26 +08:00
Tomasz Grabiec
22e379e786 keys: Move operator<< functions to .cc file 2015-04-22 19:01:16 +02:00
Tomasz Grabiec
0d4821009c db: Move mutation and mutation_partition to separate headers and compilation units 2015-04-22 18:42:33 +02:00
Tomasz Grabiec
a5c201a685 db: Move column_family::get_partition_slice() to mutation_partition::query()
There's nothing column_family-specific there.
2015-04-22 17:40:02 +02:00
Tomasz Grabiec
de5bea90fe db: Add const qualifiers to mutation_partition methods 2015-04-22 17:37:40 +02:00
Tomasz Grabiec
631dad8a29 schema: Add const qualifiers to lookup methods 2015-04-22 17:36:27 +02:00
Gleb Natapov
349f21c860 rpc: signal send completion even if send failed due to a socket error
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.
2015-04-22 13:00:58 +03:00
Avi Kivity
74edad888f Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-04-22 10:12:16 +03:00