Commit Graph

1244 Commits

Author SHA1 Message Date
Asias He
306fef6027 db: Convert db/IMutation.java to C++ 2015-01-07 20:44:54 +08:00
Asias He
3d2592f7d4 db: Add db/IMutation.java 2015-01-07 20:32:49 +08:00
Nadav Har'El
c07292ed7d test: test util/serialization.hh
Add a test (using the Boost unit-test framework) for the functions of
util/serealization.hh for serializing and de-serializing primitive types
like integers and strings.

The test checks that the round-trip is correct, i.e., taking an original
data, serializing it and de-serializing it back, gets the same data back.
Moreover, it compares the result of serialization to pre-computed expected
results (which were produced by a Java program), to confirm that our code
generates the same serialization as Java.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-01-07 14:01:03 +02:00
Nadav Har'El
3c74a5e15d gossip: convert ApplicationState to C++
The gossiped application state is a list of key/version pairs. The keys
come from the application_state enum in this patch.

This is a trivial conversion of the Java enum. It is possible we may need
to add more features to this enum class (Java enums have all sorts of weird
capabilities beyond C++ enums), but with any luck, we won't...

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-01-07 13:59:29 +02:00
Nadav Har'El
0513f206d8 gossip: convert VersionGenerator to C++
version_generator is a trivial class which keeps a global "version"
counter, starting with 0 and counting up on a single Cassandra node.
It is used by the gossip protocol to keep a version number for each
piece of state information, so a remote node which gets two pieces of
conflicting gossip can know which is the newer information.

In Cassandra, the counter is an atomic integer. In our implementation,
because there will be just a single gossiper per SMP machine, and the
gossiper will run on a single CPU, it can be a regular integer. But
this doesn't really help performance anyway (the version number changes
rarely, so performance of this code is insignifcant).

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-01-07 13:59:20 +02:00
Pekka Enberg
0b77fae1c7 cql3: Switch to our own shared_ptr
It's already used by core code so make life easier for us and just
switch to it.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 13:58:54 +02:00
Avi Kivity
aa1e02ab46 Merge branch 'types' into db
More type work.

Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 13:57:15 +02:00
Avi Kivity
9160ac03db Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-01-07 13:57:04 +02:00
Pekka Enberg
fa8d120d70 core: Fix shared_ptr pointer casts
Fix compilation errors in the shared_ptr pointer cast functions and
update shared_ptr constructor to take shared_ptr_count_base.

Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 13:50:59 +02:00
Avi Kivity
a5802e36a2 Merge branch 'gleb/net' of github.com:cloudius-systems/seastar-dev
Network tx path inversion, from Gleb:

"Instead of pushing packets from upper layers towards HW those patches
change networking stack to do the opposite: HW polls upper layers for
packets to send. There are several advantages to this approach. First
one is that now, instead of getting packets one by one HW will get them
in bulks. Another is that packet queueing happens closer to an application
layer where sender can be stopped more accurately without dropping packets."
2015-01-06 15:48:03 +02:00
Avi Kivity
4b4f1606e6 db: add date_type 2015-01-06 15:27:17 +02:00
Avi Kivity
cfd86d70f8 db: extract default compare method into a default_less<> helper
The helper is a little more flexible in that it accepts a comparator,
instead of using <.
2015-01-06 15:26:45 +02:00
Avi Kivity
1cc6df68c6 db: add a db_clock type
Origin uses the Java clock (milliseconds since unix epoch), provide a
clock emulating this functionality.
2015-01-06 15:26:40 +02:00
Avi Kivity
a191d598c2 db: implement boolean type 2015-01-06 15:26:40 +02:00
Gleb Natapov
8d4e6b832a net: implement bulk sending interface for dpdk 2015-01-06 15:24:10 +02:00
Gleb Natapov
aae617f9f5 net: revert whatever is left from "virtio: batch transmitted packets" commit.
Revert remains of commit 503f1bf4 since there is no need to batch
packets inside virtio any more. Upper layer does it already.
2015-01-06 15:24:10 +02:00
Gleb Natapov
72324f02e2 net: implement bulk sending interface for virtio 2015-01-06 15:24:10 +02:00
Gleb Natapov
77bd21c387 net: implement bulk sending interface for proxy queue
Take advantage of the bulk interface to send several packets simultaneity
with one submit_to() to remote cpu.
2015-01-06 15:24:10 +02:00
Gleb Natapov
c98bdf5137 net: limit native udp send buffer size
Currently udp sender my send whenever it has data and if it does
this faster than packets can be transmitted we will run out of memory.
This patch limits how much outstanding data each native udp channel may
have.
2015-01-06 15:24:10 +02:00
Gleb Natapov
0fd014fc35 net: add add completion callback between l3 and l4
L4 will provide the callback to be called by L3 after the packet is
handled to lower layers for transmission. L4 will know that it can queue
more data from user at this point. The patch also change send function
that can no longer block to return void instead of future<>.
2015-01-06 15:24:10 +02:00
Gleb Natapov
e80fa4af7d net: drop top level 'remaining' from ipv4::send()
It is not needed.
2015-01-06 15:24:10 +02:00
Gleb Natapov
12bce3f4fc net: make interface get packets from l3
Instead of l3 (arp/ipv4) pushing packets into interface's queue, make
them register functions that interface can use to ask l3 for packets.
2015-01-06 15:24:10 +02:00
Gleb Natapov
e5d0adb339 net: make qp poll for tx packets from networking stack
Packets are accumulated in interface's packet queue. The queue is polled
by qp to see if there is something to send.
2015-01-06 15:24:10 +02:00
Gleb Natapov
865d95c0f1 net: provide bulk sending interface for qp
Implement it as calls to send() in a loop for now. Each device will
get proper implementation later.
2015-01-06 15:24:10 +02:00
Glauber Costa
974278203c db: add datadir to the database
This is the directory from which we will read the sstables.
Code to actually parse them will come later.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-01-06 14:54:47 +02:00
Gleb Natapov
3f483b22bc future: add missing std::forward() in do_until_continued() 2015-01-06 14:43:34 +02:00
Avi Kivity
e733c2a45a db: change abstract_type::deserialize to allow null objects
In some cases, deserialize() can return a null object (if there were zero
input bytes).

