Commit Graph

53948 Commits

Author SHA1 Message Date
Amnon Heiman
8577a8886e Adding the handler
The class handler_base is a base class for all handlers. All handlers
should inherit and implement the handle method.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-03-08 21:55:57 +02:00
Amnon Heiman
4bdbd2c80a Adding the http exception 2015-03-08 21:55:57 +02:00
Amnon Heiman
baedb5e775 Adding the request object
The request object was originally taken from the boost server example
and was modified in the OSv http implementation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-03-08 21:55:57 +02:00
Amnon Heiman
1ffd418ded Adding common for HTML operation support 2015-03-08 21:55:57 +02:00
Amnon Heiman
29391d9a9b Extending sstring
This patch adds some of the common functionalities from std:string to
sstring.

It adds length (implement by size() )
It define the constant npos to indicate no possition.
It adds the at (reference and const reference)
It define the find char and find sstring methods
and the substr method

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>

need merge sstring
2015-03-08 21:55:57 +02:00
Amnon Heiman
100a667ab8 httpd to use the reply class and support error code 2015-03-08 21:55:57 +02:00
Amnon Heiman
6cf25b8c5a add mime type support 2015-03-08 21:55:57 +02:00
Amnon Heiman
8a760f23f9 Break the httpd implementation to a library/main
We would like to extend the httpd capabilities and use it for the API
implementation.

The first step is to make it a library with main that calls an instanse.
This break the implementation to a header file, implementation and main,
that simply calls the implementation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-03-08 21:55:57 +02:00
Amnon Heiman
722bf0fe1f request_parser is missing pragma once 2015-03-08 21:55:57 +02:00
Shlomi Livne
d5b4ec06d6 tests: add commitlog_test
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-08 17:46:16 +02:00
Shlomi Livne
a40ef8bfe1 future: Add test case for finally being called on non immediate available future
Found that we are missing tests in code coverage review

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
[avi: fix formatting]
2015-03-08 16:52:26 +02:00
Nadav Har'El
f4b47b0d70 build: Fix whitespace
Fix tabs to spaces in two lines in configure.py

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-08 16:10:00 +02:00
Avi Kivity
9b39bd410e Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-03-08 15:02:24 +02:00
Avi Kivity
e4b5408bbd core: improve apply forwarding
Currently apply() only works with moveable inputs.  Add overloads for
non-moveable inputs (reference and const reference).
2015-03-08 14:58:28 +02:00
Avi Kivity
808ac29cf3 core: mark apply() inline 2015-03-08 14:58:26 +02:00
Shlomi Livne
ee8fa7b07a Block all signals when reactor is deleted
1. Moved all signal handler functions/members into a wrapping class
2. Block all signals on desctuctor call (resetting of signal handler is
not enough since some signals will arive even if we reset signal handler
to SIG_DFL e.g. timer)

Fixes use-after-free when a signal is caught after the reactor is
destroyed.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-08 09:20:32 +02:00
Gleb Natapov
4d286f0504 core: drop superfluous qualifier from then_wrapped 2015-03-06 12:52:11 +02:00
Avi Kivity
11dfbdfaf5 Merge branch 'tgrabiec/futurize' of github.com:cloudius-systems/seastar-dev
Unify future callback specialization for callback return values, from
Tomasz.
2015-03-06 12:40:17 +02:00
Tomasz Grabiec
7502f2a3a3 tests: Add test for returning bare values from callbacks 2015-03-06 11:35:56 +01:00
Tomasz Grabiec
af82e23c75 core: Use futurize<> to unify then_wrapped() specializations 2015-03-06 11:35:56 +01:00
Tomasz Grabiec
a232b7e6c5 core: Use futurize<> to unify future::then() specializations
As a side benefit, returning non-void non-future is now allowed:

 future<int> x() {
     return later().then([] {
         return 3;
     });
 }
2015-03-06 11:35:56 +01:00
Tomasz Grabiec
f25d7ac068 core: Add futurize::apply()
Invokes given function wrapping the result in a future if necessary.
2015-03-06 11:35:56 +01:00
Tomasz Grabiec
422d642cf4 core: Add futurize::primise_type 2015-03-06 11:35:56 +01:00
Tomasz Grabiec
f5485c667d core: Move futurize<> to future.hh 2015-03-06 11:35:56 +01:00
Gleb Natapov
5d1b10d97a core: properly propogate exception in do_until()
[avi: use std::move(f).then_wrapped() until patch removing rvalue
      qualification from then_wrapped() lands]
2015-03-06 12:12:19 +02:00
Raphael S. Carvalho
41846256d8 tests: fix fileiotest
engine() cannot be called before the local_engine was constructed because it
dereferences the pointer local_engine to create a reference.
Consequently, the following error can be seen while running fileiotest:
./core/reactor.hh:854:13: runtime error: reference binding to null pointer of
type 'struct reactor' ASAN:SIGSEGV

