6#ifndef OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_REPLICATED_SHARD_CLIENT_H_
7#define OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_REPLICATED_SHARD_CLIENT_H_
21 std::shared_ptr<raft::node> raft_node);
61 std::shared_ptr<raft::node> m_raft;
63 auto replicate_request(
65 const std::function<
void(std::optional<rpc::replicated_response>)>&
66 result_callback)
const -> bool;
Client for asynchronously interacting with a raft replicated shard on the leader node of the cluster.
auto finish(ticket_number_type ticket_number, callback_type result_callback) -> bool override
Replicates a finish request in the state machine and returns the response via a callback function.
auto commit(ticket_number_type ticket_number, callback_type result_callback) -> bool override
Replicates a commit request in the state machine and returns the response via a callback function.
auto get_tickets(get_tickets_callback_type result_callback) const -> bool override
Replicates a get tickets request in the state machine and returns the response via a callback functio...
replicated_shard_client(std::shared_ptr< raft::node > raft_node)
Constructs a shard client.
auto prepare(ticket_number_type ticket_number, broker_id_type broker_id, state_type state_update, callback_type result_callback) -> bool override
Replicates a prepare request in the state machine and returns the response via a callback function.
Interface for replicating internal state for prepared and committed tickets managed by a locking shar...
std::function< void(get_tickets_return_type)> get_tickets_callback_type
Callback function type for the result of a get tickets operation.
std::function< void(return_type)> callback_type
Callback function type for the result of a prepare operation.
std::unordered_map< key_type, value_type, hashing::const_sip_hash< key_type > > state_type
Type for state updates to a shard.
std::variant< replicated_prepare_request, commit_request, finish_request, replicated_get_tickets_request > replicated_request
Shard replicated state machine request type.
parsec::ticket_machine::ticket_number_type ticket_number_type
Type for a ticket number.
size_t broker_id_type
Type for the ID of a broker.