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