|
| PositionalParallelFile () |
| Default constructor. More...
|
|
| ~PositionalParallelFile () |
| Destructor. More...
|
|
| PositionalParallelFile (const PositionalParallelFile &rhs)=delete |
| Copy and assignment are disabled. More...
|
|
PositionalParallelFile & | operator= (const PositionalParallelFile &rhs)=delete |
|
Status | Open (const std::string &path, bool writable, int32_t options=OPEN_DEFAULT) override |
| Opens a file. More...
|
|
Status | Close () override |
| Closes the file. More...
|
|
Status | Read (int64_t off, void *buf, size_t size) override |
| Reads data. More...
|
|
Status | Write (int64_t off, const void *buf, size_t size) override |
| Writes data. More...
|
|
Status | Append (const void *buf, size_t size, int64_t *off=nullptr) override |
| Appends data at the end of the file. More...
|
|
Status | Expand (size_t inc_size, int64_t *old_size=nullptr) override |
| Expands the file size without writing data. More...
|
|
Status | Truncate (int64_t size) override |
| Truncates the file. More...
|
|
Status | TruncateFakely (int64_t size) override |
| Truncate the file fakely. More...
|
|
Status | Synchronize (bool hard, int64_t off=0, int64_t size=0) override |
| Synchronizes the content of the file to the file system. More...
|
|
Status | GetSize (int64_t *size) override |
| Gets the size of the file. More...
|
|
Status | SetHeadBuffer (int64_t size) override |
| Sets the head buffer to cache the beginning region of the file. More...
|
|
Status | SetAccessStrategy (int64_t block_size, int32_t options) override |
| Sets access strategy. More...
|
|
Status | SetAllocationStrategy (int64_t init_size, double inc_factor) override |
| Sets allocation strategy. More...
|
|
Status | CopyProperties (File *file) override |
| Copies internal properties to another file object. More...
|
|
Status | GetPath (std::string *path) override |
| Gets the path of the file. More...
|
|
Status | Rename (const std::string &new_path) override |
| Renames the file. More...
|
|
Status | DisablePathOperations () override |
| Disables operations related to the path. More...
|
|
bool | IsOpen () const override |
| Checks whether the file is open. More...
|
|
bool | IsMemoryMapping () const override |
| Checks whether operations are done by memory mapping. More...
|
|
bool | IsAtomic () const override |
| Checks whether updating operations are atomic and thread-safe. More...
|
|
int64_t | GetBlockSize () const override |
| Gets the block size. More...
|
|
bool | IsDirectIO () const override |
| Checks whether the access mode is direct I/O. More...
|
|
std::unique_ptr< File > | MakeFile () const override |
| Makes a new file object of the same concrete class. More...
|
|
virtual | ~PositionalFile ()=default |
| Destructor. More...
|
|
virtual Status | SetHeadBuffer (int64_t size)=0 |
| Sets the head buffer to cache the beginning region of the file. More...
|
|
virtual Status | SetAccessStrategy (int64_t block_size, int32_t options)=0 |
| Sets access strategy. More...
|
|
virtual int64_t | GetBlockSize () const =0 |
| Gets the block size. More...
|
|
virtual bool | IsDirectIO () const =0 |
| Checks whether the access mode is direct I/O. More...
|
|
virtual | ~File ()=default |
| Destructor. More...
|
|
virtual Status | Open (const std::string &path, bool writable, int32_t options=OPEN_DEFAULT)=0 |
| Opens a file. More...
|
|
virtual Status | Close ()=0 |
| Closes the file. More...
|
|
virtual Status | Read (int64_t off, void *buf, size_t size)=0 |
| Reads data. More...
|
|
virtual std::string | ReadSimple (int64_t off, size_t size) |
| Reads data, in a simple way. More...
|
|
virtual Status | Write (int64_t off, const void *buf, size_t size)=0 |
| Writes data. More...
|
|
virtual bool | WriteSimple (int64_t off, std::string_view data) |
| Writes data, in a simple way. More...
|
|
virtual Status | Append (const void *buf, size_t size, int64_t *off=nullptr)=0 |
| Appends data at the end of the file. More...
|
|
virtual int64_t | AppendSimple (const std::string &data) |
| Appends data at the end of the file, in a simple way. More...
|
|
virtual Status | Expand (size_t inc_size, int64_t *old_size=nullptr)=0 |
| Expands the file size without writing data. More...
|
|
virtual int64_t | ExpandSimple (size_t inc_size) |
| Expands the file size without writing data, in a simple way. More...
|
|
virtual Status | Truncate (int64_t size)=0 |
| Truncates the file. More...
|
|
virtual Status | TruncateFakely (int64_t size)=0 |
| Truncate the file fakely. More...
|
|
virtual Status | Synchronize (bool hard, int64_t off=0, int64_t size=0)=0 |
| Synchronizes the content of the file to the file system. More...
|
|
virtual Status | GetSize (int64_t *size)=0 |
| Gets the size of the file. More...
|
|
virtual int64_t | GetSizeSimple () |
| Gets the size of the file, in a simple way. More...
|
|
virtual Status | SetAllocationStrategy (int64_t init_size, double inc_factor)=0 |
| Sets allocation strategy. More...
|
|
virtual Status | CopyProperties (File *file)=0 |
| Copies internal properties to another file object. More...
|
|
virtual Status | GetPath (std::string *path)=0 |
| Gets the path of the file. More...
|
|
virtual std::string | GetPathSimple () |
| Gets the path of the file, in a simple way. More...
|
|
virtual Status | Rename (const std::string &new_path)=0 |
| Renames the file. More...
|
|
virtual Status | DisablePathOperations ()=0 |
| Disables operations related to the path. More...
|
|
virtual bool | IsOpen () const =0 |
| Checks whether the file is open. More...
|
|
virtual bool | IsMemoryMapping () const =0 |
| Checks whether operations are done by memory mapping. More...
|
|
virtual bool | IsAtomic () const =0 |
| Checks whether updating operations are atomic and thread-safe. More...
|
|
virtual std::unique_ptr< File > | MakeFile () const =0 |
| Makes a new file object of the same concrete class. More...
|
|
const std::type_info & | GetType () const |
| Gets the type information of the actual class. More...
|
|
File implementation by positional access and locking for parallel operations.
Reading and writing operations are thread-safe; Multiple threads can access the same file concurrently. Other operations including Open, Close, Truncate, and Synchronize are not thread-safe. Moreover, locking doesn't assure atomicity of reading and writing operations.