"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."
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>
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.
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>
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>
"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."
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.