readahead_raf.h 1.3 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. //
  6. // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  7. // Use of this source code is governed by a BSD-style license that can be
  8. // found in the LICENSE file. See the AUTHORS file for names of contributors.
  9. #pragma once
  10. #include <memory>
  11. #include "rocksdb/rocksdb_namespace.h"
  12. namespace ROCKSDB_NAMESPACE {
  13. class FSRandomAccessFile;
  14. // This file provides the following main abstractions:
  15. // SequentialFileReader : wrapper over Env::SequentialFile
  16. // RandomAccessFileReader : wrapper over Env::RandomAccessFile
  17. // WritableFileWriter : wrapper over Env::WritableFile
  18. // In addition, it also exposed NewReadaheadRandomAccessFile, NewWritableFile,
  19. // and ReadOneLine primitives.
  20. // NewReadaheadRandomAccessFile provides a wrapper over RandomAccessFile to
  21. // always prefetch additional data with every read. This is mainly used in
  22. // Compaction Table Readers.
  23. std::unique_ptr<FSRandomAccessFile> NewReadaheadRandomAccessFile(
  24. std::unique_ptr<FSRandomAccessFile>&& file, size_t readahead_size);
  25. } // namespace ROCKSDB_NAMESPACE