Commit Graph

53948 Commits

Author SHA1 Message Date
Pekka Enberg
842eb00a68 cql3: Import IndexName.java
Origin commit: ebc50d783505854f04f183297ad3009b9095b07e

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:33:28 +03:00
Pekka Enberg
2c02c9c436 cql3: Convert KeyspaceElementName to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:31:56 +03:00
Pekka Enberg
34563ca8e4 cql3: Import KeyspaceElementName.java
Origin commit: ebc50d783505854f04f183297ad3009b9095b07e

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:12:15 +03:00
Paweł Dziepak
19d4cd7449 json: do not add a newline at the end of string
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-10 01:29:23 +02:00
Paweł Dziepak
da52b5d5da json: explicitly set Json::Value type to objectValue
Proper Json::Value type would be set implicityl after the first map
element is added. That's not going when the map is empty.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-10 01:29:23 +02:00
Paweł Dziepak
ede9886f50 dht: add byte_ordered_partitioner
Some of the tests in DTEST take advantage of the fact that
ByteOrderedPartitioner guarantees certain ordering of partition keys.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 23:43:16 +02:00
Tomasz Grabiec
c084a86de6 tests: Add more tests for data queries 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
a0cb362838 types: Support serialization of empty values
deserialization already can produce empty values, so we should also be
able to serialize them.
2015-07-09 19:55:01 +02:00
Tomasz Grabiec
9a0c48d829 tests: Switch to partition_slice_builder in mutation_test 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
ec65d7fa73 Introduce partition_slice_builder 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
31081f91c4 tests: Fix row_assertion::matches() to deal with empty boost::any properly 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
197196c6b0 tests: Introduce result_set_assertions::has_size() 2015-07-09 19:55:00 +02:00
Tomasz Grabiec
9aec8b9591 query: result_set: Use type's to_string() to get prettier printout 2015-07-09 19:55:00 +02:00
Tomasz Grabiec
cb9b48d9be query: result_set: Add static columns even if there are no clustered rows 2015-07-09 19:55:00 +02:00
Tomasz Grabiec
5af1769326 tests: Add more CQL query tests 2015-07-09 19:55:00 +02:00
Tomasz Grabiec
9724b84bb3 db: Fix query of partitions with no live clustered rows
When partition has no live regular rows, but has some data live in the
static row, then it should appear in the results, even though we
didn't select any static column.

To reproduce:

  create table cf (k blob, c blob, v blob, s1 blob static, primary key (k, c));
  update cf set s1 = 0x01 where k = 0x01;
  update cf set s1 = 0x02 where k = 0x02;
  select k from cf;

The "select" statement should return 2 rows, but was returning 0.

The following query worked fine, because static columns were included:

  select * from cf;

The data query should contain only live data, so we shouldn't write a
partition entry if it's supposed to be absent from the results. We
can'r tell that though until we've processed all the data. To solve
this problem, query result writer is using an optimistic approach,
where the partition header will be retracted from the buffer
(cheaply), if it turns out there's no live data in it.
2015-07-09 19:55:00 +02:00
Tomasz Grabiec
c742529e52 bytes_ostream: Introduce retract()
Useful for optimistic writers, where it's easier/cheaper to retract
later than to calculate the decision up front.
2015-07-09 19:55:00 +02:00
Tomasz Grabiec
09ed972068 mutation_partition: Remove redundant slice parameter from query()
The slice used by partition_writer must match the one used by query()
anyway.
2015-07-09 19:47:32 +02:00
Tomasz Grabiec
c975e7fb56 db: atomic_cell: Fix misnamed parameter 2015-07-09 19:46:30 +02:00
Tomasz Grabiec
33778231d9 db: atomic_cell: Introduce is_covered_by() helper 2015-07-09 19:46:29 +02:00
Tomasz Grabiec
da937897cf memtable: Introduce as_data_source() 2015-07-09 19:46:29 +02:00
Tomasz Grabiec
8a18d2b699 Extract memtable implementation to memtable.cc 2015-07-09 19:46:29 +02:00
Tomasz Grabiec
176fa9d049 storage_proxy: Simplify query_local() 2015-07-09 18:53:03 +02:00
Tomasz Grabiec
c3f7856853 bytes_ostream: Introduce fragment iterator 2015-07-09 18:53:03 +02:00
Tomasz Grabiec
a03fc3549b query-result: Add missing include 2015-07-09 18:53:03 +02:00
Avi Kivity
290804baec Merge "Functions to update the peer table" from Glauber 2015-07-09 19:33:10 +03:00
Avi Kivity
50236b69b3 Merge "Fix floating point comparison" from Paweł
"This change makes comparing floating point values behave exactly like
it does in case of Java compareTo() function, which is different than
the usual IEEE 754 behaviour."
2015-07-09 19:09:18 +03:00
Glauber Costa
afee9ab72a system_keyspaces: implement remove_endpoint
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:58:31 -04:00
Glauber Costa
e559959632 system_keyspace: implement update_peer_info
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:58:31 -04:00
Glauber Costa
38465dea70 system_keyspaces: implement load_dc_rack_info
To implement that, we will resort to a cache mechanism, instead of doing the
query all the time.  This is mainly because we want to avoid overfuturization
of the callers, that are usually just interested in passing simple strings
around.

