Documentation ¶
Index ¶
- Variables
- func LeaderID(ballot int) ids.ID
- func NewStat() *keystat
- func NextBallot(ballot int, id ids.ID) int
- type Accept
- type AcceptTX
- type Accepted
- type AcceptedTX
- type Ballot
- type CommandBallot
- type Commit
- type CommitTX
- type Exec
- type GossipBalance
- type LeaderChange
- type Paxos
- func (p *Paxos) AddRequest(req fleetdb.Request)
- func (p *Paxos) Ballot() Ballot
- func (p *Paxos) Exec()
- func (p *Paxos) ExecTXCmd() kv_store.Value
- func (p *Paxos) GetAccessToken() bool
- func (p *Paxos) HandleP1a(m Prepare)
- func (p *Paxos) HandleP1b(m Promise)
- func (p *Paxos) HandleP2a(m Accept)
- func (p *Paxos) HandleP2b(m Accepted) bool
- func (p *Paxos) HandleP2bTX(m Accepted) int
- func (p *Paxos) HandleP3(m Commit)
- func (p *Paxos) HandleRequest(r fleetdb.Request)
- func (p *Paxos) HasTXLease(txtime int64) bool
- func (p *Paxos) IsLeader() bool
- func (p *Paxos) Leader() ids.ID
- func (p *Paxos) P1a()
- func (p *Paxos) P1aNoBallotIncrease()
- func (p *Paxos) P1aRetry(try int)
- func (p *Paxos) P1aTX(t int64)
- func (p *Paxos) P2a(r *fleetdb.Request)
- func (p *Paxos) P2aFillSlot(cmd kv_store.Command, req *fleetdb.Request, tx *fleetdb.Transaction)
- func (p *Paxos) ProcessP2a(m Accept, tx *fleetdb.Transaction)
- func (p *Paxos) ReleaseAccessToken()
- func (p *Paxos) SlotNOOP(slot int)
- func (p *Paxos) SlotNum() int
- type Prepare
- type Promise
- type Quorum
- func (q *Quorum) ACK(id ids.ID)
- func (q *Quorum) ADD()
- func (q *Quorum) AllZones() bool
- func (q *Quorum) FGridQ1() bool
- func (q *Quorum) FGridQ2() bool
- func (q *Quorum) FastPath() bool
- func (q *Quorum) FastQuorum() bool
- func (q *Quorum) GridColumn() bool
- func (q *Quorum) GridRow() bool
- func (q *Quorum) Majority() bool
- func (q *Quorum) NACK(id ids.ID)
- func (q *Quorum) Q1() bool
- func (q *Quorum) Q2() bool
- func (q *Quorum) Reset()
- func (q *Quorum) Size() int
- func (q *Quorum) ZoneMajority() bool
- type Replica
- func (r *Replica) CountKeys() int
- func (r *Replica) ExecTx(tx *fleetdb.Transaction)
- func (r *Replica) GetPaxos(key kv_store.Key, table string) *Paxos
- func (r *Replica) GetPaxosByCmd(cmd kv_store.Command) *Paxos
- func (r *Replica) GetTX(txid ids.TXID) *fleetdb.Transaction
- func (r *Replica) GetTable(tableName string) *Table
- func (r *Replica) HandlePrepare(m Prepare)
- func (r *Replica) HandleRequest(m fleetdb.Request)
- func (r *Replica) HandleTransaction(m fleetdb.Transaction)
- type Table
- func (t *Table) CountKeys() int
- func (t *Table) FindLeastUsedKey() kv_store.Key
- func (t *Table) GetPaxos(key kv_store.Key) *Paxos
- func (t *Table) HitKey(key kv_store.Key, clientID ids.ID, timestamp int64) ids.ID
- func (t *Table) Init(key kv_store.Key, r *Replica)
- func (t *Table) InitStat(key kv_store.Key)
- func (t *Table) MarkKeyEvicting(k kv_store.Key)
- func (t *Table) RemoveStats(key kv_store.Key)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NumZones total number of sites NumZones int // NumNodes total number of nodes NumNodes int // NumLocalNodes number of nodes per site NumLocalNodes int // F number of zone failures F int // QuorumType name of the quorums QuorumType string )
View Source
var (
ErrTXPreempted = errors.New("TX was preempted before issuing a lease")
)
View Source
var (
Migration_majority float64
)
View Source
var (
NANOSECONDS_PER_SECOND = int64(1000000000)
)
Functions ¶
Types ¶
type Accept ¶
type Accept struct { Ballot Ballot Slot int EpochSlot int Command kv_store.Command // contains filtered or unexported fields }
Accept phase 2a
type Accepted ¶
type Accepted struct { Table string Key kv_store.Key Ballot Ballot ID ids.ID // from node id Slot int }
Accepted phase 2b
type Ballot ¶
type Ballot uint64
type CommandBallot ¶
type CommandBallot struct { Command kv_store.Command Ballot Ballot Executed bool Committed bool HasTx bool Tx fleetdb.Transaction }
func (CommandBallot) String ¶
func (cb CommandBallot) String() string
type GossipBalance ¶
type GossipBalance struct {
Items int64
}
func (GossipBalance) String ¶
func (gb GossipBalance) String() string
type LeaderChange ¶
LeaderChange switch leader
func (LeaderChange) String ¶
func (l LeaderChange) String() string
type Paxos ¶
type Paxos struct { fleetdb.Node Table *string Key kv_store.Key Active bool // Active leader Try int //Try Number for P1a Token chan bool // contains filtered or unexported fields }
Paxos instance
func (*Paxos) AddRequest ¶
func (*Paxos) GetAccessToken ¶
func (*Paxos) HandleP2bTX ¶
func (*Paxos) HandleRequest ¶
HandleRequest handles request and start phase 1 or phase 2
func (*Paxos) HasTXLease ¶
func (*Paxos) P1aNoBallotIncrease ¶
func (p *Paxos) P1aNoBallotIncrease()
P1a starts phase 1 prepare
func (*Paxos) P2aFillSlot ¶
func (*Paxos) ProcessP2a ¶
func (p *Paxos) ProcessP2a(m Accept, tx *fleetdb.Transaction)
func (*Paxos) ReleaseAccessToken ¶
func (p *Paxos) ReleaseAccessToken()
type Prepare ¶
type Prepare struct { Key kv_store.Key Table string Ballot Ballot Try int // contains filtered or unexported fields }
Prepare phase 1a
type Promise ¶
type Promise struct { Key kv_store.Key Table string Ballot Ballot ID ids.ID // from node id LPF bool //Lease Promise Failure Try int Log map[int]CommandBallot // log since last execute (includes last execute) }
Promise phase 1b
type Quorum ¶
type Quorum struct {
// contains filtered or unexported fields
}
func (*Quorum) FastQuorum ¶
func (*Quorum) GridColumn ¶
func (*Quorum) ZoneMajority ¶
type Replica ¶
func NewReplica ¶
func NewReplica() *Replica
func (*Replica) ExecTx ¶
func (r *Replica) ExecTx(tx *fleetdb.Transaction)
func (*Replica) HandleTransaction ¶
func (r *Replica) HandleTransaction(m fleetdb.Transaction)
---------------------------------------------------------------------- * * Transactions * * ---------------------------------------------------------------------
type Table ¶
func (*Table) FindLeastUsedKey ¶
func (*Table) MarkKeyEvicting ¶
func (*Table) RemoveStats ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.