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

Namespaces

namespace  rpc
 

Data Structures

class  controller
 Manages a replicated runtime locking shard using Raft. More...
 
class  impl
 Implementation of a runtime locking shard. More...
 
class  interface
 Interface for a runtime locking shard. More...
 
class  replicated_shard
 Implementation of the replicated shard interface. More...
 
class  replicated_shard_client
 Client for asynchronously interacting with a raft replicated shard on the leader node of the cluster. More...
 
class  replicated_shard_interface
 Interface for replicating internal state for prepared and committed tickets managed by a locking shard. More...
 
struct  shard_error
 
class  state_machine
 NuRaft state machine implementation for a runtime locking shard. More...
 
struct  wounded_details
 Details about wounded error code. More...
 

Typedefs

using ticket_number_type = parsec::ticket_machine::ticket_number_type
 Type for a ticket number.
 
using key_type = buffer
 Type for keys held by shards.
 
using value_type = buffer
 Type for values held by shards.
 
using broker_id_type = size_t
 Type for the ID of a broker.
 
using state_update_type
 Type for state updates to a shard. A map of keys and their new values.
 

Enumerations

enum class  lock_type : uint8_t { read = 0 , write = 1 }
 Types of key lock supported by shards. More...
 
enum class  error_code : uint8_t {
  prepared , wounded , lock_held , lock_queued ,
  unknown_ticket , lock_not_held , state_update_with_read_lock , not_prepared ,
  committed , not_committed , internal_error
}
 Error codes returned by methods on shards. More...
 
enum class  ticket_state : uint8_t { begun , wounded , prepared , committed }
 Ticket states returned by shards for broker recovery purposes. More...
 

Typedef Documentation

◆ broker_id_type

Type for the ID of a broker.

Definition at line 24 of file parsec/runtime_locking_shard/interface.hpp.

◆ key_type

Type for keys held by shards.

Definition at line 20 of file parsec/runtime_locking_shard/interface.hpp.

◆ state_update_type

Initial value:
std::
unordered_map<key_type, value_type, hashing::const_sip_hash<key_type>>

Type for state updates to a shard. A map of keys and their new values.

Definition at line 27 of file parsec/runtime_locking_shard/interface.hpp.

◆ ticket_number_type

◆ value_type

Type for values held by shards.

Definition at line 22 of file parsec/runtime_locking_shard/interface.hpp.

Enumeration Type Documentation

◆ error_code

Error codes returned by methods on shards.

Enumerator
prepared 

Request invalid because ticket is in the prepared state.

wounded 

Request invalid because ticket is in the wounded state.

lock_held 

The ticket already holds the requested lock.

lock_queued 

The requested lock is already queued for the given ticket.

unknown_ticket 

The given ticket number is not known to this shard.

lock_not_held 

Cannot apply requested state update because the ticket does not hold a write lock on the given key.

state_update_with_read_lock 

Cannot apply requested state update because the ticket only holds a read lock on the given key.

not_prepared 

Cannot commit the ticket because the ticket has not been prepared.

committed 

Request invalid because ticket is in the committed state.

not_committed 

Request invalid because ticket is not in the committed state.

internal_error 

Request failed because of a transient internal error.

Definition at line 39 of file parsec/runtime_locking_shard/interface.hpp.

◆ lock_type

Types of key lock supported by shards.

Enumerator
read 

Read lock. Multiple readers can hold a lock for the same key.

write 

Write lock. Only one ticket can hold this lock at a time.

Definition at line 31 of file parsec/runtime_locking_shard/interface.hpp.

◆ ticket_state

Ticket states returned by shards for broker recovery purposes.

Enumerator
begun 

Begun, may still hold locks or be rolled-back.

wounded 

Wounded, not holding any locks.

prepared 

Prepared, holds locks.

committed 

Committed, not holding any locks.

Definition at line 85 of file parsec/runtime_locking_shard/interface.hpp.