Let's switch the test to use app_template.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-03-06 10:06:16 +02:00
Avi Kivity
5bff24c292 db: constify standard data_types
Lest someone accidentally move them away or assign into them.
2015-03-05 22:20:04 +02:00
Tomasz Grabiec
3db3207b85 Merge branch seastar-dev.git 'collections'
Collections support from Avi.
2015-03-05 20:25:48 +01:00
Avi Kivity
6126670078 mutation_test: test maps 2015-03-05 20:03:57 +02:00
Avi Kivity
b77a52398f db: fix merge_cells using wrong column_definition
merge_cells() always used the regular column_definition, even when called
for a static row.

Fix by parametrizing it with a method to get the column_definition.
2015-03-05 19:59:59 +02:00
Avi Kivity
6f6b1fdb00 schema: add static_column_at()
Parallels regular_column_at().
2015-03-05 19:59:18 +02:00
Avi Kivity
de2e9f9eea db: fix wrong row updated by merge_cells()
merge_cells() is called for both static and clustered rows, yet it always
updates the static row.

Fix by updating the row passed by the caller.
2015-03-05 19:57:34 +02:00
Avi Kivity
bb0d2a4f03 db: fix mutation::set_*_cell() applied twice to same column
With a collection, setting two separate elements in a collection would
cause the second to override the first.  This also applies, with much
smaller effect, to normal cells (for example, updating the same counter
twice, or issuing two updates to the same cell but with different timestamps,
via thrift).

Fix by merging the two values rather than replacing the old one.
2015-03-05 19:04:02 +02:00
Avi Kivity
42a9c0f7d3 atomic_cell: export merge_column 2015-03-05 19:03:29 +02:00
Vlad Zolotarov
e7e58d446c DPDK: Explicitly set Rx mempool mbuf_data_room_size
This value is passed as an opaque parameter of the rte_pktmbuf_pool_init().
It should equal to a buffer size + RTE_PKTMBUF_HEADROOM.
The default value is 2K + RTE_PKTMBUF_HEADROOM.
PMD is using this value minus RTE_PKTMBUF_HEADROOM for configuring the Rx
data buffers' size when it configures the Rx HW ring.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-03-05 18:39:17 +02:00
Avi Kivity
98f2a51df9 db: implement collection mutation merging
Only for maps, as they are the only collection implemented at present.
2015-03-05 18:11:37 +02:00
Avi Kivity
5dbfe39399 Add combine() template
Similar to std::merge(), merges two sorted sequences. Duplicates, however,
are merged using a binary function parameter rather than duplicated.
2015-03-05 18:11:37 +02:00
Avi Kivity
df22293baf atomic_cell: export compare_atomic_cell_for_merge
Will be used for merging maps.
2015-03-05 18:11:37 +02:00
Avi Kivity
ded878212c db: simplify mutation_partition::apply()
Since merging cells is a different operation for atomic cells and
collections, move it into compare_for_merge(), which is where we check
the column type.  Rename compare_for_merge to merge_column(), since it
now does more than compares.
2015-03-05 18:11:37 +02:00
Avi Kivity
a6b692612a cql3: convert grammer for setting a collection element 2015-03-05 18:11:37 +02:00
Avi Kivity
1fcce7cdcb cql3: convert operation::set_element 2015-03-05 18:11:37 +02:00
Avi Kivity
7a94b0c0a3 cql3: convert maps::setter_by_key
Basic operation to set a single map element to a value.
2015-03-05 18:11:31 +02:00
Avi Kivity
07cb1f0a9c Merge branch 'asias/gossip' of github.com:cloudius-systems/seastar-dev into db
More gossip work from Asias.
2015-03-05 17:23:56 +02:00
Avi Kivity
ebf35c435b Merge branch 'penberg/schema-altering-statement-execute' of github.com:cloudius-systems/seastar-dev into db
From Pekka:

"This series converts schema_altering_statement::execute() to C++ in
preparation for create keyspace support."
2015-03-05 17:20:41 +02:00
Avi Kivity
4602d86dc9 cql3: convert maps::key_spec_of/maps::value_spec_of 2015-03-05 15:31:52 +02:00
Avi Kivity
b5571e4c18 db: implement map_type (partial) 2015-03-05 15:31:50 +02:00
Pekka Enberg
817486d27f cql3: Convert schema_altering_statement::execute() to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-05 15:06:31 +02:00
Pekka Enberg
670e146798 transport: Add schema_change result message
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-05 15:06:31 +02:00
Pekka Enberg
e153483cbb transport: Convert Event to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-05 15:06:31 +02:00
Pekka Enberg
4483504d8c transport: Import Event.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-05 15:06:31 +02:00