]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/log
rocksdb.git
12 years agoCompactionPicker
Igor Canadi [Thu, 16 Jan 2014 21:03:52 +0000 (13:03 -0800)]
CompactionPicker

Summary:
This is a big one. This diff moves all the code related to picking compactions from VersionSet to new class CompactionPicker. Column families' compactions will be completely separate processes, so we need to have multiple CompactionPickers.

To make this easier to review, most of the code change is just copy/paste. There is also a small change not to use VersionSet::current_, but rather to take `Version* version` as a parameter. Most of the other code is exactly the same.

In future diffs, I will also make some improvements to CompactionPickers. I think the most important part will be encapsulating it better. Currently Version, VersionSet, Compaction and CompactionPicker are all friend classes, which makes it harder to change the implementation.

This diff depends on D15171, D15183, D15189 and D15201

Test Plan: `make check`

Reviewers: kailiu, sdong, dhruba, haobo

Reviewed By: kailiu

CC: leveldb
Differential Revision: https://reviews.facebook.net/D15207

12 years agoRemove the unnecessary use of shared_ptr
kailiu [Thu, 16 Jan 2014 02:17:58 +0000 (18:17 -0800)]
Remove the unnecessary use of shared_ptr

Summary:
shared_ptr is slower than unique_ptr (which literally comes with no performance cost compare with raw pointers).
In memtable and memtable rep, we use shared_ptr when we'd actually should use unique_ptr.

According to igor's previous work, we are likely to make quite some performance gain from this diff.

Test Plan: make check

Reviewers: dhruba, igor, sdong, haobo

CC: leveldb
Differential Revision: https://reviews.facebook.net/D15213

12 years agoMove more functions from VersionSet to Version
Igor Canadi [Thu, 16 Jan 2014 00:23:36 +0000 (16:23 -0800)]
Move more functions from VersionSet to Version

Summary:
This moves functions:
* VersionSet::Finalize() -> Version::UpdateCompactionStats()
* VersionSet::UpdateFilesBySize() -> Version::UpdateFilesBySize()

The diff depends on D15189, D15183 and D15171

Test Plan: make check

Reviewers: kailiu, sdong, haobo, dhruba

Reviewed By: sdong

CC: leveldb
Differential Revision: https://reviews.facebook.net/D15201

12 years agoMoving Compaction class to separate header file
Igor Canadi [Thu, 16 Jan 2014 00:22:34 +0000 (16:22 -0800)]
Moving Compaction class to separate header file

Summary:
I'm sure we'll all agree that version_set.cc needs simplifying. This diff moves Compaction class to a separate file.

The diff depends on D15171 and D15183

Test Plan: make check

Reviewers: dhruba, haobo, kailiu, sdong

Reviewed By: kailiu

CC: leveldb
Differential Revision: https://reviews.facebook.net/D15189

12 years agoMove functions from VersionSet to Version
Igor Canadi [Thu, 16 Jan 2014 00:18:04 +0000 (16:18 -0800)]
Move functions from VersionSet to Version

Summary:
There were some functions in VersionSet that had no reason to be there instead of Version. Moving them to Version will make column families implementation easier.

The functions moved are:
* NumLevelBytes
* LevelSummary
* LevelFileSummary
* MaxNextLevelOverlappingBytes
* AddLiveFiles (previously AddLiveFilesCurrentVersion())
* NeedSlowdownForNumLevel0Files

The diff continues on (and depends on) D15171

Test Plan: make check

Reviewers: dhruba, haobo, kailiu, sdong, emayanke

Reviewed By: sdong

CC: leveldb
Differential Revision: https://reviews.facebook.net/D15183