6#ifndef OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_REPLICATED_SHARD_H_
7#define OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_REPLICATED_SHARD_H_
45 mutable std::mutex m_mut;
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::unordered_map< ticket_number_type, ticket_type > tickets_type
Type for the tickets list returned by the state machine.
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.
Implementation of the replicated shard interface.
auto get_tickets(get_tickets_callback_type result_callback) const -> bool override
Retrieves unfinished tickets from the state machine.
auto get_state() const -> state_type
Return the keys and values stored by the shard.
auto prepare(ticket_number_type ticket_number, broker_id_type broker_id, state_type state_update, callback_type result_callback) -> bool override
Stores a prepare request for a ticket in the state machine.
auto commit(ticket_number_type ticket_number, callback_type result_callback) -> bool override
Stores a commit request in the state machine.
auto finish(ticket_number_type ticket_number, callback_type result_callback) -> bool override
Stores a finish request in the state machine.
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.