Documentation
¶
Index ¶
- Constants
- Variables
- type CommitTxn
- func (x *CommitTxn) DeepCopy(z *CommitTxn)
- func (*CommitTxn) Descriptor() ([]byte, []int)deprecated
- func (x *CommitTxn) GetID() int64
- func (x *CommitTxn) Marshal() ([]byte, error)
- func (*CommitTxn) ProtoMessage()
- func (x *CommitTxn) ProtoReflect() protoreflect.Message
- func (x *CommitTxn) Reset()
- func (x *CommitTxn) String() string
- func (x *CommitTxn) Unmarshal(b []byte) error
- type Config
- type Delete
- func (x *Delete) DeepCopy(z *Delete)
- func (*Delete) Descriptor() ([]byte, []int)deprecated
- func (x *Delete) GetKey() []byte
- func (x *Delete) GetTxnID() int64
- func (x *Delete) Marshal() ([]byte, error)
- func (*Delete) ProtoMessage()
- func (x *Delete) ProtoReflect() protoreflect.Message
- func (x *Delete) Reset()
- func (x *Delete) String() string
- func (x *Delete) Unmarshal(b []byte) error
- type Entry
- type Set
- func (x *Set) DeepCopy(z *Set)
- func (*Set) Descriptor() ([]byte, []int)deprecated
- func (x *Set) GetKey() []byte
- func (x *Set) GetTxnID() int64
- func (x *Set) GetValue() []byte
- func (x *Set) Marshal() ([]byte, error)
- func (*Set) ProtoMessage()
- func (x *Set) ProtoReflect() protoreflect.Message
- func (x *Set) Reset()
- func (x *Set) String() string
- func (x *Set) Unmarshal(b []byte) error
- type StartTxn
- func (x *StartTxn) DeepCopy(z *StartTxn)
- func (*StartTxn) Descriptor() ([]byte, []int)deprecated
- func (x *StartTxn) GetID() int64
- func (x *StartTxn) GetUpdate() bool
- func (x *StartTxn) Marshal() ([]byte, error)
- func (*StartTxn) ProtoMessage()
- func (x *StartTxn) ProtoReflect() protoreflect.Message
- func (x *StartTxn) Reset()
- func (x *StartTxn) String() string
- func (x *StartTxn) Unmarshal(b []byte) error
- type StopTxn
- func (x *StopTxn) DeepCopy(z *StopTxn)
- func (*StopTxn) Descriptor() ([]byte, []int)deprecated
- func (x *StopTxn) GetCommit() bool
- func (x *StopTxn) GetID() int64
- func (x *StopTxn) Marshal() ([]byte, error)
- func (*StopTxn) ProtoMessage()
- func (x *StopTxn) ProtoReflect() protoreflect.Message
- func (x *StopTxn) Reset()
- func (x *StopTxn) String() string
- func (x *StopTxn) Unmarshal(b []byte) error
- type Store
- func (fsm *Store) DB() *store.LocalDB
- func (fsm *Store) OnJoin(hash uint64)
- func (fsm *Store) OnLeave(hash uint64)
- func (fsm *Store) SetCluster(c cluster.Cluster)
- func (fsm *Store) Shutdown()
- func (fsm *Store) Step(payload []byte)
- func (fsm *Store) Update(fn func(store.Txn) error) error
- func (fsm *Store) UpdateLocal(fn func(txn *store.LTxn) error) error
- func (fsm *Store) View(fn func(store.Txn) error) error
- func (fsm *Store) ViewLocal(fn func(txn *store.LTxn) error) error
- type Txn
- func (txn *Txn) Delete(alloc *tools.Allocator, keyParts ...interface{}) error
- func (txn *Txn) Exists(alloc *tools.Allocator, keyParts ...interface{}) bool
- func (txn *Txn) Get(alloc *tools.Allocator, keyParts ...interface{}) (v []byte, err error)
- func (txn *Txn) Set(alloc *tools.Allocator, val []byte, keyParts ...interface{}) error
Constants ¶
View Source
const ( ElectionTick = 10 HeartbeatTick = 1 ProposeTimeout = 5 * time.Second ProposeConfTimeout = 5 * time.Second )
View Source
const C_CommitTxn int64 = 15774688
View Source
const C_Delete int64 = 1035893169
View Source
const C_Set int64 = 3730400060
View Source
const C_StartTxn int64 = 605208098
View Source
const C_StopTxn int64 = 1239816782
Variables ¶
View Source
var ( ErrKeyNotFound = badger.ErrKeyNotFound DefaultIteratorOptions = badger.DefaultIteratorOptions )
View Source
var ( ErrDuplicateID = fmt.Errorf("duplicate id") ErrTxnNotFound = fmt.Errorf("txn not found") ErrUnknown = fmt.Errorf("unknown") )
View Source
var File_commands_proto protoreflect.FileDescriptor
View Source
var PoolCommitTxn = poolCommitTxn{}
View Source
var PoolDelete = poolDelete{}
View Source
var PoolSet = poolSet{}
View Source
var PoolStartTxn = poolStartTxn{}
View Source
var PoolStopTxn = poolStopTxn{}
Functions ¶
This section is empty.
Types ¶
type CommitTxn ¶
type CommitTxn struct {
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
// contains filtered or unexported fields
}
func (*CommitTxn) Descriptor
deprecated
func (*CommitTxn) ProtoMessage ¶
func (*CommitTxn) ProtoMessage()
func (*CommitTxn) ProtoReflect ¶
func (x *CommitTxn) ProtoReflect() protoreflect.Message
type Config ¶
type Config struct {
Cluster cluster.Cluster
DirPath string
ConflictRetries int
ConflictMaxInterval time.Duration
BatchWorkers int
BatchSize int
}
func DefaultConfig ¶
type Delete ¶
type Delete struct {
TxnID int64 `protobuf:"varint,1,opt,name=TxnID,proto3" json:"TxnID,omitempty"`
Key []byte `protobuf:"bytes,2,opt,name=Key,proto3" json:"Key,omitempty"`
// contains filtered or unexported fields
}
func (*Delete) Descriptor
deprecated
func (*Delete) ProtoMessage ¶
func (*Delete) ProtoMessage()
func (*Delete) ProtoReflect ¶
func (x *Delete) ProtoReflect() protoreflect.Message
type Set ¶
type Set struct {
TxnID int64 `protobuf:"varint,1,opt,name=TxnID,proto3" json:"TxnID,omitempty"`
Key []byte `protobuf:"bytes,2,opt,name=Key,proto3" json:"Key,omitempty"`
Value []byte `protobuf:"bytes,3,opt,name=Value,proto3" json:"Value,omitempty"`
// contains filtered or unexported fields
}
func (*Set) Descriptor
deprecated
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) ProtoReflect() protoreflect.Message
type StartTxn ¶
type StartTxn struct {
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Update bool `protobuf:"varint,2,opt,name=Update,proto3" json:"Update,omitempty"`
// contains filtered or unexported fields
}
func (*StartTxn) Descriptor
deprecated
func (*StartTxn) ProtoMessage ¶
func (*StartTxn) ProtoMessage()
func (*StartTxn) ProtoReflect ¶
func (x *StartTxn) ProtoReflect() protoreflect.Message
type StopTxn ¶
type StopTxn struct {
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Commit bool `protobuf:"varint,2,opt,name=Commit,proto3" json:"Commit,omitempty"`
// contains filtered or unexported fields
}
func (*StopTxn) Descriptor
deprecated
func (*StopTxn) ProtoMessage ¶
func (*StopTxn) ProtoMessage()
func (*StopTxn) ProtoReflect ¶
func (x *StopTxn) ProtoReflect() protoreflect.Message
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the finite state machine which will be used when Raft is enabled.
func (*Store) SetCluster ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.