For serializing to commit log, and potentially internal wire messaging.
Note: intentionally incompatible with stock C wire/serial format.
Note: intentionally separate from the CQL-centric serialization
for a few reasons.
1.) Need "bulk serializers" for internal objects (mutation etc)
which might not fit well into the "types.hh" serializer schemes.
2.) No need for polymorphism/virtual type parameters since we know
exactly what we serialize and to where.
* database now holds all keyspace + column family object
* column families are mapped by uuid, either generated or explicit
* lookup by name tuples or uuid
* finder functions now return refs + throws on missing obj
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>
Move compress.{cc,hh} from db/ to sstables/. This makes more sense, as
this code is only used for sstables (un)compression.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
This patch adds a make_compressed_file_input_stream - our futuristic version
of cassandra.io.compress.CompressedRandomAccessReader, and compression_metadata
(parallel of CompressionMetadata). It will allow us to read chunk-compressed
SSTable files.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Commit log segment "finish_and_get_new" should not call "new_segment"
explicitly, since more than one invocation might get there on the same
flush condition (segment full).
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Implements a cassandra-file-compatible segmented log
of "mutations". Handles "batch" and "periodic" mode like
stock version. Also includes "dirty" management for the
interaction log/memtable.
Supports:
* add
* sync/flush
* clear dirty bits (thus discarding segments)
Many more estoric stock functions not yet implemented.
Missing: Storage management. Does not deal with total
size on disk of segments yet. Nor does it have any provisions
for dealing with active buffer bloat should async writes stall.
[avi: adjust for future<>::rescue() removal]
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
Convert the schemas from LegacySchemaTables.java to C++.
Some FIXMEs still left because of types we don't yet support, or
schema features we don't yet support - this will be fixed later.
Note that I put legacy_schema_tables in the "db" namespace, not in the
"schema" namespace where Origin had it. This was the *only* class in
the "schema" package in Origin, and unfortunately in Urchin we can't use
the name "schema" as a namespace, as we already have it as a class.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Only partially translated. I had to comment out some "static"
specifications to avoid compiler warnings because these are not used yet.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
There's a proper column_family in database.hh now. Remove a stub that
was introduced during the initial conversion.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
For simplicity partition data is stored using the same object which is
used for mutations: mutation_partition. Later we can introduce a more
efficient version.
The new structure has common timestamp field extracted, it has the
same meaning for both live and dead cells. It will make it easier to
merge cells this way.
This model is meant to follow CQL more closely than the model in
Origin. We have direct representations for CQL rows and cells.
We avoid using thrift concepts here. Here's how some of the Origin's
classes map to this:
Mutation -> mutation
ColumnFamily -> partition
CellName -> clustering_key/clustering_prefix and column_id
Cell -> atomic_cell (not for collection types though)
Note about CounterMutation. CounterMutation is for modifying counter
tables. A counter table can only have one column, the counter
value. In Origin CounterMutation is a subclass of IMutation which
represents mutations on counter tables. The only field it adds is
consistency level. I think we don't need to have a separate class for
this, at least in the generic code, which simplifies things. We can
check whether the table is a counter table from the schema and we can
pass the consistency level from QueryOptions during serialization.