package cindex
import "go.etcd.io/etcd/server/v3/etcdserver/cindex"
Package cindex provides an interface and implementation for getting/saving consistentIndex.
Index ¶
- func UpdateConsistentIndexForce(tx backend.BatchTx, index uint64, term uint64)
- type Backend
- type ConsistentIndexer
Functions ¶
func UpdateConsistentIndexForce ¶
Types ¶
type Backend ¶
type ConsistentIndexer ¶
type ConsistentIndexer interface {
// ConsistentIndex returns the consistent index of current executing entry.
ConsistentIndex() uint64
// ConsistentApplyingIndex returns the consistent applying index of current executing entry.
ConsistentApplyingIndex() (uint64, uint64)
// UnsafeConsistentIndex is similar to ConsistentIndex, but it doesn't lock the transaction.
UnsafeConsistentIndex() uint64
// SetConsistentIndex set the consistent index of current executing entry.
SetConsistentIndex(v uint64, term uint64)
// SetConsistentApplyingIndex set the consistent applying index of current executing entry.
SetConsistentApplyingIndex(v uint64, term uint64)
// UnsafeSave must be called holding the lock on the tx.
// It saves consistentIndex to the underlying stable storage.
UnsafeSave(tx backend.UnsafeReadWriter)
// SetBackend set the available backend.BatchTx for ConsistentIndexer.
SetBackend(be Backend)
}
ConsistentIndexer is an interface that wraps the Get/Set/Save method for consistentIndex.
func NewConsistentIndex ¶
func NewConsistentIndex(be Backend) ConsistentIndexer
NewConsistentIndex creates a new consistent index. If `be` is nil, it must be set (SetBackend) before first access using `ConsistentIndex()`.
func NewFakeConsistentIndex ¶
func NewFakeConsistentIndex(index uint64) ConsistentIndexer
Source Files ¶
cindex.go doc.go
- Version
- v3.6.10 (latest)
- Published
- Apr 1, 2026
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 2 weeks ago –
Tools for package owners.