Commit Graph

1096 Commits

Author SHA1 Message Date
Avi Kivity
fa3ae18dcf cql: make function_name more similar to origin
- make members const
- drop overeager assert
2014-12-29 14:27:10 +02:00
Avi Kivity
db256216ec Merge branch 'master' into db
Merge latest seastar fixes into db.
2014-12-28 13:39:15 +02:00
Avi Kivity
efe6e4f5eb sstring: fix conversion to std::string with NUL bytes
sstring's std::string conversion uses c_str() to construct the value,
but the conversion is broken if the value contains NUL - both sstring and
std::string can contain NULs, but C strings use them as a terminator.

Fix by using the size+length std::string constructor.
2014-12-28 13:30:24 +02:00
Raphael S. Carvalho
48019c2df2 memcache: fix cache::item_footprint()
size of the sstring _ascii_prefix should also be added when computing
item footprint. Without this change, reclaimer would end up evicting
more than needed.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2014-12-28 10:24:09 +02:00
Avi Kivity
f1fa69470c Merge branch 'thrift'
This patchset extends the database and thrift layers sufficiently to
pass the cassandra-stress insert test in thrift mode.  I see 70krps
on my desktop (posix stack), likely limited by the client.
2014-12-28 10:03:46 +02:00
Avi Kivity
39176a9439 thrift: partially implement batch_mutate()
Only mutate case (not deletion) for ordinary columns.
2014-12-28 10:03:17 +02:00
Avi Kivity
baa16f6692 thrift: stub execute_cql3_query()
Allows us to proceed further with cassandra-stress.
2014-12-28 10:03:17 +02:00
Avi Kivity
9951a68836 thrift: add exception helpers
Thrift-generated exceptions lack reasonable constructors, so add helpers.
2014-12-28 10:03:17 +02:00
Avi Kivity
58e64ea231 db: add helpers for finding/inserting a row or partition 2014-12-28 10:03:17 +02:00
Avi Kivity
de349cd205 db: store keys and values as serialized bytes, not boost::any
While less efficient, it's similar to what origin does, so will be easier
to follow.
2014-12-28 10:03:17 +02:00
Avi Kivity
ab26aef422 db: add data_type::less()
Compares two values belonging to a data type.
2014-12-28 10:03:17 +02:00
Avi Kivity
415b0f13ec db: add data_type::deserialize(bytes) helper 2014-12-28 10:03:17 +02:00
Avi Kivity
b3a189158b db: add helpers to convert strings to bytes 2014-12-28 10:03:17 +02:00
Avi Kivity
8bde5630f5 db: move row and partition classes around
Make 'data_type' visible to them.
2014-12-28 10:03:17 +02:00
Avi Kivity
36649c4b7d db: implement std::hash<data_type> 2014-12-28 10:03:17 +02:00
Avi Kivity
2733813c87 db: add a "bytes" type, corresponding to ByteBuffer (serialized values)
Using sstring can lead to confusion with UTF8 strings.

The Java byte type is signed, so make bytes' internal type be signed as
well (even though Cassandra tries to treat it as unsigned).

While we should use int8_t, sstring is not perfectly compatible with this
yet, so add a FIXME and use char instead.
2014-12-28 10:01:41 +02:00
Gleb Natapov
466acedcb2 timer: cancel all timers during reactor destruction
If a timer is not canceled it will try to cancel itself during
destruction which may happen after engine is already destroyed.
2014-12-25 09:14:42 +02:00
Avi Kivity
bd6623c0cf Merge branch 'cql' into db
Convert some classes from oac.cql3 to C++ (batch 1).
2014-12-24 15:51:09 +02:00
Avi Kivity
fd4a1d074b cql3: convert functions.AbstractFunction to C++ 2014-12-24 14:18:21 +02:00
Avi Kivity
93266ad69a cql3: convert functions.ScalarFunction to C++ 2014-12-24 14:18:21 +02:00
Avi Kivity
b354fdc16d cql3: convert functions.Function to C++ 2014-12-24 14:18:21 +02:00
Avi Kivity
48499d6c4a cql3: convert functions.FunctionName to C++ 2014-12-24 14:18:21 +02:00
Avi Kivity
b4af3b5f5c cql3: add stub .cc file
Used to include the tons of .hh files that will follow, ensuring they
build.
2014-12-24 14:18:21 +02:00
Avi Kivity
792f606a64 Import cql3 package and sub-packages
Contains the cql3 grammer and supporting classes, which will be converted
one by one.

From commit bf599fb5b062cbcc652da78b7d699e7a01b949ad.
2014-12-24 14:18:21 +02:00
Avi Kivity
858e910fe3 db: implement std::hash<data_type> 2014-12-24 14:18:21 +02:00
Avi Kivity
26461bee58 db: add a "bytes" type, corresponding to ByteBuffer (serialized values)
Using sstring can lead to confusion with UTF8 strings.
2014-12-24 12:16:04 +02:00
Avi Kivity
8336a52b8f Add NOTICE file as required by the Apache license. 2014-12-24 09:47:18 +02:00
Avi Kivity
4fd2c2aab5 Add ORIGIN file to remind us which sources (exact revision) we are converting 2014-12-24 09:45:34 +02:00
Avi Kivity
56684936e6 Merge branch 'thrift' into db
This patchset adds a simple metadata and data store, and wires the
system_add_keyspace RPC to set it up.

