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>
The change to add a timeout to test.py introduced a bug that caused
thestdout,stderr not to be printed in case of an error. This patch fixes
this bug.
Signed-off-by: Shlomi Livne <shlomi@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>
'keys' and 'prefix' are used twice in the same expression, and as the language
does not guarantee any ordering in this case, any moves are illegal.
Get rid of them.
Because the length preceeds component contents, serialized tuples are
not byte order comparable. It breaks lexi ordering. It should be that
"abc" < "b", but with length prefix "<3>abc" is greater than
"<1>b". Only single element tuples can be byte order capared because
they have no length component.
Spotted during code review.
There are two sides of this optimization:
1) We don't store the length of the last component, so the
representation is now shorter.
2) A single-element tuple is serialized exactly as the component it
holds, which allows us to optimize conversions for such keys.
By the time being, compression info is the unique component being
written by store(). Changes introduced by this patch are generic,
so as to make it easier writing other components as well.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Test sstable::data_read(pos, len), for both compressed and uncompressed
data files. We already have compressed and uncompressed sstables in our
test tree with identical data, we read from them in a particular position
and expect to find the string "gustaf" there.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
This patch implements sstable::data_read(pos, len) to do random-access
read of a specific byte range from the data file. Later we'll determine
the byte range needed to read a specific row, using the summary and index
files.
This function works for either a compressed or uncompressed data file.
To support the compressed data file, we need to determine when opening
the sstable also the data file's size, and then make a compression_metadata
object using the data we read from the compression file and the data
file's size.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
It turns out that Cassandra's LZ4Compressor doesn't use the LZ4
compressor directly - instead it prepends the uncompressed length,
in 4-byte little-endian (!) encoding, to the compressed chunk.
We don't need this extra information - we already know the expected
uncompressed chunk length, so we need to just skip it.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>