Commit Graph

4505 Commits

Author SHA1 Message Date
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
8e2d36ed74 Merge seastar upstream 2015-07-07 17:34:32 +03:00
Avi Kivity
7ad4483879 Revert "build: allow the compiler to be a script"
This reverts commit 68b192d1be5efb50e49e46f19370ed49d9d28e30; it fails
unconditionally, causing debug symbols (for example) not to be emitted.
2015-07-07 17:17:46 +03:00
Avi Kivity
5d6c960faa Merge "Announce schema mutations in cluster" from Pekka
"This series implements schema mutation announcement by pushing schema
mutations via migration manager as well as wiring up DEFINITIONS_UPDATE
verb to the merge_schema() function. This makes schema changes visible
to all nodes that are live at the time:

  Node 1:

  [penberg@nero apache-cassandra-2.1.7]$ ./bin/cqlsh --no-color 127.0.0.1
  Connected to TestCluster at 127.0.0.1:9042.
  [cqlsh 5.0.1 | Cassandra 3.0.0-SNAPSHOT | CQL spec 3.2.0 | Native protocol v3]
  Use HELP for help.
  cqlsh> CREATE KEYSPACE keyspace3 WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
  cqlsh> SELECT * FROM system.schema_keyspaces;

   keyspace_name | durable_writes | strategy_class                             | strategy_options
  ---------------+----------------+--------------------------------------------+------------------------------
       keyspace3 |           True |                             SimpleStrategy | {"replication_factor":"1"}\n
          system |           True | org.apache.cassandra.locator.LocalStrategy |                           {}

  (2 rows)
  cqlsh> CREATE TABLE keyspace3.standard1 ( key blob PRIMARY KEY, C0 blob, C1 blob, C2 blob, C3 blob, C4 blob);
  cqlsh> SELECT keyspace_name, columnfamily_name, key_validator FROM system.schema_columnfamilies;

   keyspace_name | columnfamily_name     | key_validator
  ---------------+-----------------------+-------------------------------------------
       keyspace3 |             standard1 | org.apache.cassandra.db.marshal.BytesType
          system |                 local |  org.apache.cassandra.db.marshal.UTF8Type
          system |                 peers |  org.apache.cassandra.db.marshal.UTF8Type
          system | schema_columnfamilies |  org.apache.cassandra.db.marshal.UTF8Type
          system |        schema_columns |  org.apache.cassandra.db.marshal.UTF8Type
          system |      schema_keyspaces |  org.apache.cassandra.db.marshal.UTF8Type

  (6 rows)
  cqlsh>

  Node 2:

  [penberg@nero apache-cassandra-2.1.7]$ ./bin/cqlsh --no-color 127.0.0.2
  Connected to TestCluster at 127.0.0.2:9042.
  [cqlsh 5.0.1 | Cassandra 3.0.0-SNAPSHOT | CQL spec 3.2.0 | Native protocol v3]
  Use HELP for help.
  cqlsh> SELECT * FROM system.schema_keyspaces;

   keyspace_name | durable_writes | strategy_class                             | strategy_options
  ---------------+----------------+--------------------------------------------+------------------------------
       keyspace3 |           True |                             SimpleStrategy | {"replication_factor":"1"}\n
          system |           True | org.apache.cassandra.locator.LocalStrategy |                           {}

  (2 rows)
  cqlsh> SELECT keyspace_name, columnfamily_name, key_validator FROM system.schema_columnfamilies;

   keyspace_name | columnfamily_name     | key_validator
  ---------------+-----------------------+-------------------------------------------
       keyspace3 |             standard1 | org.apache.cassandra.db.marshal.BytesType
          system |                 local |  org.apache.cassandra.db.marshal.UTF8Type
          system |                 peers |  org.apache.cassandra.db.marshal.UTF8Type
          system | schema_columnfamilies |  org.apache.cassandra.db.marshal.UTF8Type
          system |        schema_columns |  org.apache.cassandra.db.marshal.UTF8Type
          system |      schema_keyspaces |  org.apache.cassandra.db.marshal.UTF8Type

  (6 rows)
  cqlsh>

We eventually also need schema pulling capability for nodes that join
late or get out of sync for full schema distribution support. That is,
however, out of scope for this patch series."
2015-07-07 17:15:14 +03:00
Pekka Enberg
9cc9cf1e76 service/migration_manager: Announce schema mutations in cluster
Announce schema mutations in a cluster via the DEFINITIONS_UPDATE verb
and pass them to merge_schema() at endpoints.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-07 16:48:41 +03:00
Avi Kivity
c77761a8b1 messaging: improve serialization for vectors
Various enable_if overload take precedence if a non-const frozen_mutation
is provided (instead of matching the const frozen_mutation& signature).

