Commit Graph

10 Commits

Author SHA1 Message Date
Tomasz Grabiec
da937897cf memtable: Introduce as_data_source() 2015-07-09 19:46:29 +02:00
Tomasz Grabiec
51cae834e3 db: Put all sstables behind single reader
This change abstracts reading from on-disk data sources behind a single
reader which is then composed with memtable readers. This change also
abstracts all data sources behind a single reader obtained via
column_family::make_reader(). That reader is then used by algorithms
like column_family::for_all_partitions() or
column_family::query(). Having those abstractions will make it easier
to add row cache, because it will be encapsulated in a single place.
2015-06-18 16:33:33 +02:00
Tomasz Grabiec
bc468f9a0e memtable: Make memtable inherit from enable_lw_shared_from_this 2015-06-18 15:48:21 +02:00
Tomasz Grabiec
7f1ff0401e db: Move mutation_reader definition to separate header 2015-06-18 15:47:40 +02:00
Nadav Har'El
78a8ac8470 Make mutation_reader usable outside database.cc
The "mutation_reader" defined in database.cc is a convenient mechanism
for iterating over mutations. It can be useful for more than just
database.cc (I want to use it in the compaction code), so this patch moves
the type's definition to mutation.hh, and the make_memtable_reader()
function to memtable::make_reader() (in memtable.hh).

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-16 14:03:34 +02:00
Calle Wilund
293dbf66e3 Forward and use replay_position when applying mutation
* Forward commitlog replay_position to column_family.memtable, updating
  highest RP if needed
* When flushing memtable, signal back to commitlog that RP has been dealt with
  to potentially remove finished segment(s)

Note: since memtable flushing right now is _not_ explicitly ordered,
this does not actually work, since we need to guarantee ordering with
regards to RP. I.e. if we flush N blocks, we must guarantee that:
a.) We report "flushed RP" in RP order
b.) For a given RP1, all RP* lower than RP1 must also have been flushed.
(The latter means that it is fine to say, flush X tables at the same time, as long as we report a single RP that is the highest, and no lower RP:s exist in non-flushed tables)

I am however letting someone else deal with ensuring MT->sstable flush order.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-06-03 12:38:13 +03:00
Avi Kivity
bbc8dbbab5 db: abstract memtable empty test 2015-05-21 15:48:51 +03:00
Avi Kivity
51e19fc090 memtable.h: add copyright statement 2015-05-18 15:59:23 +03:00
Avi Kivity
07d7f410f3 Merge branch 'memtable' into db
Conflicts:
	database.hh
	memtable changes moved to memtable.hh
2015-05-18 15:50:24 +03:00
Glauber Costa
2174285c31 db: move memtable definition to its own file
Following what happened to others: we can now include memtable.hh
without including database.hh

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-17 12:38:32 +03:00