With this, cassandra-stress is able to initialize the database (but not
store anything in it).
2014-12-24 09:41:50 +02:00
Avi Kivity
a7360a3ce1 thrift: implement set_keyspace RPC 2014-12-24 09:40:52 +02:00
Avi Kivity
6c6f5c2099 cassandra.thrift: add copyright and change notices
The Apache license requires us to make a note on any changed file.
2014-12-23 19:51:56 +02:00
Avi Kivity
e16345a8d1 licenses: add Apache License 2.0 for code copied from upstream Cassandra 2014-12-23 19:51:18 +02:00
Gleb Natapov
4d25571349 net: fix dhcp renewing
Current code forgets to install dhcp packet filter before renewing
dhcp. The patch fixes this.
2014-12-23 18:45:33 +02:00
Avi Kivity
72ab87f41f thrift: support system_add_keyspace 2014-12-23 18:41:29 +02:00
Avi Kivity
4a3f3847e8 thrift: support set_cql_version 2014-12-23 18:41:29 +02:00
Avi Kivity
a49fd99327 thrift: create a database and pass it to the server
Not sharded yet.
2014-12-23 18:41:29 +02:00
Avi Kivity
641c859903 db: add in-memory database
Simplistic database using std::map<> to hold rows, and boost::any to
hold values.

Supports:
  - multiple key spaces
  - multiple column families
  - a few data types

Does not support:
  - container data types
  - secondary indexes
  - composites
  - validators
2014-12-23 18:41:29 +02:00
Avi Kivity
55b983159b Merge branch 'master' of github.com:cloudius-systems/seastar into db 2014-12-23 18:37:34 +02:00
Avi Kivity
133d39131c net: fix const correctness for byte-order functions
The byte-order functions were changed not to do in-place conversions,
but they still accept non-const inputs, although they do not modify them.
This can make them harder to use in some cases.

Fix by marking the inputs const.
2014-12-23 17:48:16 +02:00
Gleb Natapov
510171d083 net: add function to map packet's rss hash to a cpu
Provide a function that maps packet's rss hash to a cpu that should handle
it. This function is needed to find appropriate src port for outgoing
tcp/udp connection. Use this function to forward de-fragmented ip packet
to avoid one extra hop too.
2014-12-23 17:36:40 +02:00
Vlad Zolotarov
db50b480a3 dpdk: check_port_link_status(): Cosmetics fix of a printouts.
Add a space after the "Checking link status" to prevent it from
merging with "done" if the link is up immediatelly.
For instance this is going to be the case for a VF
of a PF with already established link (e.g. on AWS).

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-23 16:55:50 +02:00
Vlad Zolotarov
1a6474d6cc dpdk: added the asserts to check the assumptions regarding CSUM features
We assume that if Rx IPv4, TCP and UDP checksum offload features are suported then
they are supported or not supported all together. The same is about the Tx UDP and TCP
checksum offload.

Add the assert that check this assumption.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-23 16:55:44 +02:00
Vlad Zolotarov
38781639ef dpdk: Use all availiable parser options for RSS.
Don't limit ourselves to just IPV4, TCP and UDP even if it's all we currently
care about.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-23 16:55:38 +02:00
Vlad Zolotarov
02dd7a3e24 packet: Change the type of offload_info.vlan_tci to std::experimental::optional
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-23 16:51:05 +02:00
Vlad Zolotarov
c9e0e7aff8 dpdk: Set RSS mode: enable RSS if seastar is configured with more than 1 CPU.
Even if port has a single queue we still want the RSS feature to be
available in order to make HW calculate RSS hash for us.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-23 16:50:28 +02:00
Vlad Zolotarov
15e432715a dpdk: Use DPDK provided default configurations for Rx and Tx queues parameters.
DPDK 1.8 provides per-device default Tx and Rx queues configurations in the output
of rte_eth_dev_info_get(). Use them instead of ixgbe tuned hardcoded values.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-23 16:48:31 +02:00
Vlad Zolotarov
51bb90a397 dpdk: Don't print the MAC address from the hw_address() method.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-22 17:37:18 +02:00
Vlad Zolotarov
2b4f9f69f8 dpdk: Make the port initialization stages more pronounced
- Rename: init_port() -> init_port_start().
 - Added a function init_port_fini() that has a code originally found flat in
   init_local_queue().
 - Moved the link state check to init_port_fini() since the link state should
   be checked after the port has been started.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-22 17:37:13 +02:00
Vlad Zolotarov
59403f0774 dpdk: First version that supports both 1.7.x and 1.8.x (current git master) DPDK versions.
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-22 17:37:05 +02:00
Vlad Zolotarov
11c54bd1d5 dpdk: Change the default behavior when --dpdk-pmd is set
1) Make --dpdk-pmd parameter to be a flag instead of a (key, value).
 2) Default to a default hugetlbfs DPDK settings when --hugepages is not
    given and --dpdk-pmd is set.

This will allow a more friendly user experience in general and when one doesn't
want to provide a --hugepages parameter in particular.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-22 17:36:58 +02:00