Class MetadataModule

Class Documentation

class gkfs::metadata::MetadataModule

MetadataModule is a singleton class that holds global data structures for all metadata operations.

Public Functions

MetadataModule(MetadataModule const&) = delete
void operator=(MetadataModule const&) = delete
const std::shared_ptr<spdlog::logger> &log() const
void log(const std::shared_ptr<spdlog::logger> &log)
const std::map<uint16_t, size_t> &append_offset_reserve() const
void append_offset_reserve_put(uint16_t merge_id, size_t offset)

Inserts entry into append_offset_reserve_.

Parameters
  • merge_id – Merge ID

  • offset – Offset to reserve

size_t append_offset_reserve_get_and_erase(uint16_t merge_id)

Gets and erases entry from append_offset_reserve_.

Parameters

merge_id – Merge ID

Throws

std::out_of_range – if merge_id is not in append_offset_reserve_

Returns

Offset reserved for merge_id

Public Static Functions

static inline MetadataModule *getInstance()

Get the MetadataModule singleton instance.

Returns

MetadataModule instance

Public Static Attributes

static constexpr const char *LOGGER_NAME = "MetadataModule"

< Logger name

Private Functions

MetadataModule() = default

Private Members

std::shared_ptr<spdlog::logger> log_

Map to remember and assign offsets to write append operations.

Metadata logger

std::map<uint16_t, size_t> append_offset_reserve_ = {}
std::mutex append_offset_reserve_mutex_ = {}

Mutex to protect append_offset_reserve_