]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
RandomAccessFileReader should not inherit RandomAccessFile
authorsdong <siying.d@fb.com>
Wed, 23 Sep 2015 01:21:10 +0000 (18:21 -0700)
committerIslam AbdelRahman <tec@fb.com>
Tue, 29 Sep 2015 01:38:54 +0000 (18:38 -0700)
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

table/block_based_table_reader.cc
util/file_reader_writer.h

index 08c3f2055da142420672551e5b0d6d4aa93c554e..6ffb8280a7fe73eb6adc68060fcd69618189621d 100644 (file)
@@ -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);
index 616d174a23356e8b024475cc3af48606cc4c8cba..914289b52c45b7b97ff6ea59fc92cf40364f581b 100644 (file)
@@ -31,7 +31,7 @@ class SequentialFileReader {
   SequentialFile* file() { return file_.get(); }
 };
 
-class RandomAccessFileReader : public RandomAccessFile {
+class RandomAccessFileReader {
  private:
   std::unique_ptr<RandomAccessFile> file_;
   Env* env_;