Commit Graph

53948 Commits

Author SHA1 Message Date
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
Nadav Har'El
ae05652ec7 Utility functions for serializing primitive types
Cassandra uses the DataOutput / DataInput interfaces and related classes
(DataOutputPlus, DataOutputStream, AbstractDataOutput, etc.) to serialize
primitive types - integers of various lengths, strings, etc, as part of
various inter-node messages, and so on.

This patch implements similar primitive type serialization/deserialization
in C++. The interface is quite different, but the functionality is the same
and so is the serialized format. The fact that the format is identical
(I verified this) is important, because we want a C++ node to be able to
communicate with a Java node.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-01-05 11:52:58 +02:00
Avi Kivity
64000fc74d Merge branch 'asias/db' of github.com:cloudius-systems/seastar-dev into db
Convert db/composites/{CType.java, CellNameType.java}, from Asias.
2015-01-05 11:50:57 +02:00
Avi Kivity
b1f67fa2af Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-01-05 11:43:56 +02:00
Avi Kivity
f2e25b8442 Merge branch 'shared_ptr'
Split shared_ptr into a traditional polymorphic shared_ptr implementation,
and a lighter-weight, non polymorphic lw_shared_ptr.
2015-01-05 11:29:35 +02:00
Avi Kivity
c7d7494a65 shared_ptr: add some documentation 2015-01-05 10:39:35 +02:00
Asias He
ec0a5670dd db: Convert db/composites/CellNameType.java to C++ 2015-01-05 14:28:26 +08:00
Asias He
ce9ef19f64 db: Convert db/composites/CType.java to C++ 2015-01-05 14:27:19 +08:00
Asias He
11f2f47ae7 cql3: Convert cql3/CQL3Row.java
Stub only.
2015-01-05 14:13:31 +08:00
Asias He
dd805f8add db: Convert db/DeletionInfo.java and db/RangeTombstone.java to C++
Stub only.
2015-01-05 14:13:31 +08:00
Asias He
c9882d7d96 db: Import db/RangeTombstone.java 2015-01-05 14:13:31 +08:00
Asias He
9769752779 db: Import db/DeletionInfo.java 2015-01-05 14:13:31 +08:00
Asias He
7d0ef20a80 Add comparator 2015-01-05 14:13:31 +08:00
Asias He
888a2436cb db: Convert db/OnDiskAtom.java to C++
Stub only.
2015-01-05 14:13:31 +08:00
Asias He
c059c56790 db: Import db/OnDiskAtom.java 2015-01-05 14:13:31 +08:00
Asias He
00ec6857e4 io: Convert io/ISerializer.java 2015-01-05 14:13:31 +08:00
Asias He
fcfa1e1f58 io: Import io/ISerializer.java 2015-01-05 14:13:31 +08:00
Asias He
076be9c0d1 io: Convert io/IVersionedSerializer.java to C++ 2015-01-05 14:13:31 +08:00
Avi Kivity
b6d76ed650 shared_ptr: add polymorphic-capable shared pointer
At the cost of doubling the pointer size, this shared_ptr is polymorphic
and can be upcast to a base class.
2015-01-04 23:15:58 +02:00
Avi Kivity
87f63f7b90 shared_ptr: rename to lw_shared_ptr (for light-weight)
The current shared_ptr implementation is efficient, but does not support
polymorphic types.

Rename it in order to make room for a polymorphic shared_ptr.
2015-01-04 22:38:49 +02:00
Shlomi Livne
b7a83903b5 tests: terminate memcached instance with SIGTERM
Terminate a running memcached instance with a SIGTERM instead of a
SIGKILL to allow the process to close in a cleaner manner

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-01-04 17:17:40 +02:00
Shlomi Livne
3362851e55 reactor: add a SIGTERM handler
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-01-04 17:17:33 +02:00
Gleb Natapov
d72de7e959 net: signal space availability in tcp buffer only after
Currently space availability is signaled when packet is taken from
unsend queue, but packet can still be alive for a long time at his
point.
2015-01-04 16:37:17 +02:00
Asias He
4e13844f4b io: Import io/IVersionedSerializer.java 2015-01-04 18:36:51 +08:00
Avi Kivity
cef37f1546 tcp: fix unfulfilled read promise on RST
A user may be waiting for data, but we never we never notify them if we
receive an RST.  As a result the tcb, connection, and any user data structures
will hang around in memory.

