Documentation ¶
Index ¶
- Constants
- type CustomBuilder
- func (b *CustomBuilder) AppendCommit(key, value []byte, commitTS uint64)
- func (b *CustomBuilder) AppendLock(key, value []byte)
- func (b *CustomBuilder) AppendPessimisticRollback(key []byte)
- func (b *CustomBuilder) AppendRollback(key []byte, startTS uint64, deleteLock bool)
- func (b *CustomBuilder) Build() *CustomRaftLog
- func (b *CustomBuilder) GetType() CustomRaftLogType
- func (b *CustomBuilder) Len() int
- func (b *CustomBuilder) SetType(tp CustomRaftLogType)
- type CustomHeader
- type CustomRaftLog
- func (c *CustomRaftLog) Epoch() Epoch
- func (c *CustomRaftLog) GetRaftCmdRequest() *raft_cmdpb.RaftCmdRequest
- func (rl *CustomRaftLog) IterateCommit(itFunc func(key, val []byte, commitTS uint64))
- func (rl *CustomRaftLog) IterateLock(itFunc func(key, val []byte))
- func (rl *CustomRaftLog) IteratePessimisticRollback(itFunc func(key []byte))
- func (rl *CustomRaftLog) IterateRollback(itFunc func(key []byte, startTS uint64, deleteLock bool))
- func (c *CustomRaftLog) Marshal() []byte
- func (c *CustomRaftLog) PeerID() uint64
- func (c *CustomRaftLog) RegionID() uint64
- func (c *CustomRaftLog) StoreID() uint64
- func (c *CustomRaftLog) Term() uint64
- func (c *CustomRaftLog) Type() CustomRaftLogType
- type CustomRaftLogType
- type Epoch
- type RaftLog
- type RequestRaftLog
- func (r RequestRaftLog) Epoch() Epoch
- func (r RequestRaftLog) GetRaftCmdRequest() *raft_cmdpb.RaftCmdRequest
- func (r RequestRaftLog) Marshal() []byte
- func (r RequestRaftLog) PeerID() uint64
- func (r RequestRaftLog) RegionConfVer() uint64
- func (r RequestRaftLog) RegionID() uint64
- func (r RequestRaftLog) StoreID() uint64
- func (r RequestRaftLog) Term() uint64
Constants ¶
View Source
const ( CustomRaftLogFlag byte = 64 TypePrewrite CustomRaftLogType = 1 TypeCommit CustomRaftLogType = 2 TypeRolback CustomRaftLogType = 3 TypePessimisticLock CustomRaftLogType = 4 TypePessimisticRollback CustomRaftLogType = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomBuilder ¶
type CustomBuilder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(header CustomHeader) *CustomBuilder
func (*CustomBuilder) AppendCommit ¶
func (b *CustomBuilder) AppendCommit(key, value []byte, commitTS uint64)
func (*CustomBuilder) AppendLock ¶
func (b *CustomBuilder) AppendLock(key, value []byte)
func (*CustomBuilder) AppendPessimisticRollback ¶
func (b *CustomBuilder) AppendPessimisticRollback(key []byte)
func (*CustomBuilder) AppendRollback ¶
func (b *CustomBuilder) AppendRollback(key []byte, startTS uint64, deleteLock bool)
func (*CustomBuilder) Build ¶
func (b *CustomBuilder) Build() *CustomRaftLog
func (*CustomBuilder) GetType ¶
func (b *CustomBuilder) GetType() CustomRaftLogType
func (*CustomBuilder) Len ¶
func (b *CustomBuilder) Len() int
func (*CustomBuilder) SetType ¶
func (b *CustomBuilder) SetType(tp CustomRaftLogType)
type CustomHeader ¶
func (*CustomHeader) Marshal ¶
func (h *CustomHeader) Marshal() []byte
type CustomRaftLog ¶
type CustomRaftLog struct { Data []byte // contains filtered or unexported fields }
CustomRaftLog is the raft log format for unistore to store Prewrite/Commit/PessimisticLock.
| flag(1) | type(1) | version(2) | header(40) | entries
It reduces the cost of marshal/unmarshal and avoid DB lookup during apply.
func NewCustom ¶
func NewCustom(data []byte) *CustomRaftLog
func (*CustomRaftLog) Epoch ¶
func (c *CustomRaftLog) Epoch() Epoch
func (*CustomRaftLog) GetRaftCmdRequest ¶
func (c *CustomRaftLog) GetRaftCmdRequest() *raft_cmdpb.RaftCmdRequest
func (*CustomRaftLog) IterateCommit ¶
func (rl *CustomRaftLog) IterateCommit(itFunc func(key, val []byte, commitTS uint64))
func (*CustomRaftLog) IterateLock ¶
func (rl *CustomRaftLog) IterateLock(itFunc func(key, val []byte))
func (*CustomRaftLog) IteratePessimisticRollback ¶
func (rl *CustomRaftLog) IteratePessimisticRollback(itFunc func(key []byte))
func (*CustomRaftLog) IterateRollback ¶
func (rl *CustomRaftLog) IterateRollback(itFunc func(key []byte, startTS uint64, deleteLock bool))
func (*CustomRaftLog) Marshal ¶
func (c *CustomRaftLog) Marshal() []byte
func (*CustomRaftLog) PeerID ¶
func (c *CustomRaftLog) PeerID() uint64
func (*CustomRaftLog) RegionID ¶
func (c *CustomRaftLog) RegionID() uint64
func (*CustomRaftLog) StoreID ¶
func (c *CustomRaftLog) StoreID() uint64
func (*CustomRaftLog) Term ¶
func (c *CustomRaftLog) Term() uint64
func (*CustomRaftLog) Type ¶
func (c *CustomRaftLog) Type() CustomRaftLogType
type CustomRaftLogType ¶
type CustomRaftLogType byte
type RaftLog ¶
type RaftLog interface { RegionID() uint64 Epoch() Epoch PeerID() uint64 StoreID() uint64 Term() uint64 Marshal() []byte GetRaftCmdRequest() *raft_cmdpb.RaftCmdRequest }
func NewRequest ¶
func NewRequest(req *raft_cmdpb.RaftCmdRequest) RaftLog
type RequestRaftLog ¶
type RequestRaftLog struct {
*raft_cmdpb.RaftCmdRequest
}
func (RequestRaftLog) Epoch ¶
func (r RequestRaftLog) Epoch() Epoch
func (RequestRaftLog) GetRaftCmdRequest ¶
func (r RequestRaftLog) GetRaftCmdRequest() *raft_cmdpb.RaftCmdRequest
func (RequestRaftLog) Marshal ¶
func (r RequestRaftLog) Marshal() []byte
func (RequestRaftLog) PeerID ¶
func (r RequestRaftLog) PeerID() uint64
func (RequestRaftLog) RegionConfVer ¶
func (r RequestRaftLog) RegionConfVer() uint64
func (RequestRaftLog) RegionID ¶
func (r RequestRaftLog) RegionID() uint64
func (RequestRaftLog) StoreID ¶
func (r RequestRaftLog) StoreID() uint64
func (RequestRaftLog) Term ¶
func (r RequestRaftLog) Term() uint64
Click to show internal directories.
Click to hide internal directories.