Skip to content

Commit

Permalink
RandomAccessFileReader should not inherit RandomAccessFile
Browse files Browse the repository at this point in the history
Summary: RandomAccessFileReader unnecessarily inherited RandomAccessFile, which can introduce unnecessarily extra costs. Remove it.

Test Plan: Run all existing tests

Reviewers: yhchiang, anthony, igor, kradhakrishnan, rven, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D47409
  • Loading branch information
siying committed Sep 23, 2015
1 parent 03dd8f3 commit d746eaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions table/block_based_table_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,13 @@ void BlockBasedTable::SetupForCompaction() {
case Options::NONE:
break;
case Options::NORMAL:
rep_->file->Hint(RandomAccessFile::NORMAL);
rep_->file->file()->Hint(RandomAccessFile::NORMAL);
break;
case Options::SEQUENTIAL:
rep_->file->Hint(RandomAccessFile::SEQUENTIAL);
rep_->file->file()->Hint(RandomAccessFile::SEQUENTIAL);
break;
case Options::WILLNEED:
rep_->file->Hint(RandomAccessFile::WILLNEED);
rep_->file->file()->Hint(RandomAccessFile::WILLNEED);
break;
default:
assert(false);
Expand Down
2 changes: 1 addition & 1 deletion util/file_reader_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SequentialFileReader {
SequentialFile* file() { return file_.get(); }
};

class RandomAccessFileReader : public RandomAccessFile {
class RandomAccessFileReader {
private:
std::unique_ptr<RandomAccessFile> file_;
Env* env_;
Expand Down

0 comments on commit d746eaa

Please sign in to comment.