]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/utilities/env_timed.h
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).
8 #include "rocksdb/file_system.h"
9 namespace ROCKSDB_NAMESPACE
{
11 class TimedFileSystem
: public FileSystemWrapper
{
13 explicit TimedFileSystem(const std::shared_ptr
<FileSystem
>& base
);
15 static const char* kClassName() { return "TimedFS"; }
16 const char* Name() const override
{ return kClassName(); }
18 IOStatus
NewSequentialFile(const std::string
& fname
,
19 const FileOptions
& options
,
20 std::unique_ptr
<FSSequentialFile
>* result
,
21 IODebugContext
* dbg
) override
;
23 IOStatus
NewRandomAccessFile(const std::string
& fname
,
24 const FileOptions
& options
,
25 std::unique_ptr
<FSRandomAccessFile
>* result
,
26 IODebugContext
* dbg
) override
;
28 IOStatus
NewWritableFile(const std::string
& fname
, const FileOptions
& options
,
29 std::unique_ptr
<FSWritableFile
>* result
,
30 IODebugContext
* dbg
) override
;
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
;
38 IOStatus
NewRandomRWFile(const std::string
& fname
, const FileOptions
& options
,
39 std::unique_ptr
<FSRandomRWFile
>* result
,
40 IODebugContext
* dbg
) override
;
42 IOStatus
NewDirectory(const std::string
& name
, const IOOptions
& options
,
43 std::unique_ptr
<FSDirectory
>* result
,
44 IODebugContext
* dbg
) override
;
46 IOStatus
FileExists(const std::string
& fname
, const IOOptions
& options
,
47 IODebugContext
* dbg
) override
;
49 IOStatus
GetChildren(const std::string
& dir
, const IOOptions
& options
,
50 std::vector
<std::string
>* result
,
51 IODebugContext
* dbg
) override
;
53 IOStatus
GetChildrenFileAttributes(const std::string
& dir
,
54 const IOOptions
& options
,
55 std::vector
<FileAttributes
>* result
,
56 IODebugContext
* dbg
) override
;
58 IOStatus
DeleteFile(const std::string
& fname
, const IOOptions
& options
,
59 IODebugContext
* dbg
) override
;
61 IOStatus
CreateDir(const std::string
& dirname
, const IOOptions
& options
,
62 IODebugContext
* dbg
) override
;
64 IOStatus
CreateDirIfMissing(const std::string
& dirname
,
65 const IOOptions
& options
,
66 IODebugContext
* dbg
) override
;
68 IOStatus
DeleteDir(const std::string
& dirname
, const IOOptions
& options
,
69 IODebugContext
* dbg
) override
;
71 IOStatus
GetFileSize(const std::string
& fname
, const IOOptions
& options
,
72 uint64_t* file_size
, IODebugContext
* dbg
) override
;
74 IOStatus
GetFileModificationTime(const std::string
& fname
,
75 const IOOptions
& options
,
77 IODebugContext
* dbg
) override
;
79 IOStatus
RenameFile(const std::string
& src
, const std::string
& dst
,
80 const IOOptions
& options
, IODebugContext
* dbg
) override
;
82 IOStatus
LinkFile(const std::string
& src
, const std::string
& dst
,
83 const IOOptions
& options
, IODebugContext
* dbg
) override
;
85 IOStatus
LockFile(const std::string
& fname
, const IOOptions
& options
,
86 FileLock
** lock
, IODebugContext
* dbg
) override
;
88 IOStatus
UnlockFile(FileLock
* lock
, const IOOptions
& options
,
89 IODebugContext
* dbg
) override
;
91 IOStatus
NewLogger(const std::string
& fname
, const IOOptions
& options
,
92 std::shared_ptr
<Logger
>* result
,
93 IODebugContext
* dbg
) override
;
96 #endif // ROCKSDB_LITE
97 } // namespace ROCKSDB_NAMESPACE