Registration was done with a null shared_ptr<> instead of make_shared(),
and as a result the max template wasn't even instantiated, so it did not
even build.
To prevent name clashes, we don't call the virtual function implementing
this to_string(), but rather assignment_testable_source_context(), as its
use will be error reporting.
rpc::no_wait is too "no_wait" currently. When client sends a no_wait
message it immediately gets ready future in return, so client cannot
know when data is actually sent and can be discarded. This patch fixes
this by returning a future that will become ready when data is no longer
needed.
For serializing to commit log, and potentially internal wire messaging.
Note: intentionally incompatible with stock C wire/serial format.
Note: intentionally separate from the CQL-centric serialization
for a few reasons.
1.) Need "bulk serializers" for internal objects (mutation etc)
which might not fit well into the "types.hh" serializer schemes.
2.) No need for polymorphism/virtual type parameters since we know
exactly what we serialize and to where.
* database now holds all keyspace + column family object
* column families are mapped by uuid, either generated or explicit
* lookup by name tuples or uuid
* finder functions now return refs + throws on missing obj
This reverts commit e605a0368a.
lowres_clock is not updated when reactor is not running and this
variant of time_it() is not meant to be run in a rector.
The debug-mode sanitizer discovered a bug in sstable::data_read.
I had optimistically wrote this code:
return data_stream_at(pos).read_exactly(len);
This is wrong - data_stream_at returns a temporary input_stream object,
which gets destructed immediately and doesn't live throughout the life
of read_exactly. Obviously, this object does need to live on (among other
things, it holds the buffer which read_exactly reads into).
The solution is an ugly variant of the same thing, but which allocates
memory to hold a copy of the input stream object. Because there is no
single reader (in theory we can have a hundred different reads ongoing
in parallel from the same sstable), we really have choice but to allocate
this read context somewhere. A better solution would not use an input
stream at all, but this is a different issue, already in a FIXME.
This patch fixes the sstable test failure that Jenkins reports.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Cassandra added support for specifying user-specified query handlers
instead of the default QueryProcessor in CASSANDRA-6659. We don't really
need that now and as we're C++, we cannot even support existing custom
query handlers. Therefore, remove the QueryHandler class and references
to it.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This demonstrate how to use a swagger definition file to create an API.
The swagger file demo.json define one api called hello_world, it has
both query and path parameters and return an object as a result.
The handler implementation simply places the given parameters in the
return object.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This takes the json2code perl script from the osv and pass it with small
adaptation.
It takes a swagger definition file and creates a hh file from it with
the following code support.
Api opperations are translated to path_description with a name that
determine by their nick name.
Moduls are defined as json object with the same name.
Enums are defined as enum class, a string to enum function is defined
for any query enum parameters.
For enums that are part of a json object a conversion function is
defined so enum of a different type can be assigned to the target enum
as long as it has the same enum values.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Json path are used when parsing the swagger files. Each path represent
an operation in the swagger files.
They are used to simplified setting a handler or a function to a path.
For example: the code generation would define a json_path like:
path_description hello_world("/hello/world",GET,"hello_world", {},{});
Now to define the handler that would use hello_world, you can simply do:
hello_world.set(r,
[](const_req req) {
return "hello world";
});
When r is a reference to a route object.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
File handlers support reading local file and return it as the result
for the http request.
There are two kind of handler, a file handler will return a specific
file when called. A directory handler expect to find a path parameter
called 'path' and would concatinate this parameter to the direcoty path.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>