45 uint64_t total_size = 0;
47 for (
size_t i = 0; i <
ndisks_; ++i)
59 TLX_LOG1 <<
"foxxll: Disk '" << cfg.
path <<
"' is allocated, space: " 60 << (cfg.
size) / (1024 * 1024)
65 TLX_LOG1 <<
"foxxll: Error allocating disk '" << cfg.
path <<
"', space: " 66 << (cfg.
size) / (1024 * 1024)
71 total_size += cfg.
size;
81 TLX_LOG1 <<
"foxxll: In total " << ndisks_ <<
" disks are allocated, space: " 82 << (total_size / (1024 * 1024)) <<
" MiB";
88 TLX_LOG <<
"foxxll: Block manager destructor";
89 for (
size_t i =
ndisks_; i > 0; )
99 std::unique_lock<std::mutex> lock(
mutex_);
103 for (
size_t i = 0; i <
ndisks_; ++i)
111 std::unique_lock<std::mutex> lock(
mutex_);
115 for (
size_t i = 0; i <
ndisks_; ++i)
123 std::unique_lock<std::mutex> lock(
mutex_);
129 std::unique_lock<std::mutex> lock(
mutex_);
135 std::unique_lock<std::mutex> lock(
mutex_);
external_size_type size
file size to initially allocate
std::mutex mutex_
protect internal data structures
uint64_t free_bytes() const
Return total number of free bytes.
std::string path
the file path used by the io implementation
uint64_t current_allocation_
currently allocated bytes
file_ptr create_file(const std::string &io_impl, const std::string &filename, int options, int physical_device_id, int disk_allocator_id)
create fileio object from io_impl string and a few parameters
uint64_t current_allocation() const
return currently allocated bytes
tlx::simple_vector< disk_block_allocator * > block_allocators_
one block allocator per disk
uint64_t total_allocation_
total requested allocation in bytes
uint64_t maximum_allocation() const
return maximum number of bytes allocated during program run.
disk_config & disk(size_t disk)
Returns mutable disk_config structure for additional disk parameters.
uint64_t total_bytes() const
return total number of bytes available in all disks
static const int DEFAULT_QUEUE
static instance_pointer get_instance()
return instance or create base instance if empty
size_t ndisks_
number of managed disks
uint64_t total_allocation() const
return total requested allocation in bytes
std::string fileio_string() const
return formatted fileio name and optional configuration parameters
block_manager()
private construction from singleton
tlx::simple_vector< file_ptr > disk_files_
vector of opened disk files
read and write of the file are allowed
uint64_t maximum_allocation_
maximum number of bytes allocated during program run.
This class manages allocation of blocks onto a single disk.
#define TLX_LOG
Default logging method: output if the local debug variable is true.