Documentation ¶
Index ¶
- type Cfg
- type ContainerAdapter
- func (c *ContainerAdapter) Clone() prophet.Container
- func (c *ContainerAdapter) ID() uint64
- func (c *ContainerAdapter) Lables() []prophet.Pair
- func (c *ContainerAdapter) Marshal() ([]byte, error)
- func (c *ContainerAdapter) State() prophet.State
- func (c *ContainerAdapter) Unmarshal(data []byte) error
- type Option
- func WithApplyWorkerCount(value uint64) Option
- func WithDBHBInterval(value time.Duration) Option
- func WithDim(value int) Option
- func WithDistThr(value float32) Option
- func WithElectionTick(value int) Option
- func WithFlatThr(value int) Option
- func WithHeartbeatTick(value int) Option
- func WithLabel(key, value string) Option
- func WithLimitRebuildIndex(value int) Option
- func WithLimitSnapChunkBytes(value uint64) Option
- func WithLimitSnapChunkRate(value int) Option
- func WithMQ(topic, groupPrefix string, mqAddrs []string) Option
- func WithMaxBatchingSize(value int) Option
- func WithMaxDBRecords(value uint64) Option
- func WithMaxInflightMsgs(value int) Option
- func WithMaxPeerDownTime(value time.Duration) Option
- func WithMaxRaftEntryBytes(value uint64) Option
- func WithMaxRaftLogBytes(value uint64) Option
- func WithMaxRaftLogCount(value uint64) Option
- func WithMaxRaftLogLag(value uint64) Option
- func WithMaxSizePerMsg(value uint64) Option
- func WithMinRaftLogCount(value uint64) Option
- func WithProphetAddr(addr string) Option
- func WithProphetName(name string) Option
- func WithProphetOption(opt prophet.Option) Option
- func WithRaftCheckSplitDuration(value time.Duration) Option
- func WithRaftLogCompactDuration(value time.Duration) Option
- func WithRaftTickDuration(value time.Duration) Option
- func WithRebuildIndexDuration(value time.Duration) Option
- func WithSentRaftWorkerCount(value uint64) Option
- func WithSentSnapWorkerCount(value uint64) Option
- func WithStoreDataPath(path string) Option
- func WithStoreHBInterval(value time.Duration) Option
- func WithStoreOptionsPath(path string) Option
- func WithSyncWrite(value bool) Option
- type PeerReplicate
- type ProphetAdapter
- func (pa *ProphetAdapter) ChangeLeader(resourceID uint64, newLeader *prophet.Peer)
- func (pa *ProphetAdapter) ChangePeer(resourceID uint64, peer *prophet.Peer, changeType prophet.ChangePeerType)
- func (pa *ProphetAdapter) ContainerHBInterval() time.Duration
- func (pa *ProphetAdapter) FetchContainerHB() *prophet.ContainerHeartbeatReq
- func (pa *ProphetAdapter) FetchLeaderResources() []uint64
- func (pa *ProphetAdapter) FetchResourceHB(id uint64) *prophet.ResourceHeartbeatReq
- func (pa *ProphetAdapter) HBHandler() prophet.HeartbeatHandler
- func (pa *ProphetAdapter) NewContainer() prophet.Container
- func (pa *ProphetAdapter) NewResource() prophet.Resource
- func (pa *ProphetAdapter) ResourceHBInterval() time.Duration
- type ResourceAdapter
- func (r *ResourceAdapter) Changed(other prophet.Resource) bool
- func (r *ResourceAdapter) Clone() prophet.Resource
- func (r *ResourceAdapter) ID() uint64
- func (r *ResourceAdapter) Marshal() ([]byte, error)
- func (r *ResourceAdapter) Peers() []*prophet.Peer
- func (r *ResourceAdapter) SetPeers(peers []*prophet.Peer)
- func (r *ResourceAdapter) Stale(other prophet.Resource) bool
- func (r *ResourceAdapter) Unmarshal(data []byte) error
- type SnapshotManager
- type Store
- func (s *Store) BecomeFollower()
- func (s *Store) BecomeLeader()
- func (s *Store) HandleInsert(req *rpc.InsertRequest, cb func(interface{}))
- func (s *Store) HandleSearch(req *rpc.SearchRequest, cb func(interface{}))
- func (s *Store) HandleUpdate(req *rpc.UpdateRequest, cb func(interface{}))
- func (s *Store) Start()
- func (s *Store) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cfg ¶
type Cfg struct { DataPath string StoreOptionsPath string Lables []meta.Label ProphetName string ProphetAddr string ProphetOptions []prophet.Option // about raft ElectionTick int HeartbeatTick int MaxSizePerMsg uint64 MaxInflightMsgs int MinRaftLogCount uint64 MaxRaftLogCount uint64 MaxRaftLogBytes uint64 MaxRaftLogLag uint64 MaxRaftEntryBytes uint64 MaxPeerDownTime time.Duration RaftTickDuration time.Duration RaftLogCompactDuration time.Duration RaftCheckSplitDuration time.Duration SyncWrite bool // about batching MaxBatchingSize int // about db MaxDBRecords uint64 // about worker ApplyWorkerCount uint64 SentRaftWorkerCount uint64 SentSnapWorkerCount uint64 // about snapshot LimitSnapChunkRate int LimitSnapChunkBytes uint64 // about prophet DBHBInterval time.Duration StoreHBInterval time.Duration // about vectordb Dim int FlatThr int DistThr float32 LimitRebuildIndex int RebuildIndexDuration time.Duration // about mq Topic, GroupPrefix string MQAddrs []string }
Cfg raftstore configuration
type ContainerAdapter ¶
type ContainerAdapter struct {
// contains filtered or unexported fields
}
ContainerAdapter adapter for prophet's container and store
func (*ContainerAdapter) Clone ¶
func (c *ContainerAdapter) Clone() prophet.Container
Clone adapter prophet
func (*ContainerAdapter) Lables ¶
func (c *ContainerAdapter) Lables() []prophet.Pair
Lables adapter prophet
func (*ContainerAdapter) Marshal ¶
func (c *ContainerAdapter) Marshal() ([]byte, error)
Marshal adapter prophet
func (*ContainerAdapter) State ¶
func (c *ContainerAdapter) State() prophet.State
State adapter prophet
func (*ContainerAdapter) Unmarshal ¶
func (c *ContainerAdapter) Unmarshal(data []byte) error
Unmarshal adapter prophet
type Option ¶
type Option func(*options)
Option raftstore option
func WithApplyWorkerCount ¶
WithApplyWorkerCount set ApplyWorkerCount
func WithDBHBInterval ¶
WithDBHBInterval set DBHBInterval
func WithHeartbeatTick ¶
WithHeartbeatTick set HeartbeatTick
func WithLimitRebuildIndex ¶
WithLimitRebuildIndex set LimitRebuildIndex
func WithLimitSnapChunkBytes ¶
WithLimitSnapChunkBytes set LimitSnapChunkBytes
func WithLimitSnapChunkRate ¶
WithLimitSnapChunkRate set LimitSnapChunkRate
func WithMaxBatchingSize ¶
WithMaxBatchingSize set MaxBatchingSize
func WithMaxDBRecords ¶
WithMaxDBRecords set MaxDBRecords
func WithMaxInflightMsgs ¶
WithMaxInflightMsgs set MaxInflightMsgs
func WithMaxPeerDownTime ¶
WithMaxPeerDownTime set MaxPeerDownTime
func WithMaxRaftEntryBytes ¶
WithMaxRaftEntryBytes set MaxRaftEntryBytes
func WithMaxRaftLogBytes ¶
WithMaxRaftLogBytes set MaxRaftLogBytes
func WithMaxRaftLogCount ¶
WithMaxRaftLogCount set MaxRaftLogCount
func WithMaxRaftLogLag ¶
WithMaxRaftLogLag set MaxRaftLogLag
func WithMaxSizePerMsg ¶
WithMaxSizePerMsg set MaxSizePerMsg
func WithMinRaftLogCount ¶
WithMinRaftLogCount set MinRaftLogCount
func WithProphetOption ¶
WithProphetOption append a prophet option
func WithRaftCheckSplitDuration ¶
WithRaftCheckSplitDuration set RaftCheckSplitDuration
func WithRaftLogCompactDuration ¶
WithRaftLogCompactDuration set RaftLogCompactDuration
func WithRaftTickDuration ¶
WithRaftTickDuration set RaftTickDuration
func WithRebuildIndexDuration ¶
WithRebuildIndexDuration set RebuildIndexDuration
func WithSentRaftWorkerCount ¶
WithSentRaftWorkerCount set SentRaftWorkerCount
func WithSentSnapWorkerCount ¶
WithSentSnapWorkerCount set SentSnapWorkerCount
func WithStoreDataPath ¶
WithStoreDataPath set raftstore storage data path
func WithStoreHBInterval ¶
WithStoreHBInterval set StoreHBInterval
func WithStoreOptionsPath ¶
WithStoreOptionsPath set raftstore storage option path
type PeerReplicate ¶
type PeerReplicate struct {
// contains filtered or unexported fields
}
PeerReplicate is the db's peer replicate. Every db replicate has a PeerReplicate.
type ProphetAdapter ¶
type ProphetAdapter struct {
// contains filtered or unexported fields
}
ProphetAdapter adapter prophet
func (*ProphetAdapter) ChangeLeader ¶
func (pa *ProphetAdapter) ChangeLeader(resourceID uint64, newLeader *prophet.Peer)
ChangeLeader prophet adapter
func (*ProphetAdapter) ChangePeer ¶
func (pa *ProphetAdapter) ChangePeer(resourceID uint64, peer *prophet.Peer, changeType prophet.ChangePeerType)
ChangePeer prophet adapter
func (*ProphetAdapter) ContainerHBInterval ¶
func (pa *ProphetAdapter) ContainerHBInterval() time.Duration
ContainerHBInterval fetch container HB interface
func (*ProphetAdapter) FetchContainerHB ¶
func (pa *ProphetAdapter) FetchContainerHB() *prophet.ContainerHeartbeatReq
FetchContainerHB fetch container HB
func (*ProphetAdapter) FetchLeaderResources ¶
func (pa *ProphetAdapter) FetchLeaderResources() []uint64
FetchLeaderResources fetch all local leader resources
func (*ProphetAdapter) FetchResourceHB ¶
func (pa *ProphetAdapter) FetchResourceHB(id uint64) *prophet.ResourceHeartbeatReq
FetchResourceHB fetch resource HB
func (*ProphetAdapter) HBHandler ¶
func (pa *ProphetAdapter) HBHandler() prophet.HeartbeatHandler
HBHandler HB hander
func (*ProphetAdapter) NewContainer ¶
func (pa *ProphetAdapter) NewContainer() prophet.Container
NewContainer return a new container
func (*ProphetAdapter) NewResource ¶
func (pa *ProphetAdapter) NewResource() prophet.Resource
NewResource return a new resource
func (*ProphetAdapter) ResourceHBInterval ¶
func (pa *ProphetAdapter) ResourceHBInterval() time.Duration
ResourceHBInterval fetch resource HB interface
type ResourceAdapter ¶
type ResourceAdapter struct {
// contains filtered or unexported fields
}
ResourceAdapter adapter for prophet's resource and db
func (*ResourceAdapter) Changed ¶
func (r *ResourceAdapter) Changed(other prophet.Resource) bool
Changed adapter prophet
func (*ResourceAdapter) Clone ¶
func (r *ResourceAdapter) Clone() prophet.Resource
Clone adapter prophet
func (*ResourceAdapter) Marshal ¶
func (r *ResourceAdapter) Marshal() ([]byte, error)
Marshal adapter prophet
func (*ResourceAdapter) Peers ¶
func (r *ResourceAdapter) Peers() []*prophet.Peer
Peers adapter prophet
func (*ResourceAdapter) SetPeers ¶
func (r *ResourceAdapter) SetPeers(peers []*prophet.Peer)
SetPeers adapter prophet
func (*ResourceAdapter) Stale ¶
func (r *ResourceAdapter) Stale(other prophet.Resource) bool
Stale adapter prophet
func (*ResourceAdapter) Unmarshal ¶
func (r *ResourceAdapter) Unmarshal(data []byte) error
Unmarshal adapter prophet
type SnapshotManager ¶
type SnapshotManager interface { Register(msg *raftpb.SnapshotMessage, step int) bool Deregister(msg *raftpb.SnapshotMessage, step int) Create(msg *raftpb.SnapshotMessage) error Exists(msg *raftpb.SnapshotMessage) bool WriteTo(msg *raftpb.SnapshotMessage, conn goetty.IOSession) (uint64, error) CleanSnap(msg *raftpb.SnapshotMessage) error ReceiveSnapData(msg *raftpb.SnapshotMessage) error Apply(msg *raftpb.SnapshotMessage) error }
SnapshotManager manager snapshot
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manager local raft groups
func NewStoreWithCfg ¶
NewStoreWithCfg returns store with cfg
func (*Store) BecomeFollower ¶
func (s *Store) BecomeFollower()
BecomeFollower this node is become prophet follower
func (*Store) BecomeLeader ¶
func (s *Store) BecomeLeader()
BecomeLeader this node is become prophet leader
func (*Store) HandleInsert ¶
func (s *Store) HandleInsert(req *rpc.InsertRequest, cb func(interface{}))
HandleInsert handle insert request
func (*Store) HandleSearch ¶
func (s *Store) HandleSearch(req *rpc.SearchRequest, cb func(interface{}))
HandleSearch handle search request
func (*Store) HandleUpdate ¶
func (s *Store) HandleUpdate(req *rpc.UpdateRequest, cb func(interface{}))
HandleUpdate handle update request