#include <CephBroker.h>


Public Member Functions | |
| CephBroker (PropertiesPtr &cfg) | |
| virtual | ~CephBroker () |
| virtual void | open (Response::Callback::Open *cb, const char *fname, uint32_t flags, uint32_t bufsz) |
| Open a file and pass the fd to the callback on success. More... | |
| virtual void | create (Response::Callback::Open *cb, const char *fname, uint32_t flags, int32_t bufsz, int16_t replication, int64_t blksz) |
| Open a file, and create it if it doesn't exist, optionally overwriting the contents. More... | |
| virtual void | close (ResponseCallback *cb, uint32_t fd) |
| Close open file. More... | |
| virtual void | read (Response::Callback::Read *cb, uint32_t fd, uint32_t amount) |
| Read data from an open file. More... | |
| virtual void | append (Response::Callback::Append *cb, uint32_t fd, uint32_t amount, const void *data, Filesystem::Flags flags) |
| Append data to open file. More... | |
| virtual void | seek (ResponseCallback *cb, uint32_t fd, uint64_t offset) |
| Seek open file. More... | |
| virtual void | remove (ResponseCallback *cb, const char *fname) |
| Remove a file or directory. More... | |
| virtual void | length (Response::Callback::Length *cb, const char *fname, bool accurate=true) |
| Get length of file. More... | |
| virtual void | pread (Response::Callback::Read *cb, uint32_t fd, uint64_t offset, uint32_t amount, bool verify_checksum) |
| Read from file at position. More... | |
| virtual void | mkdirs (ResponseCallback *cb, const char *dname) |
| Make a directory hierarcy, If the parent dirs are not, present, they are also created. More... | |
| virtual void | rmdir (ResponseCallback *cb, const char *dname) |
| Remove a directory. More... | |
| virtual void | flush (ResponseCallback *cb, uint32_t fd) |
| Flush data that has been written. More... | |
| virtual void | sync (ResponseCallback *cb, uint32_t fd) |
| Sync out data that has been written. More... | |
| virtual void | status (Response::Callback::Status *cb) |
| Check status of FSBroker. More... | |
| virtual void | shutdown (ResponseCallback *cb) |
| Gracefully shutdown broker, closeing open files. More... | |
| virtual void | readdir (Response::Callback::Readdir *cb, const char *dname) |
| Read a directory's contents. More... | |
| virtual void | exists (Response::Callback::Exists *cb, const char *fname) |
| Check for the existence of a file. More... | |
| virtual void | rename (ResponseCallback *cb, const char *src, const char *dst) |
| Rename a file from src to dst. More... | |
| virtual void | debug (ResponseCallback *, int32_t command, StaticBuffer &serialized_parameters) |
| Debug command. More... | |
Public Member Functions inherited from Hypertable::FsBroker::Lib::Broker | |
| virtual | ~Broker () |
| OpenFileMap & | get_open_file_map () |
Private Member Functions | |
| virtual void | report_error (ResponseCallback *cb, int error) |
| void | make_abs_path (const char *fname, String &abs) |
| int | rmdir_recursive (const char *directory) |
Private Attributes | |
| Hypertable::Status | m_status |
| Server status information. More... | |
| bool | m_verbose |
| String | m_root_dir |
Static Private Attributes | |
| static atomic< int > | ms_next_fd |
Additional Inherited Members | |
Protected Attributes inherited from Hypertable::FsBroker::Lib::Broker | |
| OpenFileMap | m_open_file_map |
| A map of open files. More... | |
Definition at line 58 of file CephBroker.h.
| CephBroker::CephBroker | ( | PropertiesPtr & | cfg | ) |
Definition at line 46 of file CephBroker.cc.
|
virtual |
Definition at line 71 of file CephBroker.cc.
|
virtual |
Append data to open file.
| cb | Response callback |
| fd | An open file descriptor. |
| amount | Number of bytes to write. |
| data | The data to write. |
| flags | Flags (FLUSH or SYNC) |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 193 of file CephBroker.cc.
|
virtual |
Close open file.
| fd | An open file descriptor of the file to close. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 151 of file CephBroker.cc.
|
virtual |
Open a file, and create it if it doesn't exist, optionally overwriting the contents.
Fd is passed to the callback upon success.
| fname | The file to be opened and/or created. |
| flags | An enum Hypertable::Filesystem::OpenFlags. If OPEN_FLAG_OVERWRITE is set, then overwrite the file. |
| bufsz | Buffer size. |
| replication | Amount of replication of file. |
| blksz | Block size of file. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 103 of file CephBroker.cc.
|
virtual |
Debug command.
| command | |
| serialized_parameters | |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 476 of file CephBroker.cc.
|
virtual |
Check for the existence of a file.
| cb | Response callback |
| fname | The file to be checked. |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 453 of file CephBroker.cc.
|
virtual |
Flush data that has been written.
| fd | An open file. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 373 of file CephBroker.cc.
|
virtual |
Get length of file.
| fname | File to get length of. |
| accurate | Should the length be accurate or an estimation. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 274 of file CephBroker.cc.
|
inlineprivate |
Definition at line 95 of file CephBroker.h.
|
virtual |
Make a directory hierarcy, If the parent dirs are not, present, they are also created.
| dname | The pathname |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 320 of file CephBroker.cc.
|
virtual |
Open a file and pass the fd to the callback on success.
| fname | The filename to be opened. |
| flags | An enum Hypertable::Filesystem::OpenFlags |
| bufsz | Buffer size |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 75 of file CephBroker.cc.
|
virtual |
Read from file at position.
| fd | Open fd to read from. |
| offset | Postion to read from. |
| amount | Nubmer of bytes to read. |
| verify_checksum | Verify checksum of data read |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 293 of file CephBroker.cc.
|
virtual |
Read data from an open file.
| fd | An open file descriptor. |
| amount | Number of bytes to read. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 161 of file CephBroker.cc.
|
virtual |
Read a directory's contents.
| dname | The directory to list. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 409 of file CephBroker.cc.
|
virtual |
Remove a file or directory.
| fname | File to remove. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 258 of file CephBroker.cc.
|
virtual |
Rename a file from src to dst.
| src | The file to be renamed. |
| dst | The path the file should be renamed to. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 462 of file CephBroker.cc.
|
privatevirtual |
Definition at line 482 of file CephBroker.cc.
|
virtual |
Remove a directory.
| dname | The directory to be removed. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 335 of file CephBroker.cc.
|
private |
Definition at line 348 of file CephBroker.cc.
|
virtual |
Seek open file.
| fd | An open file descriptor. |
| offset | Position to seek to. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 236 of file CephBroker.cc.
|
virtual |
Gracefully shutdown broker, closeing open files.
| cb | Callbock to be called upon finishing task. |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 403 of file CephBroker.cc.
|
virtual |
Check status of FSBroker.
| cb | call cb->response_ok() |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 399 of file CephBroker.cc.
|
virtual |
Sync out data that has been written.
| fd | An open file. |
| cb |
Implements Hypertable::FsBroker::Lib::Broker.
Definition at line 377 of file CephBroker.cc.
|
private |
Definition at line 108 of file CephBroker.h.
|
private |
Server status information.
Definition at line 105 of file CephBroker.h.
|
private |
Definition at line 107 of file CephBroker.h.
|
staticprivate |
Definition at line 91 of file CephBroker.h.
1.8.8