Commit Graph

100 Commits

Author SHA1 Message Date
Tomasz Grabiec
aec740f895 db: Make decorated_key have ordering compatible with Origin 2015-04-30 12:02:39 +02:00
Calle Wilund
2f4e7a00f6 Use db/config object in main, database etc
* Uses config object to augument/impl options parsing
* Database now holds config obj
* Commitlog can now be inited with global config obj.
2015-04-29 18:01:17 +02:00
Calle Wilund
5054892657 Cassandra compatible "config" object
* Based on the property set of cassandra 2.1
* Structure mapping all "known" cassandra.yaml config properties
* YAML and command line parsing of opts.
* Tracks is-set? and set-from-where?
* Uses giant macros to make Avi happy.
2015-04-29 17:00:15 +02:00
Avi Kivity
6290dee438 db: const correctness for abstract_type and friends
Types are immutable.
2015-04-29 15:40:38 +03:00
Avi Kivity
3162873d7f Merge branch 'calle/commitlog' of github.com:cloudius-systems/seastar-dev into db
Use commit log in database, from Calle:

"Initial" usage of the commitlog in database mutation path.
A commitlog is created in "work" dirs when initing the db
from a datadir. However, since we have neither disk data storage,
nor replay capability yet (and no real db config), the settings
are basically to just write in-memory serialization, write them to
disk and then discard them. So in fact, pointless. But at least using
the log...
2015-04-29 11:28:05 +03:00
Calle Wilund
aeb83f2874 Add commitlog to db + use it in storage_proxy/handler
* A commitlog is created in "work" dirs when initing the db
  from a datadir. However, since we have neither disk data storage,
  nor replay capability yet (and no real db config), the settings 
  are basically to just write in-memory serialization, write them to 
  disk and then discard them. So in fact, pointless. But at least using
  the log...
* Moved the actual "apply" of mutation into database. If a commitlog
  is active, add an entry to it before applying mutation.
2015-04-29 10:10:21 +02:00
Calle Wilund
07f1208926 Make commitlog respect max disk size setting. 2015-04-29 10:10:21 +02:00
Pekka Enberg
9ec10c240f db: Convert LegacySchemaTables keyspace merging
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-04-28 15:49:34 +03:00
Pekka Enberg
5b409baa99 db: Return a vector of mutations for 'create keyspace'
Origin supports chaining multiple mutations but we don't. Therefore,
return a vector of mutations for 'create keyspace'.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-04-27 10:38:11 +03:00
Tomasz Grabiec
474dbbbc88 db/serializer: Avoid unnecessary lookup of column family ID
We can now get it from schema.
2015-04-24 18:01:01 +02:00
Tomasz Grabiec
9f3053a867 db/serializer: Fix coding style 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
1c3275c950 mutation: Encapsulate fields 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
a9972b4b28 Relax header dependencies 2015-04-24 18:01:01 +02:00
Tomasz Grabiec
731a63e371 schema: Embed raw_schema inside schema
Public fields got encapsulated.
2015-04-24 18:01:01 +02:00
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