Fix by notifying the user if they are waiting, and marking the connection as
nuked so they don't try to read again.

Reviewed-by: Asias He <asias@cloudius-systems.com>
2015-01-04 12:20:31 +02:00
Asias He
3fbb10b9ea db: Add stub db.cc file 2015-01-04 10:46:25 +02:00
Asias He
bfc17d2841 db: Convert db/composites/CellName.java to C++ 2015-01-04 10:46:25 +02:00
Asias He
72f5e22316 db: Convert db/composites/CBuilder.java to C++ 2015-01-04 10:46:24 +02:00
Asias He
5239ace214 db: Convert db/composites/Composite.java to C++ 2015-01-04 10:46:24 +02:00
Asias He
99d06f3698 db: Import db/composites/* 2015-01-04 10:46:23 +02:00
Pekka Enberg
36359850e6 cql3: Switch to our own shared_ptr implementation
Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-04 10:45:19 +02:00
Pekka Enberg
3368d44af7 cql3: Use optional for cf_name
Suggested by Avi.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-04 10:45:18 +02:00
Pekka Enberg
9292815bd9 cql3: convert Term to C++
This is not 1:1 conversion because some Term inner classes derive from
Term itself which is not allowed in C++. I therefore moved some of the
inner class definitions outside of Term.

Another painpoint is Terminal.bind() method which returns 'this'. I
changed the API to require callers to pass shared_ptr<terminal> which is
returned in place of 'this'. I went for shared_ptr because I wasn't able
to convince myself that the lifetime rules allow unique_ptr...

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-04 10:42:52 +02:00
Avi Kivity
98ac429983 Merge branch 'cql3/statement' of github.com:cloudius-systems/seastar-dev into db 2015-01-01 15:39:33 +02:00
Avi Kivity
33518ea9d0 shared_ptr: fix uninitialized enable_shared_from_this ref count
Caused immediate leak.
2015-01-01 14:29:27 +02:00
Pekka Enberg
537cc42397 cql3: convert SchemaAlteringStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Pekka Enberg
479c370212 cql3: use unique_ptr for cf_name to allow nullptr
There are cf_statement derived classes that pass 'null' as 'cf_name'.
Switch to unique_ptr to allow that.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Pekka Enberg
046d827be6 cql3: Fix use_statement class override annotations
Add a missing override annotation to the use_statement class.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Pekka Enberg
5e4fc9b88c cql3: convert TruncateStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-01 10:35:26 +02:00
Avi Kivity
852f63f918 Merge branch 'cql' into db
Convert AggregateFcts, adding some infrastructure along the way.
2014-12-31 18:04:14 +02:00
Pekka Enberg
18d92f6cd6 cql3: convert AssignmentTestable to C++
The conversion is not 1:1 because 'enum class' in C++ does not support
methods. As the methods are rather simple, I moved them out of the class
as standalone functions.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-31 18:04:08 +02:00
Avi Kivity
7cab37ddad cql: convert AggregateFcts to C++
Use templates to reduce code duplication for each data type.
2014-12-31 16:09:21 +02:00
Avi Kivity
3900173c75 db: add data_type_for<> helper
Converts C++ data type to corresponding data_type class, during compile time.
2014-12-31 16:07:50 +02:00
Avi Kivity
d19043fca2 db: add data_type::decompose
Convert any -> bytes.
2014-12-31 16:07:17 +02:00
Avi Kivity
719a7f87f3 cql: add helpers for constructing native aggregate functions 2014-12-31 16:06:28 +02:00
Avi Kivity
f303499d01 cql: fix native_aggregate_function base classes
Must be public.
2014-12-31 16:05:50 +02:00
Avi Kivity
adc78b8959 cql: fix function/abstract_function inheritence
Make a few functions virtual and fix the types.
2014-12-31 16:04:22 +02:00