|
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
6 #ifndef swcdb_fs_Interface_h
7 #define swcdb_fs_Interface_h
12 #if defined (BUILTIN_FS_LOCAL) || defined (BUILTIN_FS_ALL)
17 #if defined (BUILTIN_FS_CEPH) || defined (BUILTIN_FS_ALL)
22 #if defined (BUILTIN_FS_HADOOP) || defined (BUILTIN_FS_ALL)
26 #if defined (BUILTIN_FS_HADOOP_JVM) || defined (BUILTIN_FS_ALL)
31 #if defined (BUILTIN_FS_BROKER) || defined (BUILTIN_FS_ALL)
37 namespace SWC {
namespace FS {
45 class Interface final :
public std::enable_shared_from_this<Interface> {
48 typedef std::shared_ptr<Interface>
Ptr;
56 return shared_from_this();
76 const std::
string& base_id="");
82 bool exists(
int& err, const std::
string& name);
86 void mkdirs(
int& err, const std::
string& name);
88 void rmdir(
int& err, const std::
string& name);
91 const std::
string& up_to);
93 void remove(
int& err, const std::
string& name);
97 void rename(
int& err, const std::
string&
from , const std::
string& to);
99 size_t length(
int& err, const std::
string& name);
121 void* make =
nullptr;
140 typedef std::shared_ptr<FsInterface>
Ptr;
151 return m_env->m_interface;
156 return m_env->m_interface->get_fs();
178 #ifdef SWC_IMPL_SOURCE
183 #endif // swcdb_fs_Interface_h
static void init(const SWC::Config::Settings::Ptr &settings, FS::Type typ)
std::shared_ptr< FileSystem > Ptr
static SWC_CAN_INLINE Ptr & get() noexcept
void rmdir_incl_opt_subs(int &err, const std::string &name, const std::string &up_to)
std::string to_string() const
std::shared_ptr< Settings > Ptr
FsInterface(const SWC::Config::Settings::Ptr &settings, FS::Type typ)
void write(int &err, SmartFd::Ptr smartfd, uint8_t replication, StaticBuffer &buffer)
Interface to FileSystems.
bool open(int &err, SmartFd::Ptr &smartfd)
static SWC_CAN_INLINE FS::Interface::Ptr & interface() noexcept
SWC_CAN_INLINE FileSystem::Ptr & get_fs() noexcept
void rmdir(int &err, const std::string &name)
void remove(int &err, const std::string &name)
std::function< void(int, bool)> ExistsCb_t
std::function< void(int)> CloseCb_t
void get_structured_ids(int &err, const std::string &base_path, IdEntries_t &entries, const std::string &base_id="")
bool exists(int &err, const std::string &name)
The SWC-DB C++ namespace 'SWC'.
void readdir(int &err, const std::string &base_path, DirentList &dirs)
bool create(int &err, SmartFd::Ptr &smartfd, uint8_t replication)
static SWC_CAN_INLINE FS::FileSystem::Ptr & fs() noexcept
Interface(const Config::Settings::Ptr &settings, Type typ)
bool need_fds() const noexcept
void close(int &err, SmartFd::Ptr &smartfd)
std::function< void(int)> RemoveCb_t
void rename(int &err, const std::string &from, const std::string &to)
void mkdirs(int &err, const std::string &name)
Core::Vector< uint64_t > IdEntries_t
FS::Interface::Ptr m_interface
Comp from(const char **buf, uint32_t *remainp, uint8_t extended=0x00) noexcept
FileSystem::Ptr use_filesystem(const Config::Settings::Ptr &settings)
size_t length(int &err, const std::string &name)
Type get_type_underlying() const noexcept
SWC_CAN_INLINE Ptr ptr() noexcept
void read(int &err, const std::string &name, StaticBuffer *dst)
std::shared_ptr< FsInterface > Ptr
void set_structured_id(const std::string &number, std::string &s)
std::shared_ptr< Interface > Ptr
static void reset() noexcept