Documentation
¶
Index ¶
- func New(tableName, stateMachineDir string, fs vfs.FS, blockCache *pebble.Cache, ...) sm.CreateOnDiskStateMachineFunc
- type FSM
- func (p *FSM) Close() error
- func (p *FSM) Collect(ch chan<- prometheus.Metric)
- func (p *FSM) Describe(ch chan<- *prometheus.Desc)
- func (p *FSM) GetHash() (uint64, error)
- func (p *FSM) Lookup(l interface{}) (interface{}, error)
- func (p *FSM) Open(_ <-chan struct{}) (uint64, error)
- func (p *FSM) PrepareSnapshot() (interface{}, error)
- func (p *FSM) RecoverFromSnapshot(r io.Reader, stopc <-chan struct{}) error
- func (p *FSM) SaveSnapshot(ctx interface{}, w io.Writer, stopc <-chan struct{}) error
- func (p *FSM) Sync() error
- func (p *FSM) Update(updates []sm.Entry) ([]sm.Entry, error)
- type IndexResponse
- type IteratorRequest
- type LeaderIndexRequest
- type LocalIndexRequest
- type PathRequest
- type PathResponse
- type SnapshotRecoveryType
- type SnapshotRequest
- type SnapshotResponse
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(tableName, stateMachineDir string, fs vfs.FS, blockCache *pebble.Cache, tableCache *pebble.TableCache, srt SnapshotRecoveryType, af func(applied uint64)) sm.CreateOnDiskStateMachineFunc
Types ¶
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
FSM is a statemachine.IOnDiskStateMachine impl.
func (*FSM) Collect ¶
func (p *FSM) Collect(ch chan<- prometheus.Metric)
func (*FSM) Describe ¶
func (p *FSM) Describe(ch chan<- *prometheus.Desc)
func (*FSM) PrepareSnapshot ¶
PrepareSnapshot prepares the snapshot to be concurrently captured and streamed.
func (*FSM) RecoverFromSnapshot ¶
RecoverFromSnapshot recovers the state machine state from snapshot specified by the io.Reader object. The snapshot is recovered into a new DB first and then atomically swapped with the existing DB to complete the recovery.
func (*FSM) SaveSnapshot ¶
SaveSnapshot saves the state of the object to the provided io.Writer object.
type IteratorRequest ¶
type IteratorRequest struct {
RangeOp *regattapb.RequestOp_Range
}
IteratorRequest returns open pebble.Iterator it is an API consumer responsibility to close it.
type SnapshotRecoveryType ¶
type SnapshotRecoveryType uint8
const ( RecoveryTypeSnapshot SnapshotRecoveryType = iota RecoveryTypeCheckpoint )
type SnapshotRequest ¶
SnapshotRequest to write Command snapshot into provided writer.
type SnapshotResponse ¶
type SnapshotResponse struct {
Index uint64
}
SnapshotResponse returns local index to which the snapshot was created.
type UpdateResult ¶
type UpdateResult uint64
UpdateResult if operation succeeded or not, both values mean that operation finished, value just indicates with which result. You should always check for err from proposals to detect unfinished or failed operations.
const ( // ResultFailure failed to apply update. ResultFailure UpdateResult = iota // ResultSuccess applied update. ResultSuccess )