OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::parsec::runtime_locking_shard::state_machine Class Reference

NuRaft state machine implementation for a runtime locking shard. More...

#include <state_machine.hpp>

Inheritance diagram for cbdc::parsec::runtime_locking_shard::state_machine:
Collaboration diagram for cbdc::parsec::runtime_locking_shard::state_machine:

Public Member Functions

auto commit (uint64_t log_idx, nuraft::buffer &data) -> nuraft::ptr< nuraft::buffer > override
 Commit the given raft log entry at the given log index, and return the result.
 
auto apply_snapshot (nuraft::snapshot &) -> bool override
 Not implemented for runtime locking shard.
 
auto last_snapshot () -> nuraft::ptr< nuraft::snapshot > override
 Not implemented for runtime locking shard.
 
auto last_commit_index () -> uint64_t override
 Returns the most recently committed log entry index.
 
void create_snapshot (nuraft::snapshot &, nuraft::async_result< bool >::handler_type &) override
 Not implemented for runtime locking shard.
 
auto get_shard () const -> std::shared_ptr< replicated_shard >
 Returns the replicated shard implementation managed by the state machine.
 

Detailed Description

NuRaft state machine implementation for a runtime locking shard.

Definition at line 17 of file parsec/runtime_locking_shard/state_machine.hpp.

Member Function Documentation

◆ apply_snapshot()

auto cbdc::parsec::runtime_locking_shard::state_machine::apply_snapshot ( nuraft::snapshot & ) -> bool
override

Not implemented for runtime locking shard.

Returns
false.

Definition at line 36 of file parsec/runtime_locking_shard/state_machine.cpp.

◆ commit()

auto cbdc::parsec::runtime_locking_shard::state_machine::commit ( uint64_t log_idx,
nuraft::buffer & data ) -> nuraft::ptr<nuraft::buffer>
override

Commit the given raft log entry at the given log index, and return the result.

Parameters
log_idxraft log index of the log entry.
dataserialized RPC request.
Returns
serialized RPC response or nullptr if there was an error processing the request.

Definition at line 15 of file parsec/runtime_locking_shard/state_machine.cpp.

References cbdc::from_buffer(), and cbdc::make_buffer().

Here is the call graph for this function:

◆ create_snapshot()

void cbdc::parsec::runtime_locking_shard::state_machine::create_snapshot ( nuraft::snapshot & ,
nuraft::async_result< bool >::handler_type & when_done )
override

Not implemented for runtime locking shard.

Definition at line 48 of file parsec/runtime_locking_shard/state_machine.cpp.

◆ get_shard()

auto cbdc::parsec::runtime_locking_shard::state_machine::get_shard ( ) const -> std::shared_ptr<replicated_shard>
nodiscard

Returns the replicated shard implementation managed by the state machine.

Returns
pointer to the shard implementation.

Definition at line 96 of file parsec/runtime_locking_shard/state_machine.cpp.

◆ last_commit_index()

auto cbdc::parsec::runtime_locking_shard::state_machine::last_commit_index ( ) -> uint64_t
override

Returns the most recently committed log entry index.

Returns
log entry index.

Definition at line 44 of file parsec/runtime_locking_shard/state_machine.cpp.

◆ last_snapshot()

auto cbdc::parsec::runtime_locking_shard::state_machine::last_snapshot ( ) -> nuraft::ptr<nuraft::snapshot>
override

Not implemented for runtime locking shard.

Returns
nullptr.

Definition at line 40 of file parsec/runtime_locking_shard/state_machine.cpp.


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