Documentation ¶
Index ¶
- Constants
- Variables
- type CommandType
- func (CommandType) Descriptor() protoreflect.EnumDescriptor
- func (x CommandType) Enum() *CommandType
- func (CommandType) EnumDescriptor() ([]byte, []int)deprecated
- func (x CommandType) Number() protoreflect.EnumNumber
- func (x CommandType) String() string
- func (CommandType) Type() protoreflect.EnumType
- 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 Get
- func (x *Get) DeepCopy(z *Get)
- func (*Get) Descriptor() ([]byte, []int)deprecated
- func (x *Get) GetKey() []byte
- func (x *Get) GetTxnID() int64
- func (x *Get) Marshal() ([]byte, error)
- func (*Get) ProtoMessage()
- func (x *Get) ProtoReflect() protoreflect.Message
- func (x *Get) Reset()
- func (x *Get) String() string
- func (x *Get) Unmarshal(b []byte) error
- 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 SnapshotBuilder
- 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) Apply(raftLog *raft.Log) interface{}
- func (fsm *Store) DB() *store.LocalDB
- func (fsm *Store) Restore(rd io.ReadCloser) error
- func (fsm *Store) SetCluster(c cluster.Cluster)
- func (fsm *Store) Shutdown()
- func (fsm *Store) Snapshot() (raft.FSMSnapshot, error)
- 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 StoreCommand
- func (x *StoreCommand) DeepCopy(z *StoreCommand)
- func (*StoreCommand) Descriptor() ([]byte, []int)deprecated
- func (x *StoreCommand) GetPayload() []byte
- func (x *StoreCommand) GetType() CommandType
- func (x *StoreCommand) Marshal() ([]byte, error)
- func (*StoreCommand) ProtoMessage()
- func (x *StoreCommand) ProtoReflect() protoreflect.Message
- func (x *StoreCommand) Reset()
- func (x *StoreCommand) String() string
- func (x *StoreCommand) Unmarshal(b []byte) 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{}) ([]byte, error)
- func (txn *Txn) Set(alloc *tools.Allocator, val []byte, keyParts ...interface{}) error
Constants ¶
View Source
const C_CommitTxn int64 = 15774688
View Source
const C_Delete int64 = 1035893169
View Source
const C_Get int64 = 3312871568
View Source
const C_Set int64 = 3730400060
View Source
const C_StartTxn int64 = 605208098
View Source
const C_StopTxn int64 = 1239816782
View Source
const C_StoreCommand int64 = 3294788005
Variables ¶
View Source
var ( ErrKeyNotFound = badger.ErrKeyNotFound DefaultIteratorOptions = badger.DefaultIteratorOptions )
View Source
var ( CommandType_name = map[int32]string{ 0: "CTStartTxn", 1: "CTStopTxn", 2: "CTCommitTxn", 3: "CTSet", 4: "CTDelete", 5: "CTGet", } CommandType_value = map[string]int32{ "CTStartTxn": 0, "CTStopTxn": 1, "CTCommitTxn": 2, "CTSet": 3, "CTDelete": 4, "CTGet": 5, } )
Enum value maps for CommandType.
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 PoolGet = poolGet{}
View Source
var PoolSet = poolSet{}
View Source
var PoolStartTxn = poolStartTxn{}
View Source
var PoolStopTxn = poolStopTxn{}
View Source
var PoolStoreCommand = poolStoreCommand{}
Functions ¶
This section is empty.
Types ¶
type CommandType ¶
type CommandType int32
StoreCommandType
const ( CommandType_CTStartTxn CommandType = 0 CommandType_CTStopTxn CommandType = 1 CommandType_CTCommitTxn CommandType = 2 CommandType_CTSet CommandType = 3 CommandType_CTDelete CommandType = 4 CommandType_CTGet CommandType = 5 )
func (CommandType) Descriptor ¶
func (CommandType) Descriptor() protoreflect.EnumDescriptor
func (CommandType) Enum ¶
func (x CommandType) Enum() *CommandType
func (CommandType) EnumDescriptor
deprecated
func (CommandType) EnumDescriptor() ([]byte, []int)
Deprecated: Use CommandType.Descriptor instead.
func (CommandType) Number ¶
func (x CommandType) Number() protoreflect.EnumNumber
func (CommandType) String ¶
func (x CommandType) String() string
func (CommandType) Type ¶
func (CommandType) Type() protoreflect.EnumType
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 { 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 Get ¶
type Get 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 (*Get) Descriptor
deprecated
func (*Get) ProtoMessage ¶
func (*Get) ProtoMessage()
func (*Get) ProtoReflect ¶
func (x *Get) 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 SnapshotBuilder ¶
type SnapshotBuilder struct{}
SnapshotBuilder is used for snapshot of Raft logs
func (SnapshotBuilder) Persist ¶
func (s SnapshotBuilder) Persist(sink raft.SnapshotSink) error
func (SnapshotBuilder) Release ¶
func (s SnapshotBuilder) Release()
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 ¶ added in v0.7.2
type StoreCommand ¶
type StoreCommand struct { Type CommandType `protobuf:"varint,1,opt,name=Type,proto3,enum=badgerRaft.CommandType" json:"Type,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"` // contains filtered or unexported fields }
RaftCommand
func (*StoreCommand) DeepCopy ¶
func (x *StoreCommand) DeepCopy(z *StoreCommand)
func (*StoreCommand) Descriptor
deprecated
func (*StoreCommand) Descriptor() ([]byte, []int)
Deprecated: Use StoreCommand.ProtoReflect.Descriptor instead.
func (*StoreCommand) GetPayload ¶
func (x *StoreCommand) GetPayload() []byte
func (*StoreCommand) GetType ¶
func (x *StoreCommand) GetType() CommandType
func (*StoreCommand) Marshal ¶
func (x *StoreCommand) Marshal() ([]byte, error)
func (*StoreCommand) ProtoMessage ¶
func (*StoreCommand) ProtoMessage()
func (*StoreCommand) ProtoReflect ¶
func (x *StoreCommand) ProtoReflect() protoreflect.Message
func (*StoreCommand) Reset ¶
func (x *StoreCommand) Reset()
func (*StoreCommand) String ¶
func (x *StoreCommand) String() string
func (*StoreCommand) Unmarshal ¶
func (x *StoreCommand) Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.