Commit Graph

64 Commits

Author SHA1 Message Date
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
Asias He
79832823ed db: Add missing virtual destructor for i_mutation 2015-01-14 14:51:05 +02:00
Asias He
3af55230e1 db: Switch to use real UUID in db/i_mutation.hh 2015-01-14 14:51:04 +02:00
Pekka Enberg
275caedd8c db: convert ListType to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 13:00:16 +02:00
Pekka Enberg
ec22f9123e db: Import db/marshal/ListType.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 13:00:13 +02:00
Pekka Enberg
2bf11ddac5 db: convert CollectionType to C++
Minimal conversion to have the type available.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 12:26:57 +02:00
Pekka Enberg
c245518948 db: Import db/marshal/CollectionType.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 11:17:53 +02:00
Pekka Enberg
ca1c54ac7c db: convert ReversedType to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 16:23:48 +02:00
Pekka Enberg
4984184603 db: import db/marshal/ReversedType.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 16:23:33 +02:00
Pekka Enberg
90abbbaef1 db: Fix include in cell_name.hh
Fix the following build error:

  In file included from ./db/cell.hh:29:0,
                   from ./db/expiring_cell.hh:26,
                   from cql3/attributes.hh:31,
                   from cql3/cql3.cc:33:
  ./db/composites/cell_name.hh: At global scope:
  ./db/composites/cell_name.hh:51:36: error: expected class-name before ‘{’ token
   class cell_name : public composite {
                                    ^
  ninja: build stopped: subcommand failed.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 16:23:33 +02:00
Asias He
6bb4681bfc db: Convert db/RowPosition.java to C++ 2015-01-07 20:44:54 +08:00
Asias He
53c492d3ca db: Import db/RowPosition.java 2015-01-07 20:44:54 +08:00
Asias He
306fef6027 db: Convert db/IMutation.java to C++ 2015-01-07 20:44:54 +08:00
Asias He
3d2592f7d4 db: Add db/IMutation.java 2015-01-07 20:32:49 +08:00
Asias He
04b8a6bf7d db: Convert db/CounterCell.java to C++ 2015-01-06 17:55:53 +08:00
Asias He
3d418e55ad db: Import db/CounterCell.java 2015-01-06 17:49:10 +08:00
Asias He
969f942613 db: Convert db/ExpiringCell.java to C++ 2015-01-06 17:46:40 +08:00
Asias He
4513e28e1b db: Import db/ExpiringCell.java 2015-01-06 17:42:15 +08:00
Asias He
49e7d79630 db: Convert db/DeletedCell.java to C++ 2015-01-06 17:40:49 +08:00
Asias He
50bdc5438f db: Import db/DeletedCell.java 2015-01-06 17:35:55 +08:00
Asias He
f4b40d3516 db: Convert db/CounterUpdateCell.java to C++ 2015-01-06 17:33:51 +08:00
Asias He
4ad91ece93 db: Import db/CounterUpdateCell.java 2015-01-06 17:23:46 +08:00
Asias He
5449d44f38 db: Convert db/Cell.java to C++ 2015-01-06 17:23:46 +08:00