Commit Graph

4558 Commits

Author SHA1 Message Date
Calle Wilund
ef2cc9b05d BatchLogManager.java -> C++
Somewhat simplifies version of the Origin code, since from what I 
can see, there is less need for us to do explicit query sends in 
the BLM itself, instead we can just go through storage_proxy. 
I could be wrong though.
2015-07-08 10:59:57 +02:00
Calle Wilund
c1a5627c12 Import BatchlogManager.java 2015-07-08 10:59:57 +02:00
Calle Wilund
4ba0bf7ac6 system_keyspace : add support for storing and reading truncation
* Straight re-impl of origin code
* Uses system tables not yet created, so does not actuall work...
2015-07-08 10:59:57 +02:00
Calle Wilund
0e500b6759 db::serializer : add replay_position serializer 2015-07-08 10:50:46 +02:00
Calle Wilund
8a8694cbbf Add naive rate limiter object
This is mostly a placeholder, since the "limiting" is rather coarse
and stuttering
2015-07-08 10:50:46 +02:00
Calle Wilund
806fc04b37 token_metadata.hh : implement get_all_endpoints
+ add number_of_endpoints()
2015-07-08 10:50:46 +02:00
Avi Kivity
957b4076a2 Merge "CQL: Handle token function & restrictions" from Calle
"Implementation of:

* Token func
* Token restriction
* Token relation
* Token cql parsing

This series contains some hefty refactoring of the cql3::restrictions
interfaces, to handle the slightly different conditions of the token
relation. (See individual commit comment)"
2015-07-08 11:35:22 +03:00
Calle Wilund
84b5ba5270 query_processor bug fix: execute_internal did not keep options alive
... across the whole call chain. Should fix test failure.
2015-07-08 11:03:57 +03:00
Calle Wilund
94fcce501e Cql3.g: handle token in grammar 2015-07-08 10:02:31 +02:00
Calle Wilund
bb6677b47a TokenRelation: Java -> c++ 2015-07-08 10:02:31 +02:00
Calle Wilund
d7c10ff3b6 cql3::relation - fix constness 2015-07-08 10:02:31 +02:00
Calle Wilund
73421cb413 TokenRestriction: Java->c++ 2015-07-08 10:02:31 +02:00
Calle Wilund
4a5a5359b0 cql3::restrictions - refactor and clean up
Needed to reasonably cleanly implement token restrictions. 

* Fixed constness for various virtuals. 
* primary_key_restrictions now inherit abstract_restriction,
  similuar to Origin (for better or for worse), to avoid 
  duplicating attributes etc. 
* primary_key_restrictions bounds & values renamed (so not to
  collide with restriction), and some logic pushed downwards 
  (building bounds), to avoid abstraction breakage in 
  statement_restrictions
* primary_key_restrictions merging is now potentially replacing
  to make dispatching token/multicolumn restrictions simpler
2015-07-08 10:02:31 +02:00
Calle Wilund
a18889380e cql3::functions::functions: dispatch token function 2015-07-08 10:02:31 +02:00
Calle Wilund
b17c3bf6df TokenFct Java->C++ 2015-07-08 10:02:31 +02:00
Calle Wilund
9c4c9eff50 schema: add outstream << op to print column_definition pointers
- since these are typically non-smart.
2015-07-08 10:02:31 +02:00
Calle Wilund
15642f917c query_processor bug fix: execute_internal did not keep options alive
... across the whole call chain. Should fix test failure.
2015-07-08 10:02:30 +02:00
Paweł Dziepak
189dfd5954 tests/type: add test cases for validation
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-08 10:02:30 +02:00
Paweł Dziepak
414c37f06f types: implement validation for built-in types
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-08 10:02:30 +02:00
Paweł Dziepak
0d869276b5 tests/cql: add tests for blobAs*() and *AsBlob() functions
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-08 10:02:30 +02:00
Paweł Dziepak
296a77b7f3 cql3: fix *asblob() and blobas*() functions names
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-08 10:02:30 +02:00
Avi Kivity
dd29ac9593 Merge "cqlsh" from Glauber
System table Work to make cqlsh connect.
2015-07-07 19:33:23 +03:00
Glauber Costa
137cf22abf system.local: convert host_id functions
They are already futurized, we just have to implement them.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
a9e69a34cb system.local: convert bootstrap state
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
6d58675092 system.local: force blocking flush
Allows a CF to be flushed, and wait for it to finish.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
072de63427 system.local: convert check_health
This function is called at startup and makes sure that the cluster_name field
in system.local exists, and if it exists, that it matches the expected value.

