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.
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>
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()]
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)
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>
With SO_REUSEPORT, we can bind() & accept() on each thread, kernel will dispatch incomming connections.
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
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>
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>
- 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>
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.