Commit Graph

23 Commits

Author SHA1 Message Date
Avi Kivity
1eabf5983f Merge seastar upstream 2015-07-02 17:07:04 +03:00
Gleb Natapov
7d33cf62a5 Add is_smart_ptr metafunction to detect know smart pointers objects 2015-07-02 16:46:23 +03:00
Gleb Natapov
730170ff1a serialize data structures needed for read clustering 2015-07-01 13:36:28 +03:00
Asias He
2e24dc93f4 util: Add bytes version of serialize_string 2015-03-16 12:46:37 +01:00
Asias He
b9a67c6d67 util: Add bytes version of serialize_int8 2015-03-16 12:46:37 +01:00
Dor Laor
7921ef406a db: serialize via bytes_iterator instead of std::ostream
Instead of using inefficient std::ostream, use our own 'bytes' iterator class.
Compute ahead of time the length of the byte buffer.
Afterwards serialize the objects into it.

Gives ~X5 boost over previus results (that sometimes don't even
finish in reasonable time)

[avi: add missing include]
2015-03-16 07:07:25 +02:00
Dor Laor
a9e77e1211 uuid: add 'bytes' serialization helpers 2015-03-16 06:58:30 +02:00
Dor Laor
29c21f1eda db: move tiny write util template to serialization.hh 2015-03-16 06:58:23 +02:00
Avi Kivity
d39c844ea3 Merge branch 'master' of github.com:cloudius-systems/seastar into db
Conflicts:
	configure.py
	database.cc (added missing include)
	utils/serialize.hh (added missing inlines)
2015-02-26 17:57:18 +02:00
Avi Kivity
83430355c2 Merge branch 'master' of github.com:cloudius-systems/seastar into db
LICENSE moved to LICENSE.seastar, since (at least for now) urchin is
not open source.

Conflicts:
	apps/seastar/main.cc
2015-02-22 16:23:59 +02:00
Avi Kivity
7f8d88371a Add LICENSE, NOTICE, and copyright headers to all source files.
The two files imported from the OSv project retain their original licenses.
2015-02-19 16:52:34 +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
Nadav Har'El
774579d8b4 Move murmur_hash to the right directory
In the original Java code, MurmurHash was in the "utils" package, not
"util", so move it to a new "utils" directory (and namespace), not
"util".

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2014-12-30 17:43:30 +02:00
Nadav Har'El
6710a97537 Convert util/MurmurHash.java to C++
Port the Murmur hash functions from Java to C++. This is ironic,
because these functions actually originated in C code, which the
Cassandra guys converted to Java :-)

The Murmur hash is used in Cassandra for several things, including the
bloom filter (which is part of each sstable), and the default
data partitioner (Murmur3Partitioner).

I tested on some example string that all three methods (hash32, hash2_64
and hash3_x64_128) produce exactly the same output in the new C++ code as
they do in the original Java functions. This is important, because we want
the C++ node to be able to run alongside Java nodes, so they have to agree
on the same hash function.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
[avi: update configure.py]
2014-12-29 19:01:12 +02:00
Gleb Natapov
b958a44304 smp: create seastar threads using DPDK when compiled with DPDK support
DPDK initialization creates its own threads and assumes that application
uses them, otherwise things do not work correctly (rte_lcore_id()
returns incorrect value for instance). This patch uses DPDK threads to
run seastar main loop making DPDK APIs work as expected.
2014-12-18 14:43:37 +02:00
Avi Kivity
d222ea6ceb util: add defer(), a function that defers work until the end of scope 2014-11-18 10:27:51 +02:00
Tomasz Grabiec
3de4680e56 function_input_iterator: fix postfix operator++ 2014-10-30 19:51:21 +02:00
Avi Kivity
5a6771ee33 Drop eclipse workaround for reference qualified member functions
Latest eclipse understands it.
2014-10-19 17:42:47 +03:00
Avi Kivity
d63489d6b8 util: add transform_iterator
Like boost's - an iterator that applies a function to the result
of an underlying iterator.  Unlike boost, it supports using lambdas
for the function.
2014-10-15 17:16:55 +03:00
Avi Kivity
4c64750f76 util: add function_input_iterator
Like boost's template of the same name, but works with lambdas.
2014-10-15 16:57:18 +03:00
Avi Kivity
cca41658aa util: add conversions library
At this time, support parsing a memory size (e.g "2T" == 2 << 40).
2014-10-12 16:34:16 +03:00
Avi Kivity
6f86186e6d eclipse: support for lvalue references 2014-09-08 21:22:51 +03:00
Avi Kivity
6f22345cf0 Add eclipse.hh to hide Eclipse CDT parsing errors 2014-09-04 10:42:01 +03:00