Commit Graph

34 Commits

Author SHA1 Message Date
Tomasz Grabiec
e7f1ae51b4 mutation_partition: Reduce duplication in apply() 2015-08-06 14:05:16 +02:00
Tomasz Grabiec
cda31eccf7 db: Use LSA to allocate data inside memtable 2015-08-06 14:05:16 +02:00
Paweł Dziepak
6f0af11051 mutation_partition: row_marker: fix operator==()
If row marker is missing _ttl and _expiry are meaningless.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 17:58:30 +03:00
Paweł Dziepak
9300457df7 mutation_partition: drop deletable_row::apply(api::timestamp_type)
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
11e1d82403 mutation_partition: serialize row_marker of deletable_row
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
c84763d434 mutation_partition: use row_marker in deletable_row
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
ed21fd1ef8 mutation_partition: add row_marker class
Row marker can be in one of three states: missing, live (possibly
expiring) or dead. Since it basically behaves like a normal cell, except
it doesn't have any value, row_marker class provides an interface
similar to atomic_cell.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
8e85592309 mutation_partition: add for_each_row()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-23 02:38:23 +02:00
Tomasz Grabiec
33ca07af33 mutation: Introduce live_row_count() 2015-07-15 18:56:10 +02:00
Tomasz Grabiec
446ba5bf27 mutation_partition: Extract row liveness checking logic to deletable_row::is_live() 2015-07-15 18:38:12 +02:00
Tomasz Grabiec
7356024dde mutation_partition: Introduce compact_for_query()
Prepares the partition to be returned in a mutation query:
 - throws out data which doesn't belong to row_ranges
 - expires cells based on query_time
 - drops cells covered by higher-level tombstones (compaction)
 - leaves at most row_limit live rows

Until we have a fine-grained reader, it's best to perform these on an
existing object. Later we can do it on-the-fly. Based on Origin's
org.apache.cassandra.db.filter.SliceQueryFilter#collectReducedColumns
2015-07-12 12:51:38 +02:00
Tomasz Grabiec
09ed972068 mutation_partition: Remove redundant slice parameter from query()
The slice used by partition_writer must match the one used by query()
anyway.
2015-07-09 19:47:32 +02:00
Paweł Dziepak
183b6fc6d9 db: do not return already expired cells in queries
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-02 17:25:41 +02:00
Tomasz Grabiec
3fc951e807 mutation_partition: Use default value for row_limit in query() 2015-07-02 13:25:46 +02:00
Tomasz Grabiec
f656ae8ed4 db: Encapsulate deletable_row fields 2015-05-13 08:56:54 +02:00
Tomasz Grabiec
dbc40dfb09 db: Encapsulate the "row" class
Reduces coupling. User's should not rely on the fact that it's an
std::map<>.  It also allows us to extend row's interface with
domain-specific methods, which are a lot easier to discover than free
functions.
2015-05-13 08:56:54 +02:00
Tomasz Grabiec
56bea440a7 mutation_partition: Pass schema by const& where applicable
If method doesn't want to share schema ownership it doesn't have to
take it by shared pointer. The benefit is that it's slightly cheaper
and those methods may now be called from places which don't own
schema.
2015-05-13 08:56:54 +02:00
Tomasz Grabiec
a5ff3818f7 mutation_partition: Visually segregate mutators from getters 2015-05-13 08:56:53 +02:00
Tomasz Grabiec
f7abbda156 db: Apply frozen_mutation directly
We don't convert it back to mutation before applying.

mutation_partition has now apply() which works on
mutation_partition_view.
2015-05-08 09:19:02 +02:00
Tomasz Grabiec
386d17dff6 mutation_partition: Introduce apply_insert() 2015-05-08 09:19:01 +02:00
Tomasz Grabiec
84d2b2b2ea mutation_partition: Add view version of apply_delete() 2015-05-08 09:19:01 +02:00
Tomasz Grabiec
cc4e2ec622 mutation_partition: Add r-value variant of clustered_row() 2015-05-08 09:19:01 +02:00
Tomasz Grabiec
a854163f71 db: Cleanup unimplemented method 2015-05-08 09:19:01 +02:00
Tomasz Grabiec
04846ed3d2 mutation: Make mutation equality comparable 2015-05-06 16:40:48 +02:00
Tomasz Grabiec
87e00d97fa mutation: Introduce row_tombstones() getter 2015-05-06 16:40:48 +02:00
Tomasz Grabiec
6762a92299 mutation_partition: Take schema by reference in apply_row_tombstone() 2015-05-06 16:40:48 +02:00
Tomasz Grabiec
0aef6f2ff7 mutation_partition: Allow row lookup by clustering_key_view 2015-05-06 16:40:42 +02:00
Avi Kivity
b717b4b6bb db: add ostream operators for more types (mutation_partition and components) 2015-05-06 15:39:31 +03:00
Avi Kivity
cdfe03a5b2 db: implement mutation_partition assignment operators 2015-05-05 20:21:04 +03:00
Avi Kivity
aa94cd62dc db: implement mutation_partition copy constructor
As a temporary measure, we will return temporary mutation_partition
objects in response to queries, so we need an easy way to construct
them.
2015-05-05 20:21:04 +03:00
Avi Kivity
3a0de14aa8 db: more const correctness for column_family and component types
Ensure that read-side accessors are const.  This is important in preparation
for multiple memtables (and later, sstables) since a read-side
mutation_partition may be a temporary object coming from multiple memtables
(and sstables) while a write-side mutation_partition is guaranteed to belong
to a single memtable (and thus, not be temporary).

Since writers will want non-const mutation_partitions to write to, they won't
be able to use the read-side accessors by accident.
2015-05-05 19:37:21 +03:00
Raphael S. Carvalho
9a263328d5 mutation_partition: rename tombstone_for_static_row to partition_tombstone
tombstone from mutation partition is also used for static row purposes,
but under the hood, it's the partition tombstone.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-05-05 11:15:46 +03:00
Raphael S. Carvalho
9d7de45ca4 mutation_partition: add function to return a reference to _rows
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-05 11:15:45 +03:00
Tomasz Grabiec
0d4821009c db: Move mutation and mutation_partition to separate headers and compilation units 2015-04-22 18:42:33 +02:00