6#ifndef OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_STATE_MACHINE_H_
7#define OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_STATE_MACHINE_H_
13#include <libnuraft/nuraft.hxx>
25 auto commit(uint64_t log_idx, nuraft::buffer& data)
26 -> nuraft::ptr<nuraft::buffer>
override;
34 auto last_snapshot() -> nuraft::ptr<nuraft::snapshot>
override;
43 nuraft::async_result<bool>::handler_type& )
50 -> std::shared_ptr<replicated_shard>;
56 std::atomic<uint64_t> m_last_committed_idx{0};
58 std::shared_ptr<replicated_shard> m_shard{
59 std::make_shared<replicated_shard>()};
NuRaft state machine implementation for a runtime locking shard.
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.
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.
auto last_commit_index() -> uint64_t override
Returns the most recently committed log entry index.
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.
std::variant< replicated_prepare_request, commit_request, finish_request, replicated_get_tickets_request > replicated_request
Shard replicated state machine request type.
std::variant< replicated_shard_interface::return_type, replicated_shard_interface::get_tickets_return_type > replicated_response
Shard replicated state machine response type.