We will be able to intercept all updates to it, and maintain consistency with our
internal cache. The updates are not done in this patchset.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:58:30 -04:00
Paweł Dziepak
92740919eb tests/type: add test for comparing floating point values
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 17:52:45 +02:00
Paweł Dziepak
cf07b4c09a types: make comparing floating point values follow Java behavior
In Java method compareTo() of Float and Double types doesn't strictly
follow IEEE 754. Firstly, NaN is equal NaN and is greater than any other
value. Secondly, positive zero is larger than negative zero.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 17:52:45 +02:00
Avi Kivity
d170efbfcb fstream: optimize file_data_source_impl
file_data_source_impl always calls file::size(), which can be slow.  This
slows down applications that create many short-lived input streams on the
same file (for random-access processing of a subset of the data).

Fix by not calling size(), and letting the file code handle short reads
itself.
2015-07-09 18:40:05 +03:00
Glauber Costa
d43933e642 gms: add addr method to inet_addr
Because the cql types deal with a raw inet address and not the gms container, we need
a method to fetch it

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 11:27:45 -04:00
Avi Kivity
28652c669f Merge "UTF8 validation in CQL binary protocol" from Paweł
"These patches add verification that strings passed using CQL binary protocol
are valid utf8. Exception hierarchy is also adjusted to make sure that
protocol exceptions are properly translated to an appropriate error code.

This makes DTEST cql_tests.py:TestCQL.invalid_string_literals_test pass."

Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-09 17:44:09 +03:00
Glauber Costa
4ed027bf89 types: add data_type for inet_address
That was still missing

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 09:34:30 -04:00
Glauber Costa
6b8d823c82 gms: allow the construction of the object from a net address
That is what is going to be stored in the data_type(), so provide the conversion

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 09:34:22 -04:00
Tomasz Grabiec
06917666f9 Merge tag 'bootstrap-v3' from git@github.com:glommer/urchin.git
Among other things, saving of system keyspace schema, from Glauber.
2015-07-09 15:31:27 +03:00
Glauber Costa
bac0a8a680 legacy_schema_tables: convert save_system_keyspace_schema()
This function is called at bootstrap, to make sure the system tables exist in
the keyspace list. I honestly don't know why do we have to force a delete +
reconstruct. But let's keep consistency with Origin here.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 08:12:47 -04:00
Avi Kivity
ea67ca03af file: fix file::size() signature
file::size() uses size_t as an alias for uint64_t, but it isn't.  Use the
right type.
2015-07-09 15:07:58 +03:00
Avi Kivity
e96d07d614 file: optimize file::size() for posix
lseek() won't block, so use it for fetching the size of a file directly
from the reactor thread, instead of an iothread.
2015-07-09 15:01:42 +03:00
Paweł Dziepak
4273c6d390 transport: verify that strings are valid utf8
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 13:41:35 +02:00
Paweł Dziepak
ac776d2618 exceptions: remove transport_exception
transport_exception is an interface implemented by both
cassandra_exception and protocol_exception. The logic implemented in
both these subclasses is identical.

This patch removes transport_exception and makes protocl_exception a
subclass of cassandra_exception.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 13:39:31 +02:00
Tomasz Grabiec
31b0c60640 Merge branch 'penberg/cql-drop-table' from seastar-dev.git
From Pekka:

"This series enables DROP TABLE statement in the front-end. Our
back-end is not really prepared to deal with it so throw "not
implemented" exception from migration manager."
2015-07-09 10:53:48 +02:00
Avi Kivity
8857f42c5f Merge "Wire up streaming and ssstable" from Asias 2015-07-09 11:37:22 +03:00
Tomasz Grabiec
724099abe9 query: result_set_builder: Use the set of columns which was queried for
This builder is the one used to build the convenient result_set (not
on fast path). The builder was assuming that the whole set of columns
was always queried, which resulted in buffer underflow exceptions
during parsing of the results if this was not the case. Let's also
handle queries which have narrower column sets.
2015-07-09 11:35:31 +03:00
Asias He
b7b0aa3318 streaming: Negotiate core to core connection.
In streaming code, we need core to core connection(the second connection
from B to A). That is when node A initiates a stream to node B, it is
possible that node A will transfer data to node B and vice verse, so we
need two connections. When node A creates a tcp connection (within the
messaging_service) to node B, we have a connection ip_a:core_a to
ip_b:core_b. When node B creates a connection to node B, we can not
guarantee it is ip_b:core_b to ip_a:core_a.

Current messaging_service does not support core to core connection yet,
although we use shard_id{ip, cpu_id} as the destination of the message.

We can solve the issue in upper layer. We can pass extra cpu_id as a
user msg.

Node A sends stream_init_message with my_cpu_id = current_cpu_id

Node B receives stream_init_message, it runs on whatever cpu this
connection goes to, then it sends response back with Node B's
current_cpu_id.

After this, each node knows which cpu_id to send to each other.

TODO: we need to handle the case when peer node reboots with different
number of cpus.
2015-07-09 15:52:28 +08:00
Asias He
853175fc61 streaming: Implement prepare_message handler
This is a bit different from Origin. We always send back a
prepare_message even if the initializer requested no data from the
follower, to unify the handling.
2015-07-09 15:52:28 +08:00
Asias He
abfcf7d825 streaming: Send prepare_message message 2015-07-09 15:52:28 +08:00
Asias He
7ae860a43a streaming: Enable init_receiving_side 2015-07-09 15:52:28 +08:00