To simplifly things, I am leaving the sstable check out. For us, that would be
a map-reduce operation, and if the sstables are indeed corrupted, we would have
caught that already for sure.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
30008bc0b1 system.local: schema version
This patch provide a function to store the current schema version.
Currently, it is called every time the node boots, with a random schema.
That is incorrect and will be fixed shortly. But for now, cqlsh needs
to see a valid value here, so this will do.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
e5d27d6485 system.local: setup version fields
Done every time the node boots, unconditionally.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
d5302ac796 futurize set_tokens
Soon that will involve a query. The idiom make_ready_future<>().then()
is a bit unusual to say the least, but it will soon be replace by an
actual future.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
5545e08bf7 database: introduce flush method
We will have to flush it from other places as well, so wrap the flushing code
into a method - specially because the current code has issues and it will be
easier to deal with it if it is in a single place.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
0f68010152 futurize get_local_host_id and set_local_host_id
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:23 -04:00
Glauber Costa
fd4c384216 thrift version field
Same as C*

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
ffdd2eaacb query_options: use version::native_protocol() for version
Now that we have it, we can reuse here instead of hard coding the number 3.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
90b9de9939 add file with some version strings that don't really belong anywhere
This should really be generated by the build scripts, but since we haven't
even discussed any versioning scheme, I'm introducing the functions here - they
are needed to populate some system tables, and later on we can make them return
the right thing.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
157f5991ac system keyspace: setup queries
We won't create our own versions of database and query_proxy, so we need
some setup to be done. The current code will capture those variables and
setup the structure used to conduct the queries. Later on, it will also
carry on the database's basic setup.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
ba33af1a8d service: split messaging service initialization in two parts
The messaging service is initialized very early, before we have the
proxy or query processor initialized. It is mostly fine, except for
the fact that the messaging service also finishes the initialization
of the storage service. That part will issue queries agains the system
tables, (as soon as we support them), and need to happen later.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
bd13e3995b dht: implement method to convert a token to a string
We need to be able to do it so we can, among other things, create CQL
statements that include the current state of the tokens.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
586ccd43b0 query processor: relay internal queries
If the client state is marked as internal, go for the internal version
of the queries instead.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
39e4e98c35 client_state: default to system for internal queries
Most of the time we're querying internal, we are going for the system.
Defaulting to it just makes it easier, and callers can still change it
with set_keyspace if needed.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
fe6be361ba cql_tests: mark the client as external instead of external
What "internal" really means here, is queries that operate on the system tables.
Up until now, there wasn't really an issue because we weren't really checking
on this flag, and the internal calls were all unimplemented.

Now that we are about to hook up the internal calls, leaving this state marked
as internal will lead us to fail when we try to issue statements - like create
table - that are not, and will not be implemented in their internal
counterparts.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
03cca755ac cql3: fix use-after-move
received is moved to the inner attribute _receiver. Trying to call receiver
after that will SEGFAULT us.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
ae3c7283f9 cql3: allow for the creation of empty untyped_result_set messages
They are useful in situations when we have nothing to respond.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
45905ec94d dht: change partitioner name to sstring
It is a better fit for things that are names, not blobs. We have a user that expects
a bytes parameter, but that is for no other reason than the fact that the field used
to be of bytes type.

Let's fix that, and future users will be able to use sstrings

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Glauber Costa
3087df014d untyped_result_set: add include guard
Otherwise it will eventually break

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-07 11:38:22 -04:00
Avi Kivity
c719475901 Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-07-07 18:29:38 +03:00
Calle Wilund
db0469af80 test.py: add query_processor_test to list
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-07-07 17:21:00 +02:00
Avi Kivity
5d9222d935 Merge "Filter sstable data not belonging to current shard" from Tomasz
"We don't want multiple shards to respond with the same data. Higher level code
assumes that shard data is non-overlapping. It's cheaper to drop duplicates as
soon as possible. Memtable reader for example will never have overlapping
data, so cache hitting queries will never need to pay for this. Compaction
process may also rely on this."
2015-07-07 18:12:35 +03:00
Calle Wilund
c5f6348572 test.py: add query_processor_test to list
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-07-07 18:12:22 +03:00
Avi Kivity
a7d608b33a Merge seastar upstream 2015-07-07 18:11:57 +03:00
Avi Kivity
19206a038f reactor: stop using SIGALRM
SIGALRM is used by the boost unit test library, which interferes with our
use.  This causes spurious unit test failures.

Switch to a real-time signal instead.
2015-07-07 18:00:35 +03:00