22 #ifndef FsBroker_Lib_Broker_h
23 #define FsBroker_Lib_Broker_h
31 #include "Response/Callback/Status.h"
63 uint32_t flags, uint32_t bufsz) = 0;
77 uint32_t flags, int32_t bufsz,
78 int16_t replication, int64_t blksz) = 0;
130 bool accurate =
true) = 0;
141 uint32_t amount,
bool verify_checksum) = 0;
214 const char *dst) = 0;
247 #endif // FsBroker_Lib_Broker_h
Declarations for Exists response callback.
virtual void flush(ResponseCallback *cb, uint32_t fd)=0
Flush data that has been written.
A memory buffer of static size.
virtual void open(Response::Callback::Open *cb, const char *fname, uint32_t flags, uint32_t bufsz)=0
Open a file and pass the fd to the callback on success.
virtual void readdir(Response::Callback::Readdir *cb, const char *dname)=0
Read a directory's contents.
Declarations for Open response callback.
virtual void exists(Response::Callback::Exists *cb, const char *fname)=0
Check for the existence of a file.
Application handler for append function.
Abstract class to be implemented by brokers.
virtual void sync(ResponseCallback *cb, uint32_t fd)=0
Sync out data that has been written.
virtual void status(Response::Callback::Status *cb)=0
Check status of FSBroker.
Flags
Enumeration type for append flags.
Application handler for exists function.
virtual void debug(ResponseCallback *cb, int32_t command, StaticBuffer &serialized_parameters)=0
Debug command.
Declarations for Length response callback.
virtual void append(Response::Callback::Append *cb, uint32_t fd, uint32_t amount, const void *data, Filesystem::Flags flags)=0
Append data to open file.
Declarations for Read response callback.
Application handler for length function.
OpenFileMap & get_open_file_map()
virtual void mkdirs(ResponseCallback *cb, const char *dname)=0
Make a directory hierarcy, If the parent dirs are not, present, they are also created.
virtual void rmdir(ResponseCallback *cb, const char *dname)=0
Remove a directory.
virtual void create(Response::Callback::Open *cb, const char *fname, uint32_t flags, int32_t bufsz, int16_t replication, int64_t blksz)=0
Open a file, and create it if it doesn't exist, optionally overwriting the contents.
virtual void shutdown(ResponseCallback *cb)=0
Gracefully shutdown broker, closeing open files.
A memory buffer of static size.
std::shared_ptr< Broker > BrokerPtr
Smart pointer to Broker.
virtual void pread(Response::Callback::Read *cb, uint32_t fd, uint64_t offset, uint32_t amount, bool verify_checksum)=0
Read from file at position.
OpenFileMap m_open_file_map
A map of open files.
Declarations for Append response callback.
This class is used to generate and deliver standard responses back to a client.
Application handler for readdir function.
Application handler for open function.
Application handler for read function.
virtual void rename(ResponseCallback *cb, const char *src, const char *dst)=0
Rename a file from src to dst.
Declarations for Readdir response callback.
virtual void read(Response::Callback::Read *cb, uint32_t fd, uint32_t amount)=0
Read data from an open file.
Application handler for open function.
virtual void seek(ResponseCallback *cb, uint32_t fd, uint64_t offset)=0
Seek open file.
virtual void length(Response::Callback::Length *cb, const char *fname, bool accurate=true)=0
Get length of file.
virtual void close(ResponseCallback *cb, uint32_t fd)=0
Close open file.