Provide a non-const frozen_mutation& signature to work around the issue.
2015-07-07 16:48:41 +03:00
Avi Kivity
228762421c messaging: support complex types in vector<> serialization
do_with() required a movable type, but the union U is not movable if the
vector element type is not, with out help from us.
2015-07-07 16:48:41 +03:00
Pekka Enberg
a358990855 db/legacy_schema_tables: Pass storage_proxy by reference
We always operate on the local storage proxy so pass it by reference.
This simplifies DEFINITIONS_UPDATE message handler where all we have is
a "this" pointer to the local storage proxy.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-07 16:27:58 +03:00
Pekka Enberg
8a897f2979 message/messaging_service: Add versioning stubs
We only support one version for now but it's easier to convert callers
if the APIs are there.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-07 16:27:58 +03:00
Avi Kivity
0452175ef1 Merge "Enabling *asBlob() and blobAs*() functions" from Paweł
"This series enables *asBlob() and blobAs*() built-in cql functions. Both
of them were already implemented but the names were autogenerated using
fully qualified class name instead of cql type name. Moreover, built-in types
didn't have validate() method implemented what prevented blobAs*() from
failing on incorrect data."
2015-07-07 15:37:20 +03:00
Avi Kivity
a65aea1399 Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-07-07 15:36:46 +03:00
Avi Kivity
fb28054c2e cql3: convert sets::marker::bind to C++ 2015-07-07 14:31:35 +02:00
Paweł Dziepak
752d9e6699 tests/type: add test cases for validation
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-07 13:58:57 +02:00
Paweł Dziepak
c139f1c1d7 types: implement validation for built-in types
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-07 13:57:47 +02:00
Pekka Enberg
86d913954a db/legacy_schema_tables: Store CF "is_dense" to system tables
Persist column family's "is_dense" value to system tables. Please note
that we throw an exception if "is_dense" is null upon read. That needs
to be fixed later by inferring the value from other information like
Origin does.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-07 12:36:50 +02:00
Avi Kivity
8429e39a9f Merge seastar upstream 2015-07-07 13:25:52 +03:00
Gleb Natapov
3dbccbc5b5 rpc: read value from a tuple before moving it
Noticed by Tomek.
2015-07-07 13:21:11 +03:00
Pekka Enberg
3437a49d26 cql3: Enable CF "bloom_filter_fp_chance"
Enable column family "bloom_filter_fp_chance" from the CQL front-end and
make sure its persisted to system tables.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-07 13:09:58 +03:00
Nadav Har'El
9b63b02328 doc: fix small mixup in reference (pipe.hh)
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-07-07 12:57:09 +03:00
Avi Kivity
0c848e9a4e rpc: add missing move()s in get_reply()
If the reply is a movable-but-not-copyable type, then we must move it into
the returned future.  Also faster even if the type is copyable.
2015-07-07 12:56:33 +03:00
Paweł Dziepak
a7a231f8dc tests/cql: add tests for blobAs*() and *AsBlob() functions
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-07 11:32:21 +02:00
Paweł Dziepak
a910294be0 cql3: fix *asblob() and blobas*() functions names
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-07 11:24:43 +02:00
Tomasz Grabiec
c86a591aee Merge branch 'dev/pdziepak/types-from-string/v2' 2015-07-07 11:33:23 +03:00
Paweł Dziepak
9b61d4d433 tests/types: add tests for timeuuid, uuid, timestamp and inet
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:46:09 +02:00
Avi Kivity
af30fe11df doc: more info in fiber module reference table 2015-07-07 00:38:53 +03:00
Paweł Dziepak
00da6e24fc tests/cql: test insert and select for all types
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:38:27 +02:00
Paweł Dziepak
1552788098 transport: catch cassandra_exception and pass it to client
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:37:04 +02:00
Paweł Dziepak
8945fc1cb2 exceptions: make invalid_request a subclass of request_validation
invalid_request_exceptions is one of the exceptions that should be
propagated to the client in form of a error code. That's why it should
belong to a hierarchy with cassandra_exception at root, so that all
exceptions like that can be easily caught and passed to the client.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:36:58 +02:00
Paweł Dziepak
024a706692 exceptions: remove duplicate marshal_exception
There are both marshal_exception (defined in types.hh) and
exceptions::marshal_exception (defined ini exceptions/exceptions.hh).
The latter is never thrown by anything but caught in few places which
obviously is incorrect.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:36:48 +02:00
Paweł Dziepak
22568a1995 types: implement timestamp_type_impl::from_string()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:36:18 +02:00
Paweł Dziepak
9c025946f0 uuid: handle invalid strings more gracefully
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:33:58 +02:00
Paweł Dziepak
d993ec69f6 types: implement inet_addr_type_impl::{from, to}_sstring()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:33:03 +02:00
Paweł Dziepak
bb30e05149 types: implement uuid_type_impl::{from, to}_sstring()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:31:22 +02:00
Paweł Dziepak
b33a401f01 types: implement timeuuid_type_impl::{from, to}_sstring()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:30:44 +02:00
Avi Kivity
1501b273f6 doc: add reference section to fiber module 2015-07-07 00:29:23 +03:00
Paweł Dziepak
9b89bad329 utils: allow creating uuid from sstring_view
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:26:47 +02:00
Paweł Dziepak
cce2996cde cql3: enable inet type in cql grammar definition
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:26:40 +02:00
Paweł Dziepak
f8598a668a types: implement floating_type_impl::{from, to}_string()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:26:17 +02:00
Avi Kivity
89931d53fa semaphore: document 2015-07-07 00:10:51 +03:00
Pekka Enberg
c24b7d42ce db/legacy_schema_tables: Store CF key validator in system tables
Store the column family key validator in system tables. Please note that
we derive the validator from CQL partition keys and never actually read
it from the database. This is different from Origin which uses
CompositeType that is both stored and read from the system tables.

