Seastar
High performance C++ framework for concurrent servers
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
seastar::layered_file_impl Class Referenceabstract

Detailed Description

Base class for layered file implementations.

A layered file implementation implements file_impl virtual functions such as dma_read() by forwarding them to another, existing file called the underlying file. This base class simplifies construction of layered files by performing standard tasks such as setting up the file alignment. Actual implementation of the I/O methods is left for the derived class.

#include <seastar/core/layered_file.hh>

Inheritance diagram for seastar::layered_file_impl:
seastar::file_impl

Public Member Functions

 layered_file_impl (file underlying_file) noexcept
 
fileunderlying_file () noexcept
 The underlying file which can be used to back I/O methods.
 
const fileunderlying_file () const noexcept
 The underlying file which can be used to back I/O methods.
 
virtual future< size_t > write_dma (uint64_t pos, const void *buffer, size_t len, const io_priority_class &pc)=0
 
virtual future< size_t > write_dma (uint64_t pos, std::vector< iovec > iov, const io_priority_class &pc)=0
 
virtual future< size_t > write_dma (uint64_t pos, const void *buffer, size_t len, const io_priority_class &pc, io_intent *)
 
virtual future< size_t > write_dma (uint64_t pos, std::vector< iovec > iov, const io_priority_class &pc, io_intent *)
 
virtual future< size_t > read_dma (uint64_t pos, void *buffer, size_t len, const io_priority_class &pc)=0
 
virtual future< size_t > read_dma (uint64_t pos, std::vector< iovec > iov, const io_priority_class &pc)=0
 
virtual future< size_t > read_dma (uint64_t pos, void *buffer, size_t len, const io_priority_class &pc, io_intent *)
 
virtual future< size_t > read_dma (uint64_t pos, std::vector< iovec > iov, const io_priority_class &pc, io_intent *)
 
virtual future flush (void)=0
 
virtual future< struct stat > stat (void)=0
 
virtual future truncate (uint64_t length)=0
 
virtual future discard (uint64_t offset, uint64_t length)=0
 
virtual future< int > ioctl (uint64_t cmd, void *argp) noexcept
 
virtual future< int > ioctl_short (uint64_t cmd, void *argp) noexcept
 
virtual future< int > fcntl (int op, uintptr_t arg) noexcept
 
virtual future< int > fcntl_short (int op, uintptr_t arg) noexcept
 
virtual future allocate (uint64_t position, uint64_t length)=0
 
virtual future< uint64_t > size (void)=0
 
virtual future close ()=0
 
virtual std::unique_ptr< file_handle_impldup ()
 
virtual subscription< directory_entrylist_directory (std::function< future<>(directory_entry de)> next)=0
 
virtual future< temporary_buffer< uint8_t > > dma_read_bulk (uint64_t offset, size_t range_size, const io_priority_class &pc)=0
 
virtual future< temporary_buffer< uint8_t > > dma_read_bulk (uint64_t offset, size_t range_size, const io_priority_class &pc, io_intent *)
 

Static Protected Member Functions

static file_implget_file_impl (file &f)
 

Protected Attributes

file _underlying_file
 
unsigned _memory_dma_alignment = 4096
 
unsigned _disk_read_dma_alignment = 4096
 
unsigned _disk_write_dma_alignment = 4096
 
unsigned _disk_overwrite_dma_alignment = 4096
 
unsigned _read_max_length = 1u << 30
 
unsigned _write_max_length = 1u << 30
 

Constructor & Destructor Documentation

◆ layered_file_impl()

seastar::layered_file_impl::layered_file_impl ( file  underlying_file)
inlineexplicitnoexcept

Constructs a layered file. This sets up the underlying_file() method and initializes alignment constants to be the same as the underlying file.


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