Coverage Report

Created: 2024-07-27 06:53

/src/rocksdb/utilities/env_timed.h
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) 2019-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
7
#pragma once
8
#include "rocksdb/file_system.h"
9
namespace ROCKSDB_NAMESPACE {
10
class TimedFileSystem : public FileSystemWrapper {
11
 public:
12
  explicit TimedFileSystem(const std::shared_ptr<FileSystem>& base);
13
14
0
  static const char* kClassName() { return "TimedFS"; }
15
0
  const char* Name() const override { return kClassName(); }
16
17
  IOStatus NewSequentialFile(const std::string& fname,
18
                             const FileOptions& options,
19
                             std::unique_ptr<FSSequentialFile>* result,
20
                             IODebugContext* dbg) override;
21
22
  IOStatus NewRandomAccessFile(const std::string& fname,
23
                               const FileOptions& options,
24
                               std::unique_ptr<FSRandomAccessFile>* result,
25
                               IODebugContext* dbg) override;
26
27
  IOStatus NewWritableFile(const std::string& fname, const FileOptions& options,
28
                           std::unique_ptr<FSWritableFile>* result,
29
                           IODebugContext* dbg) override;
30
31
  IOStatus ReuseWritableFile(const std::string& fname,
32
                             const std::string& old_fname,
33
                             const FileOptions& options,
34
                             std::unique_ptr<FSWritableFile>* result,
35
                             IODebugContext* dbg) override;
36
37
  IOStatus NewRandomRWFile(const std::string& fname, const FileOptions& options,
38
                           std::unique_ptr<FSRandomRWFile>* result,
39
                           IODebugContext* dbg) override;
40
41
  IOStatus NewDirectory(const std::string& name, const IOOptions& options,
42
                        std::unique_ptr<FSDirectory>* result,
43
                        IODebugContext* dbg) override;
44
45
  IOStatus FileExists(const std::string& fname, const IOOptions& options,
46
                      IODebugContext* dbg) override;
47
48
  IOStatus GetChildren(const std::string& dir, const IOOptions& options,
49
                       std::vector<std::string>* result,
50
                       IODebugContext* dbg) override;
51
52
  IOStatus GetChildrenFileAttributes(const std::string& dir,
53
                                     const IOOptions& options,
54
                                     std::vector<FileAttributes>* result,
55
                                     IODebugContext* dbg) override;
56
57
  IOStatus DeleteFile(const std::string& fname, const IOOptions& options,
58
                      IODebugContext* dbg) override;
59
60
  IOStatus CreateDir(const std::string& dirname, const IOOptions& options,
61
                     IODebugContext* dbg) override;
62
63
  IOStatus CreateDirIfMissing(const std::string& dirname,
64
                              const IOOptions& options,
65
                              IODebugContext* dbg) override;
66
67
  IOStatus DeleteDir(const std::string& dirname, const IOOptions& options,
68
                     IODebugContext* dbg) override;
69
70
  IOStatus GetFileSize(const std::string& fname, const IOOptions& options,
71
                       uint64_t* file_size, IODebugContext* dbg) override;
72
73
  IOStatus GetFileModificationTime(const std::string& fname,
74
                                   const IOOptions& options,
75
                                   uint64_t* file_mtime,
76
                                   IODebugContext* dbg) override;
77
78
  IOStatus RenameFile(const std::string& src, const std::string& dst,
79
                      const IOOptions& options, IODebugContext* dbg) override;
80
81
  IOStatus LinkFile(const std::string& src, const std::string& dst,
82
                    const IOOptions& options, IODebugContext* dbg) override;
83
84
  IOStatus LockFile(const std::string& fname, const IOOptions& options,
85
                    FileLock** lock, IODebugContext* dbg) override;
86
87
  IOStatus UnlockFile(FileLock* lock, const IOOptions& options,
88
                      IODebugContext* dbg) override;
89
90
  IOStatus NewLogger(const std::string& fname, const IOOptions& options,
91
                     std::shared_ptr<Logger>* result,
92
                     IODebugContext* dbg) override;
93
};
94
95
}  // namespace ROCKSDB_NAMESPACE