6#ifndef OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_CLIENT_H_
7#define OPENCBDC_TX_SRC_PARSEC_RUNTIME_LOCKING_SHARD_CLIENT_H_
20 explicit client(std::vector<network::endpoint_t> endpoints);
90 std::unique_ptr<cbdc::rpc::tcp_client<request, response>> m_client;
Buffer to store and retrieve byte data.
Interface for a runtime locking shard.
std::function< void(prepare_return_type)> prepare_callback_type
Callback function type for the result of a prepare operation.
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(rollback_return_type)> rollback_callback_type
Callback function type for the result of a rollback operation.
std::function< void(finish_return_type)> finish_callback_type
Callback function type for the result of a finish operation.
std::function< void(try_lock_return_type)> try_lock_callback_type
Function type for try lock operation results.
std::function< void(commit_return_type)> commit_callback_type
Callback function type for the result of a commit operation.
RPC client for a runtime locking shard cluster.
~client() override=default
auto init() -> bool
Initializes the underlying TCP client.
auto prepare(ticket_number_type ticket_number, broker_id_type broker_id, state_update_type state_update, prepare_callback_type result_callback) -> bool override
Requests a prepare operation from the remote shard.
auto commit(ticket_number_type ticket_number, commit_callback_type result_callback) -> bool override
Requests a commit operation from the remote shard.
auto get_tickets(broker_id_type broker_id, get_tickets_callback_type result_callback) -> bool override
Requests a get tickets operation from the remote shard.
auto try_lock(ticket_number_type ticket_number, broker_id_type broker_id, key_type key, lock_type locktype, bool first_lock, try_lock_callback_type result_callback) -> bool override
Requests a try lock operation from the remote shard.
auto operator=(const client &) -> client &=delete
client(const client &)=delete
auto finish(ticket_number_type ticket_number, finish_callback_type result_callback) -> bool override
Requests a finish operation from the remote shard.
auto operator=(client &&) -> client &=delete
auto rollback(ticket_number_type ticket_number, rollback_callback_type result_callback) -> bool override
Requests a rollback operation from the remote shard.
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.
std:: unordered_map< key_type, value_type, hashing::const_sip_hash< key_type > > state_update_type
Type for state updates to a shard. A map of keys and their new values.
lock_type
Types of key lock supported by shards.