Commit Graph

53948 Commits

Author SHA1 Message Date
Avi Kivity
fbd379bedf Merge branch 'cql' of github.com:cloudius-systems/seastar-dev into db
CQL3Type and Functions conversion.
2015-01-14 17:12:43 +02:00
Avi Kivity
dad0858f5f cql: partially convert Functions to C++ 2015-01-14 17:12:08 +02:00
Avi Kivity
cf8161b532 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-01-14 17:02:12 +02:00
Gleb Natapov
c6c6c6055d core: add various statistics about smp communication 2015-01-14 16:50:49 +02:00
Gleb Natapov
354280fd7c core: scollectd: use move instead of forward on rvalue reference 2015-01-14 16:50:48 +02:00
Gleb Natapov
340a871a98 core: use seastar shared ptr in scollectd 2015-01-14 16:50:48 +02:00
Gleb Natapov
660434c3a0 core: change collectd to be a namespace instead of class
Class was used because it provides better encapsulation, but namespace
is easier to deal with.
2015-01-14 16:50:48 +02:00
Avi Kivity
1ecc678857 reactor: fix potential allocations in syscall thread pool
Throwing an exception may allocate memory, which we don't want to do
in the syscall thread pool (only reactor threads support allocation, for now).

Move the conversion of negative syscall results to exceptions to a separate
task, running in the reactor thread, to avoid this.
2015-01-14 16:49:04 +02:00
Pekka Enberg
706c98a918 cql3: convert Cql.g to C++
Convert Cql.g to produce C++. To make things compile, convert the
useStatement grammar rule. Also add an ugly sed hack in configure.py to
support "#if 0" in the grammar file.

This patch also disables -Werror and enables -fpermissive for
antlr-generated code which attempts to convert a const pointer to a
non-const pointer without a cast:

  build/release/gen/cql3/CqlParser.cpp: In member function ‘void CqlParser::cfOrKsName(cql3::cf_name&, bool)’:
  build/release/gen/cql3/CqlParser.cpp:460:72: warning: invalid conversion from ‘const CommonTokenType* {aka const antlr3::CommonToken<antlr3::Traits<CqlLexer, CqlParser> >*}’ to ‘antlr3::Traits<CqlLexer, CqlParser>::CommonTokenType* {aka antlr3::CommonToken<antlr3::Traits<CqlLexer, CqlParser> >*}’ [-fpermissive]
               t =  this->matchToken(IDENT, &FOLLOW_IDENT_in_cfOrKsName153);

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-14 15:47:41 +02:00
Gleb Natapov
ceeab9a330 replace ad-hoc index list generator with standard one 2015-01-14 14:59:02 +02:00
Gleb Natapov
c3558f188b replace ad-hoc index list generator with standard one 2015-01-14 14:53:46 +02:00
Asias He
dfc19433bb dht: Switch to i_partitioner in ring_position 2015-01-14 14:51:06 +02:00
Asias He
79832823ed db: Add missing virtual destructor for i_mutation 2015-01-14 14:51:05 +02:00
Asias He
3af55230e1 db: Switch to use real UUID in db/i_mutation.hh 2015-01-14 14:51:04 +02:00
Nadav Har'El
7c87c6cc27 UUID: add to_sstring() method
Add UUID::to_sstring() method, analogous to the Java UUID.toString(),
and I verified that it generates the same output as the original Java
method.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
[avi: make it build, using sprint() instead of sprintf()]
2015-01-14 14:43:45 +02:00
Avi Kivity
08a7425b4a cql: fix minor build errors 2015-01-14 11:38:41 +02:00
Avi Kivity
3a039188cf cql: fix bytes_conversion_fcts build errors 2015-01-14 11:38:41 +02:00
Avi Kivity
2e6004a3ce cql: fix aggregate_fcts build errors 2015-01-14 11:38:41 +02:00
Avi Kivity
9e1d39c95f cql: convert CQL3Type to C++ 2015-01-14 11:38:41 +02:00
Avi Kivity
73d9d3fd64 cql: switch from unique_ptr<function> to shared_ptr<function>
The Functions class wants to store functions in a map and hand them out later,
so we need a shared_ptr.

(could have had a map of name -> function factory, maybe one day)
2015-01-14 11:38:41 +02:00
Avi Kivity
50f280261c db: fix definition of int32_type 2015-01-14 11:38:41 +02:00
Takuya ASADA
e1552ad3b6 core: rename smp.hh to distributed.hh
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-14 11:16:09 +02:00
Pekka Enberg
821bfc66d1 cql3: Fix cql3_statement::execute_internal signature
It's supposed to be a pure virtual method. Needed to be able to link
cql_statement.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-14 09:01:18 +02:00
Pekka Enberg
485620abcf cql3: Fix cql_statement and parsed_statement confusion
Cassandra's ParsedStatement does not implement CqlStatement. Classes
such as UseStatement extend ParsedStatement and implement CqlStatement
which causes JVM to dispatch methods such as usesFunction to
ParsedStatement.

