In CQL a row is considered as present if its row marker is live or it
has any cells live. The 'insert' statement creates a row
marker. Internally Origin handles that by inserting a special cell
whose name shares the prefix with other cells in that row.
One consequence of this way of things is that when we query a column
slice from sstables we will have to read the whole CQL row, even if
not all columns are queried. We won't have to include the data, but we
will need liveness information in order to commute it with other
mutations, so that we can finally determine if the row is live or not.
The list cell may be not set, in which case we should reurn an error
to the user. Current implementation of get_prefetched_list() was
returning collection_mutaion::view in this case, which had an empty
view. Deserialization is not prepared to get an empty view though. I
think we can stick with having non-empty views in the general case and
return an optional in get_prefetched_list().
Previously we had both a "compression" structure (read from the Compression
Info file on disk) and a "compression_metadata" class with additional
information, which std::move()ed parts of the compression structure.
This caused problems for the simplistic sstable-writing test (which does
the non-interesting thing of writing a previously-read sstable).
I'm ashamed to say, fixing this was very hard, because all this code is
built like a house of cards - try to change one thing, and everything
falls apart. After many failed attempts in trying to improve this code, what
I ended up doing is simply *extending* the "compression" structure - the
extended part isn't read or written, but it is in the structure.
We also no longer move a shared pointer to the compression structure,
but rather just an ordinary pointer; The assumption is that the user
will already make sure that the sstable structure will live for the
durations of any processing on it - and the compression structure is just
one part of this sstable structure.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
cql3_type is a wrapper around data_type, so there's no need for a class
hierarchy -- anything that depends on the actual type can be forwarded
to abstract_type_impl.
We can now use this as a value type (dropping shared_ptr<cql3_type>), but
that is left for later.
From Pekka:
This series adds support for creating keyspaces. We already have the CQL
front-end implemented so all that remains is converging mutations in
legacy_schema_tables.cc as well as parts of migration_manager.hh and
wiring that up to the CQL execution path.
Pass a reference to storage_proxy and apply mutations in
legacy_schema_tables::merge_schema().
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Migration manager announce functions now return a future. Switch to the
new API in modification statements.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
System keyspace is used for things like keyspace and table metadata.
Initialize it in database constructor so that they're always available.
Needed for CQL create keyspace test case, for example.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This adds a set_cell() variant which accepts a column name and a
boost::any value and does column definition lookup and decomposition
under the hood. Simplifies code that manipulates system tables directly
in db/legacy_schema_tables.cc.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>