#include <swcdb/fs/Local/FileSystem.h>
Public Member Functions | |
FileSystemLocal (Configurables *config) | |
FileSystemLocal (FileSystemLocal &&)=delete | |
FileSystemLocal (const FileSystemLocal &)=delete | |
FileSystemLocal & | operator= (FileSystemLocal &&)=delete |
FileSystemLocal & | operator= (const FileSystemLocal &)=delete |
virtual | ~FileSystemLocal () noexcept |
Type SWC_CONST_FUNC | get_type () const noexcept override |
std::string | to_string () const override |
bool | exists (int &err, const std::string &name) override |
void | remove (int &err, const std::string &name) override |
size_t | length (int &err, const std::string &name) override |
void | mkdirs (int &err, const std::string &name) override |
void | readdir (int &err, const std::string &name, DirentList &results) override |
void | rmdir (int &err, const std::string &name) override |
void | rename (int &err, const std::string &from, const std::string &to) override |
void | write (int &err, SmartFd::Ptr &smartfd, uint8_t replication, StaticBuffer &buffer) override |
void | read (int &err, const std::string &name, StaticBuffer *dst) override |
void | combi_pread (int &err, SmartFd::Ptr &smartfd, uint64_t offset, uint32_t amount, StaticBuffer *dst) override |
void | create (int &err, SmartFd::Ptr &smartfd, uint8_t replication) override |
void | open (int &err, SmartFd::Ptr &smartfd) override |
size_t | read (int &err, SmartFd::Ptr &smartfd, void *dst, size_t amount) override |
size_t | read (int &err, SmartFd::Ptr &smartfd, StaticBuffer *dst, size_t amount) override |
size_t | pread (int &err, SmartFd::Ptr &smartfd, uint64_t offset, void *dst, size_t amount) override |
size_t | pread (int &err, SmartFd::Ptr &smartfd, uint64_t offset, StaticBuffer *dst, size_t amount) override |
size_t | append (int &err, SmartFd::Ptr &smartfd, StaticBuffer &buffer, Flags flags) override |
void | seek (int &err, SmartFd::Ptr &smartfd, size_t offset) override |
void | flush (int &err, SmartFd::Ptr &smartfd) override |
void | sync (int &err, SmartFd::Ptr &smartfd) override |
void | close (int &err, SmartFd::Ptr &smartfd) override |
![]() | |
FileSystem (const Configurables *config, ImplOptions impl_opts) | |
FileSystem (FileSystem &&)=delete | |
FileSystem (const FileSystem &)=delete | |
FileSystem & | operator= (FileSystem &&)=delete |
FileSystem & | operator= (const FileSystem &)=delete |
virtual | ~FileSystem () noexcept |
virtual void | stop () |
virtual Type | get_type_underlying () const noexcept |
virtual void | get_abspath (const std::string &name, std::string &abspath, size_t reserve=0) |
void | fd_open_incr () noexcept |
void | fd_open_decr () noexcept |
bool | need_fds () const noexcept |
size_t | fds_open () const noexcept |
virtual void | exists (Callback::ExistsCb_t &&cb, const std::string &name) |
virtual void | remove (Callback::RemoveCb_t &&cb, const std::string &name) |
virtual void | length (Callback::LengthCb_t &&cb, const std::string &name) |
virtual void | mkdirs (Callback::MkdirsCb_t &&cb, const std::string &name) |
virtual void | readdir (Callback::ReaddirCb_t &&cb, const std::string &name) |
virtual void | rmdir (Callback::RmdirCb_t &&cb, const std::string &name) |
virtual void | rename (Callback::RenameCb_t &&cb, const std::string &from, const std::string &to) |
void | default_write (int &err, SmartFd::Ptr &smartfd, uint8_t replication, StaticBuffer &buffer) |
virtual void | write (Callback::WriteCb_t &&cb, SmartFd::Ptr &smartfd, uint8_t replication, StaticBuffer &&buffer) |
void | default_read (int &err, const std::string &name, StaticBuffer *dst) |
virtual void | read (Callback::ReadAllCb_t &&cb, const std::string &name) |
void | default_combi_pread (int &err, SmartFd::Ptr &smartfd, uint64_t offset, uint32_t amount, StaticBuffer *dst) |
virtual void | combi_pread (Callback::CombiPreadCb_t &&cb, SmartFd::Ptr &smartfd, uint64_t offset, uint32_t amount) |
virtual void | create (Callback::CreateCb_t &&cb, SmartFd::Ptr &smartfd, uint8_t replication) |
virtual void | open (Callback::OpenCb_t &&cb, SmartFd::Ptr &smartfd) |
size_t | default_read (int &err, SmartFd::Ptr &smartfd, StaticBuffer *dst, size_t amount) |
virtual void | read (Callback::ReadCb_t &&cb, SmartFd::Ptr &smartfd, size_t amount) |
size_t | default_pread (int &err, SmartFd::Ptr &smartfd, uint64_t offset, StaticBuffer *dst, size_t amount) |
virtual void | pread (Callback::PreadCb_t &&cb, SmartFd::Ptr &smartfd, uint64_t offset, size_t amount) |
virtual void | append (Callback::AppendCb_t &&cb, SmartFd::Ptr &smartfd, StaticBuffer &buffer, Flags flags) |
virtual void | seek (Callback::CloseCb_t &&cb, SmartFd::Ptr &smartfd, size_t offset) |
virtual void | flush (Callback::FlushCb_t &&cb, SmartFd::Ptr &smartfd) |
virtual void | sync (Callback::SyncCb_t &&cb, SmartFd::Ptr &smartfd) |
virtual void | close (Callback::CloseCb_t &&cb, SmartFd::Ptr &smartfd) |
Private Attributes | |
bool | m_directio |
Additional Inherited Members | |
![]() | |
typedef std::shared_ptr< FileSystem > | Ptr |
![]() | |
const ImplOptions | impl_options |
const std::string | path_root |
const std::string | path_data |
const Config::Settings::Ptr | settings |
const Config::Property::Value_int32_g::Ptr | cfg_fds_max |
Core::AtomicBool | m_run |
Statistics | statistics |
Definition at line 22 of file FileSystem.h.
SWC::FS::FileSystemLocal::FileSystemLocal | ( | Configurables * | config | ) |
Definition at line 86 of file FileSystem.cc.
|
delete |
|
delete |
|
virtualnoexcept |
Definition at line 104 of file FileSystem.cc.
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 619 of file FileSystem.cc.
References SWC::FS::Statistics::APPEND_SYNC, SWC::Core::Buffer< T >::base, flags, SWC::FS::FLUSH, SWC::Error::OK, SWC::Core::Buffer< T >::size, SWC::FS::FileSystem::statistics, SWC_FS_APPEND_FINISH, SWC_FS_APPEND_START, SWC_FSYNC, SWC::FS::SYNC, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 668 of file FileSystem.cc.
References SWC::FS::Statistics::CLOSE_SYNC, SWC::FS::FileSystem::fd_open_decr(), SWC::FS::FileSystem::statistics, SWC_FS_CLOSE_FINISH, SWC_FS_CLOSE_START, and SWC::FS::Statistics::tracker().
|
inlineoverridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 72 of file FileSystem.h.
References SWC::FS::FileSystem::default_combi_pread().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 443 of file FileSystem.cc.
References SWC::FS::Statistics::CREATE_SYNC, SWC::FS::FileSystem::fd_open_incr(), SWC::FS::FileSystem::fds_open(), SWC::Error::FS_PATH_NOT_FOUND, SWC::Error::FS_PERMISSION_DENIED, SWC::FS::FileSystem::get_abspath(), m_directio, SWC::Error::OK, open(), SWC::FS::OPEN_FLAG_DIRECTIO, SWC::FS::OPEN_FLAG_OVERWRITE, SWC::FS::FileSystem::statistics, SWC_FS_CREATE_FINISH, SWC_FS_CREATE_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 127 of file FileSystem.cc.
References SWC::FS::Statistics::EXISTS_SYNC, SWC::FS::FileSystem::get_abspath(), SWC::Error::OK, SWC::FS::FileSystem::statistics, SWC_FS_EXISTS_FINISH, SWC_FS_EXISTS_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 656 of file FileSystem.cc.
References sync().
|
overridevirtualnoexcept |
Reimplemented from SWC::FS::FileSystem.
Definition at line 113 of file FileSystem.cc.
References SWC::FS::LOCAL.
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 150 of file FileSystem.cc.
References SWC::FS::FileSystem::get_abspath(), SWC::FS::Statistics::LENGTH_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_LENGTH_FINISH, SWC_FS_LENGTH_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 191 of file FileSystem.cc.
References SWC::FS::FileSystem::get_abspath(), SWC::FS::Statistics::MKDIRS_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_MKDIRS_FINISH, SWC_FS_MKDIRS_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 485 of file FileSystem.cc.
References SWC::FS::FileSystem::fd_open_incr(), SWC::FS::FileSystem::fds_open(), SWC::Error::FS_PATH_NOT_FOUND, SWC::Error::FS_PERMISSION_DENIED, SWC::FS::FileSystem::get_abspath(), m_directio, SWC::Error::OK, SWC::FS::OPEN_FLAG_DIRECTIO, SWC::FS::Statistics::OPEN_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_OPEN_FINISH, SWC_FS_OPEN_START, and SWC::FS::Statistics::tracker().
Referenced by create().
|
delete |
|
delete |
|
inlineoverridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 93 of file FileSystem.h.
References SWC::FS::FileSystem::default_pread().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 582 of file FileSystem.cc.
References SWC::Error::FS_EOF, SWC::Error::OK, SWC::FS::Statistics::PREAD_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_PREAD_FINISH, SWC_FS_PREAD_START, and SWC::FS::Statistics::tracker().
|
inlineoverridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 64 of file FileSystem.h.
References SWC::FS::FileSystem::default_read().
|
inlineoverridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 85 of file FileSystem.h.
References SWC::FS::FileSystem::default_read().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 542 of file FileSystem.cc.
References SWC::Error::FS_EOF, SWC::Error::OK, SWC::FS::Statistics::READ_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_READ_FINISH, SWC_FS_READ_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 200 of file FileSystem.cc.
References SWC::Core::Vector< T, SizeT, GROW_SZ >::clear(), SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), SWC::FS::FileSystem::get_abspath(), SWC::FS::Statistics::READDIR_SYNC, SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), SWC::FS::FileSystem::statistics, SWC_FS_READDIR_FINISH, SWC_FS_READDIR_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 140 of file FileSystem.cc.
References SWC::FS::FileSystem::get_abspath(), SWC::Error::OK, SWC::FS::Statistics::REMOVE_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_REMOVE_FINISH, SWC_FS_REMOVE_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 284 of file FileSystem.cc.
References SWC::Condition::from(), SWC::FS::FileSystem::get_abspath(), SWC::Comm::Protocol::FsBroker::Handler::rename(), SWC::FS::Statistics::RENAME_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_RENAME_FINISH, SWC_FS_RENAME_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 273 of file FileSystem.cc.
References SWC::FS::FileSystem::get_abspath(), SWC::FS::Statistics::RMDIR_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_RMDIR_FINISH, SWC_FS_RMDIR_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 640 of file FileSystem.cc.
References SWC::FS::Statistics::SEEK_SYNC, SWC::FS::FileSystem::statistics, SWC_FS_SEEK_FINISH, SWC_FS_SEEK_START, and SWC::FS::Statistics::tracker().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 660 of file FileSystem.cc.
References SWC::Error::OK, SWC::FS::FileSystem::statistics, SWC_FS_SYNC_FINISH, SWC_FS_SYNC_START, SWC_FSYNC, SWC::FS::Statistics::SYNC_SYNC, and SWC::FS::Statistics::tracker().
Referenced by flush().
|
overridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 117 of file FileSystem.cc.
References SWC::format(), SWC::FS::FileSystem::path_data, and SWC::FS::FileSystem::path_root.
|
inlineoverridevirtual |
Implements SWC::FS::FileSystem.
Definition at line 59 of file FileSystem.h.
References SWC::FS::FileSystem::default_write().
|
private |
Definition at line 110 of file FileSystem.h.