This doesn't happen in C++, of course, which leaves classes such as
use_statement abstract and thus uninstantiable.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-14 09:01:18 +02:00
Pekka Enberg
8330fa0b78 cql3: Make cf_name operator<< inline to avoid multiple copies
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-14 09:01:18 +02:00
Pekka Enberg
96c849681d cql3: Add empty destructor to cql_statement
Needed for antlr-generated code to link.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-14 09:01:11 +02:00
Calle Wilund
58f614d858 Make align methods constexpr for usage in statics/constexprs 2015-01-13 19:35:48 +02:00
Avi Kivity
7596819034 file: define move assignment operator 2015-01-13 19:08:48 +02:00
Avi Kivity
8135865ad6 Merge branch 'takuya/reuseportv3' of github.com:cloudius-systems/seastar-dev
Use SO_REUSEPORT to let the kernel distribute accepted connections, from
Takuya.
2015-01-13 17:38:38 +02:00
Gleb Natapov
98c9a7f52f core: make sconnectd.hh include file list more reasonable
Currently it include the whole reactor.hh, but it needs only a small part
of what it brings.
2015-01-13 17:28:40 +02:00
Gleb Natapov
2b4a309ad6 core: do not start smp queue to self 2015-01-13 17:28:39 +02:00
Gleb Natapov
d4db9493ae core: remove unused smp code 2015-01-13 17:28:39 +02:00
Takuya ASADA
16705be1f4 Distribute incomming connection by kernel using SO_REUSEPORT
With SO_REUSEPORT, we can bind() & accept() on each thread, kernel will dispatch incomming connections.

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-13 20:04:32 +09:00
Takuya ASADA
fde6c412c2 reactor: Add SO_REUSEPORT availability check method
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-13 20:01:43 +09:00
Avi Kivity
69f61e31ea cql3: convert BytesConversionFcts 2015-01-13 11:34:29 +02:00
Glauber Costa
7f96fc9509 db: read all keyspaces from directory structure
This patch includes a helper function that executes a function for each entry
in a directory. It is future based and can include in the future, future-based
code to asychronously read, for instance, an sstable.

At the moment, it only scan all keyspaces and make sure they appear in the
keyspaces hash.

Both the database and keyspace classes gain a populate<T> factory that returns a
populated database. At this point, the names found are just listed, but not really
stored anywhere.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-01-13 10:41:13 +02:00
Avi Kivity
4c46f4db8c tests: test literal + sstring concatenation 2015-01-13 10:13:05 +02:00
Avi Kivity
16c8414523 sstring: add literal + sstring concatentation overload 2015-01-13 10:12:36 +02:00
Avi Kivity
ea3cba1c79 Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-01-13 10:03:49 +02:00
Tomasz Grabiec
84d35f8850 Fix use-after-free on database object
Caused urchin to SIGSEGV.
2015-01-12 21:04:36 +02:00
Avi Kivity
a52a3dd5ca sstring: add standard member typedefs
Add standard member typedefs, so that standard algorithms looking for
them using their standard names can find them and not spew error messages.
2015-01-12 20:25:21 +02:00
Glauber Costa
66a6a3b50e add a header to file.hh
I am currently unable to use core/file.hh in a fresh include file. Type
conflicts arise, which probably don't happen in other existing files because
of existing includes that end up getting the environment all right beforehand.

FAILED: g++ -MMD -MT build/release/db/db.o -MF build/release/db/db.o.d -std=gnu++1y -g  -Wall -Werror -fvisibility=hidden -pthread -I.   -DHAVE_XEN -DHAVE_HWLOC -DHAVE_NUMA -O2 -I build/release/gen -c -o build/release/db/db.o db/db.cc
In file included from ./sstables.hh:4:0,
                 from ./database.hh:22,
                 from db/composites/composite.hh:27,
                 from db/db.cc:8:
./core/file.hh:35:64: error: ‘iovec’ was not declared in this scope
     virtual future<size_t> write_dma(uint64_t pos, std::vector<iovec> iov) = 0;

Adding <sys/uio.h> to the include list of file.hh makes it includable (apparently) anywhere.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-01-12 18:59:11 +02:00
Vlad Zolotarov
585f6452b9 DPDK: Properly handle the case when RSS info is not available (e.g. VF case)
- Adjust the asserts.
 - Add an assert in the place where we should not get if RSS info is not provided.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2015-01-12 18:45:48 +02:00
Avi Kivity
a706cada5f Merge branch 'gleb/net' of github.com:cloudius-systems/seastar-dev
Expand network tx path inversion into udp and icmp, from Gleb.
2015-01-12 18:39:49 +02:00
Gleb Natapov
f11e1f31d6 net: cleanup ipv4 code that is no longer used 2015-01-12 17:40:29 +02:00
Gleb Natapov
19ced3da4c net: fix dhcp to use use udp socket to send packets
No need for ad-hoc code to create udp packets.
2015-01-12 17:39:07 +02:00
Gleb Natapov
9c229d449a net: remove unused ipv4_l4::send() function
After previous patches this one is no longer used.
2015-01-12 17:38:44 +02:00
Gleb Natapov
d10575aea5 net: add tcp packet queue for non tcb packets
Some packets generated by tcp do not belong to any connection. Currently
such packets are pushed to ipv4 directly. This patch adds a packet queue
for ipv4 to poll them from and limits amount of memory those packets can
consume.
2015-01-12 17:35:35 +02:00
Gleb Natapov
fda06cd81f net: continue network stack inversion into icmp
Poll icmp from ipv4 instead of pushing packets from icmp to ipv4. Also
limit how much memory outstanding icmp packets can consume.
2015-01-12 17:34:19 +02:00
Gleb Natapov
6da00ab956 net: continue network stack inversion into udp
Poll udp channels from ipv4 instead of pushing packets from udp to ipv4
2015-01-12 17:34:10 +02:00