SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::FS::FileSystemLocal Class Referencefinal

#include <swcdb/fs/Local/FileSystem.h>

+ Inheritance diagram for SWC::FS::FileSystemLocal:
+ Collaboration diagram for SWC::FS::FileSystemLocal:

Public Member Functions

 FileSystemLocal (Configurables *config)
 
 FileSystemLocal (FileSystemLocal &&)=delete
 
 FileSystemLocal (const FileSystemLocal &)=delete
 
FileSystemLocaloperator= (FileSystemLocal &&)=delete
 
FileSystemLocaloperator= (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
 
- Public Member Functions inherited from SWC::FS::FileSystem
 FileSystem (const Configurables *config, ImplOptions impl_opts)
 
 FileSystem (FileSystem &&)=delete
 
 FileSystem (const FileSystem &)=delete
 
FileSystemoperator= (FileSystem &&)=delete
 
FileSystemoperator= (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

- Public Types inherited from SWC::FS::FileSystem
typedef std::shared_ptr< FileSystemPtr
 
- Public Attributes inherited from SWC::FS::FileSystem
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
 

Detailed Description

Definition at line 22 of file FileSystem.h.

Constructor & Destructor Documentation

◆ FileSystemLocal() [1/3]

SWC::FS::FileSystemLocal::FileSystemLocal ( Configurables config)

Definition at line 86 of file FileSystem.cc.

◆ FileSystemLocal() [2/3]

SWC::FS::FileSystemLocal::FileSystemLocal ( FileSystemLocal &&  )
delete

◆ FileSystemLocal() [3/3]

SWC::FS::FileSystemLocal::FileSystemLocal ( const FileSystemLocal )
delete

◆ ~FileSystemLocal()

SWC::FS::FileSystemLocal::~FileSystemLocal ( )
virtualnoexcept

Definition at line 104 of file FileSystem.cc.

Member Function Documentation

◆ append()

size_t SWC::FS::FileSystemLocal::append ( int &  err,
SmartFd::Ptr smartfd,
StaticBuffer buffer,
Flags  flags 
)
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().

+ Here is the call graph for this function:

◆ close()

void SWC::FS::FileSystemLocal::close ( int &  err,
SmartFd::Ptr smartfd 
)
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().

+ Here is the call graph for this function:

◆ combi_pread()

void SWC::FS::FileSystemLocal::combi_pread ( int &  err,
SmartFd::Ptr smartfd,
uint64_t  offset,
uint32_t  amount,
StaticBuffer dst 
)
inlineoverridevirtual

Implements SWC::FS::FileSystem.

Definition at line 72 of file FileSystem.h.

References SWC::FS::FileSystem::default_combi_pread().

+ Here is the call graph for this function:

◆ create()

void SWC::FS::FileSystemLocal::create ( int &  err,
SmartFd::Ptr smartfd,
uint8_t  replication 
)
overridevirtual

◆ exists()

bool SWC::FS::FileSystemLocal::exists ( int &  err,
const std::string &  name 
)
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().

+ Here is the call graph for this function:

◆ flush()

void SWC::FS::FileSystemLocal::flush ( int &  err,
SmartFd::Ptr smartfd 
)
overridevirtual

Implements SWC::FS::FileSystem.

Definition at line 656 of file FileSystem.cc.

References sync().

+ Here is the call graph for this function:

◆ get_type()

Type SWC::FS::FileSystemLocal::get_type ( ) const
overridevirtualnoexcept

Reimplemented from SWC::FS::FileSystem.

Definition at line 113 of file FileSystem.cc.

References SWC::FS::LOCAL.

◆ length()

size_t SWC::FS::FileSystemLocal::length ( int &  err,
const std::string &  name 
)
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().

+ Here is the call graph for this function:

◆ mkdirs()

void SWC::FS::FileSystemLocal::mkdirs ( int &  err,
const std::string &  name 
)
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().

+ Here is the call graph for this function:

◆ open()

void SWC::FS::FileSystemLocal::open ( int &  err,
SmartFd::Ptr smartfd 
)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

FileSystemLocal& SWC::FS::FileSystemLocal::operator= ( const FileSystemLocal )
delete

◆ operator=() [2/2]

FileSystemLocal& SWC::FS::FileSystemLocal::operator= ( FileSystemLocal &&  )
delete

◆ pread() [1/2]

size_t SWC::FS::FileSystemLocal::pread ( int &  err,
SmartFd::Ptr smartfd,
uint64_t  offset,
StaticBuffer dst,
size_t  amount 
)
inlineoverridevirtual

Implements SWC::FS::FileSystem.

Definition at line 93 of file FileSystem.h.

References SWC::FS::FileSystem::default_pread().

+ Here is the call graph for this function:

◆ pread() [2/2]

size_t SWC::FS::FileSystemLocal::pread ( int &  err,
SmartFd::Ptr smartfd,
uint64_t  offset,
void *  dst,
size_t  amount 
)
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().

+ Here is the call graph for this function:

◆ read() [1/3]

void SWC::FS::FileSystemLocal::read ( int &  err,
const std::string &  name,
StaticBuffer dst 
)
inlineoverridevirtual

Implements SWC::FS::FileSystem.

Definition at line 64 of file FileSystem.h.

References SWC::FS::FileSystem::default_read().

+ Here is the call graph for this function:

◆ read() [2/3]

size_t SWC::FS::FileSystemLocal::read ( int &  err,
SmartFd::Ptr smartfd,
StaticBuffer dst,
size_t  amount 
)
inlineoverridevirtual

Implements SWC::FS::FileSystem.

Definition at line 85 of file FileSystem.h.

References SWC::FS::FileSystem::default_read().

+ Here is the call graph for this function:

◆ read() [3/3]

size_t SWC::FS::FileSystemLocal::read ( int &  err,
SmartFd::Ptr smartfd,
void *  dst,
size_t  amount 
)
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().

+ Here is the call graph for this function:

◆ readdir()

void SWC::FS::FileSystemLocal::readdir ( int &  err,
const std::string &  name,
DirentList results 
)
overridevirtual

◆ remove()

void SWC::FS::FileSystemLocal::remove ( int &  err,
const std::string &  name 
)
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().

+ Here is the call graph for this function:

◆ rename()

void SWC::FS::FileSystemLocal::rename ( int &  err,
const std::string &  from,
const std::string &  to 
)
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().

+ Here is the call graph for this function:

◆ rmdir()

void SWC::FS::FileSystemLocal::rmdir ( int &  err,
const std::string &  name 
)
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().

+ Here is the call graph for this function:

◆ seek()

void SWC::FS::FileSystemLocal::seek ( int &  err,
SmartFd::Ptr smartfd,
size_t  offset 
)
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().

+ Here is the call graph for this function:

◆ sync()

void SWC::FS::FileSystemLocal::sync ( int &  err,
SmartFd::Ptr smartfd 
)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ to_string()

std::string SWC::FS::FileSystemLocal::to_string ( ) const
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.

+ Here is the call graph for this function:

◆ write()

void SWC::FS::FileSystemLocal::write ( int &  err,
SmartFd::Ptr smartfd,
uint8_t  replication,
StaticBuffer buffer 
)
inlineoverridevirtual

Implements SWC::FS::FileSystem.

Definition at line 59 of file FileSystem.h.

References SWC::FS::FileSystem::default_write().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_directio

bool SWC::FS::FileSystemLocal::m_directio
private

Definition at line 110 of file FileSystem.h.

Referenced by create(), and open().


The documentation for this class was generated from the following files: