Commit Graph

86 Commits

Author SHA1 Message Date
Glauber Costa
b8737a6b55 add more fields to system schema
double_type now exists.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-04-22 08:59:11 +02:00
Avi Kivity
5d9ab992e8 Merge branch 'tgrabiec/schema-id-fixes-v2' of github.com:cloudius-systems/seastar-dev into db
Fixes related to column_family ID handling, from Tomasz.
2015-04-20 14:33:07 +03:00
Tomasz Grabiec
ecab40bf97 commitlog: Write proper column family id 2015-04-20 12:12:55 +02:00
Tomasz Grabiec
9309a2ee6f Remove obselete files 2015-04-17 15:08:06 +02:00
Tomasz Grabiec
744d75e7f8 db: Move max_ttl from db/expiring_cell.hh to gc_clock.hh 2015-04-17 15:08:06 +02:00
Tomasz Grabiec
06f198b10c schema: Add id field
It uniquely identifies column_family globally. Will be used for
column_family lookups.
2015-04-15 20:33:48 +02:00
Tomasz Grabiec
a11aa768dc db: Remove outdated comment 2015-04-15 20:33:48 +02:00
Calle Wilund
6f6f924c9c Serializer object(s) for internal use
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.
2015-04-01 10:08:00 +02:00
Calle Wilund
9979ee8d45 Modify commit log to use dataoutput
Both internal usage and external interface.
2015-04-01 10:08:00 +02:00
Calle Wilund
d3fe0c5182 Refactor db/keyspace/column_family toplogy
* 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
2015-04-01 10:08:00 +02:00
Avi Kivity
18e7ea58d4 db: add collection-typed fields to system keyspace 2015-03-30 14:28:16 +03:00
Tomasz Grabiec
2902395129 Relax includes 2015-03-30 09:01:59 +02:00
Tomasz Grabiec
ac61d7526e db: Take keyspace name by const& 2015-03-30 09:01:59 +02:00
Tomasz Grabiec
35b4199374 Merge remote-tracking branch 'dev/penberg/create-keyspace/v4'
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.
2015-03-26 14:25:54 +01:00
Pekka Enberg
d0fef3e31b db: Apply mutations in legacy_schema_tables::merge_schema()
Pass a reference to storage_proxy and apply mutations in
legacy_schema_tables::merge_schema().

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-26 13:33:48 +02:00
Pekka Enberg
f0cb6a4f6e db: Convert LegacySchemaTables to C++, take 2
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-26 13:33:48 +02:00
Avi Kivity
30c3348702 db: add ostream support to consistency_level 2015-03-26 09:34:49 +02:00
Nadav Har'El
c6eb2a87ea Move compress.{cc,hh} to sstables/
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>
2015-03-24 16:54:58 +02:00
Nadav Har'El
0aef58a446 sstable: decompression support
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>
2015-03-24 15:05:26 +02:00
Tomasz Grabiec
bdbd5547e3 db: Cleanup key names
clustering_key::one -> clustering_key
clustering_key::prefix::one -> clustering_key_prefix
partition_key::one -> partition_key
clustering_prefix -> exploded_clustering_prefix
2015-03-20 18:59:29 +01:00
Tomasz Grabiec
e6ad9df1c9 db: Add db::system_keyspace::make() for creating the system keyspace 2015-03-11 16:01:13 +01:00
Tomasz Grabiec
6b30b4a2cd types: Introduce types::is_reversed() 2015-03-11 14:56:10 +01:00
Calle Wilund
80b244cc4b commitlog: fix using wrong segment
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>
2015-03-09 17:54:47 +02:00
Calle Wilund
054f9ed082 Initial commit log support.
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>
2015-03-05 11:06:09 +02:00
Calle Wilund
663cb6c4b1 db: Import db/commmitlog/*
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-03-05 11:02:46 +02:00
Nadav Har'El
e7a59652b5 Add comments to schemas in system_keyspace
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-02 15:18:41 +01:00
Nadav Har'El
4d9cf99cd9 start converting LegacySchemaTables.java to C++
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>
2015-03-02 15:18:19 +01:00
Nadav Har'El
161de485f7 LegacySchemaTables.java from origin
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-02 15:18:16 +01:00
Nadav Har'El
6e94cfb3ac system_keyspace - translate more tables to C++
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-02 10:59:38 +01:00
Tomasz Grabiec
a61d9ee18e schema: Add static columns to schema 2015-02-27 10:48:56 +01:00
Nadav Har'El
4df5e6acff Start translating db/SystemKeyspace.java to C++
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>
2015-02-26 14:55:03 +01:00
Nadav Har'El
ede451b7f8 Add db/SystemKeyspace.java from origin
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 14:54:34 +01:00
Pekka Enberg
86355a54a5 db: Remove column_family stub
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>
2015-02-23 14:31:36 +02:00
Tomasz Grabiec
d5a7f37c45 db: Merge api.hh into database.hh 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
e20cc1c1f9 db: Avoid storing schema pointer with each partition 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
48c11a01db db: Add ability to apply mutations into the database
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.
2015-02-09 10:28:44 +01:00
Tomasz Grabiec
800ba79efa db: Drop api:: namespace from mutation model classes
In preparation for merging into database.hh
2015-02-09 10:28:44 +01:00
Tomasz Grabiec
19e89a6057 db: Introduce mutation_partition::apply(const mutation_partition&)
It merges two partition mutations together. It is assumed that the first
one (invocation target) is much larger.
2015-02-09 10:28:44 +01:00
Tomasz Grabiec
3645e983c0 db: Refactor atomic_cell structure
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.
2015-02-09 10:28:44 +01:00
Tomasz Grabiec
1212ad18d0 db: Make setting static vs. clustered cell explicit 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
df8f7279b3 db: Simplify row tombstone management 2015-02-09 10:28:44 +01:00
Tomasz Grabiec
1610a58293 types: Relax include 2015-02-04 10:28:47 +01:00
Tomasz Grabiec
d4b6f7abc3 cql3: Convert more of ConsistencyLevel 2015-01-29 19:40:07 +01:00
Tomasz Grabiec
15bc1a8af3 db: Introduce mutation model
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.
2015-01-29 18:55:24 +01:00
Tomasz Grabiec
612f68b869 db: Convert ConsistencyLevel to C++ 2015-01-23 18:45:28 +01:00
Tomasz Grabiec
4b9dd3e978 db: Import ConsistencyLevel 2015-01-23 18:45:27 +01:00
Pekka Enberg
e4a8d7cf71 cql3: Convert ModificationStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-20 11:48:26 +02:00
Asias He
bf78e14d17 db: Switch to seastar shared_ptr from std::shared_ptr 2015-01-15 09:05:48 +08:00
Asias He
8d737985b0 db: Convert db/composites/AbstractCType.java to C++ 2015-01-15 09:05:48 +08:00
Asias He
3984f25b38 db: Make db::composites::c_type public 2015-01-15 09:05:48 +08:00