RandomAccessFileReader should not inherit RandomAccessFile

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
main
sdong 9 years ago
parent 03dd8f3ca7
commit d746eaad5e
  1. 6
      table/block_based_table_reader.cc
  2. 2
      util/file_reader_writer.h

@ -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);

@ -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_;

Loading…
Cancel
Save