OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::parsec::directory::impl Class Reference

Implementation of a directory which map keys to shard IDs. Thread-safe. More...

#include <impl.hpp>

Inheritance diagram for cbdc::parsec::directory::impl:
Collaboration diagram for cbdc::parsec::directory::impl:

Public Member Functions

 impl (size_t n_shards)
 Constructor.
 
auto key_location (runtime_locking_shard::key_type key, key_location_callback_type result_callback) -> bool override
 Returns the shard ID responsible for the given key.
 
- Public Member Functions inherited from cbdc::parsec::directory::interface
virtual ~interface ()=default
 
 interface ()=default
 
 interface (const interface &)=delete
 
auto operator= (const interface &) -> interface &=delete
 
 interface (interface &&)=delete
 
auto operator= (interface &&) -> interface &=delete
 

Additional Inherited Members

- Public Types inherited from cbdc::parsec::directory::interface
using key_location_return_type = uint64_t
 Key location return type. Shard ID where key is located.
 
using key_location_callback_type = std::function<void(key_location_return_type)>
 Callback function type for key location result.
 

Detailed Description

Implementation of a directory which map keys to shard IDs. Thread-safe.

Definition at line 13 of file directory/impl.hpp.

Constructor & Destructor Documentation

◆ impl()

cbdc::parsec::directory::impl::impl ( size_t n_shards)
explicit

Constructor.

Parameters
n_shardsnumber of shards available to the directory.

Definition at line 9 of file directory/impl.cpp.

Member Function Documentation

◆ key_location()

auto cbdc::parsec::directory::impl::key_location ( runtime_locking_shard::key_type key,
key_location_callback_type result_callback ) -> bool
overridevirtual

Returns the shard ID responsible for the given key.

Calls the callback before returning.

Parameters
keykey to locate.
result_callbackfunction to call with key location.
Returns
true.

Implements cbdc::parsec::directory::interface.

Definition at line 11 of file directory/impl.cpp.


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