In others, it cannot (for string or blob types).

Change the return type to optional<any> and adapt the deserialiation code
to deal with it.
2015-01-06 12:49:47 +02:00
Asias He
04b8a6bf7d db: Convert db/CounterCell.java to C++ 2015-01-06 17:55:53 +08:00
Asias He
3d418e55ad db: Import db/CounterCell.java 2015-01-06 17:49:10 +08:00
Asias He
969f942613 db: Convert db/ExpiringCell.java to C++ 2015-01-06 17:46:40 +08:00
Asias He
4513e28e1b db: Import db/ExpiringCell.java 2015-01-06 17:42:15 +08:00
Asias He
49e7d79630 db: Convert db/DeletedCell.java to C++ 2015-01-06 17:40:49 +08:00
Asias He
50bdc5438f db: Import db/DeletedCell.java 2015-01-06 17:35:55 +08:00
Asias He
f4b40d3516 db: Convert db/CounterUpdateCell.java to C++ 2015-01-06 17:33:51 +08:00
Asias He
4ad91ece93 db: Import db/CounterUpdateCell.java 2015-01-06 17:23:46 +08:00
Asias He
5449d44f38 db: Convert db/Cell.java to C++ 2015-01-06 17:23:46 +08:00
Asias He
d11a39524f db: Import db/Cell.java 2015-01-06 17:23:46 +08:00
Asias He
516ef9e63b utils: Convert utils/FBUtilities.java 2015-01-06 17:23:46 +08:00
Asias He
3a5314bec8 utils: Import utils/FBUtilities.java 2015-01-06 16:59:16 +08:00
Avi Kivity
d5c9f66009 db: adjust abstract_type indentation 2015-01-05 15:56:29 +02:00
Avi Kivity
1fe6bf687d db: de-pimpl data_type
Since origin tends to cast around, we should allow that too, by exposing
the implementation type and using a shared_ptr instead of a value class.
2015-01-05 15:55:30 +02:00
Avi Kivity
82c4920f1c db: copy correct partition_key_type
Specify this-> so we use the variable we just moved into, rather than the
one we just moved from.
2015-01-05 14:03:47 +02:00
Avi Kivity
80408329e0 db: rename data types to conform to origin conventions 2015-01-05 13:48:38 +02:00
Avi Kivity
d5491f87c5 db: add abstract_type alias 2015-01-05 13:30:50 +02:00
Avi Kivity
efc868d1e6 db: extend data_type to be able to support dynamic types
Dynamic types come and go, so they need to be reference counted.

Switch data_type to using a shared_ptr<> for its implementation.

Since thread_ptr is not thread safe, the global primitive types must be
thread_local.
2015-01-05 13:26:56 +02:00
Avi Kivity
1b837160f1 thrift: drop unneeded using declaration 2015-01-05 13:26:55 +02:00
Avi Kivity
a63cf2e609 Merge branch 'master' into HEAD 2015-01-05 13:26:35 +02:00
Avi Kivity
66eea763bf shared_ptr: add comparison operators 2015-01-05 13:24:07 +02:00
Avi Kivity
7a317f78a2 shared_ptr: be friend to self
Needed for converting constructor.
2015-01-05 13:24:06 +02:00
Pekka Enberg
a78c5b46b2 cql3: Fix term::bind() type signature
The first argument is a synthetic this pointer that we require users to
pass around. Change it to shared_ptr<term> instead to make it accessible
to all callers.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-05 12:39:30 +02:00