Fixes #7.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Tested-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-06 20:33:05 +03:00
Tomasz Grabiec
93bf8fa3ba Merge branch 'calle/execute_internal' from seastar-dev.git 2015-07-06 15:26:18 +03:00
Avi Kivity
a5d3f1eac1 Merge "API: Adding the commmit log metrics support" from Amnon
"This series adds support to the commit log metrics, tht define according to the
CommitLogMetrics"
2015-07-06 13:27:17 +03:00
Amnon Heiman
fd7e0e512a Adding the commit log metric stub implementation
This adds a stub implementation to the commit log metrics.
The calls return the currect value type with a stub value.

After this patch the following url will be available:
/commitlog/metrics/completed_tasks
/commitlog/metrics/pending_tasks
/commitlog/metrics/total_commit_log_size

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-06 12:38:22 +03:00
Amnon Heiman
240c7b0572 API: Adding the commit log metrics definitions
This adds the commit log swagger definition to to the commit log
definition file.

The API is based on the CommitLogMetrics.
The following commands were added:
get_completed_tasks
get_pending_tasks
get_total_commit_log_size

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-06 12:37:45 +03:00
Gleb Natapov
cfcca4315c do not copy query::result while sending it back to a coordinator
RPC can send directly from a smart pointer now.
2015-07-06 10:17:39 +02:00
Avi Kivity
5338a6a8db Merge branch 'master' of github.com:cloudius-systems/seastar 2015-07-06 11:12:36 +03:00
Vlad Zolotarov
f8d2679728 locator: add a virtual get_name() method to snitch classes
Add a pure virtual i_endpoint_snitch::get_name() method that
should return the corresponding Java-name of a snitch
class instance.

Patch is also available on dev:/snitch-get-name-v1

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-07-06 10:11:30 +02:00
Amnon Heiman
2c08647a6e scollectd: change get_collectd_value() to use const ref
After the implementation of the code that uses the scollectd API was
modified, the get_collectd_value gets the collectd ID as a const
reference, to remove unnessary creation of shared_ptr.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-06 11:09:32 +03:00
Gleb Natapov
b175d276ab implement get_natural_endpoints for local_strategy
abstract_replication_strategy::get_natural_endpoints()
does some token calculations before calling strategy specific
calculate_natural_endpoints(), but system table may be read before
token metadata (needed for token calculations) is ready. Fix that by
specializing local_strategy's get_natural_endpoints() to skip token
calculation.
2015-07-06 09:57:14 +02:00
Tomasz Grabiec
510f236e7c Merge branch 'penberg/cql-truncate-stmt' from seastar-dev.git
"truncate" statement grammar from Pekka.
2015-07-06 09:54:12 +02:00