Documentation
¶
Index ¶
- Constants
- func DeleteCell(id uint64, wb storage.WriteBatch) error
- func GetMaxKey() []byte
- func GetMinKey() []byte
- func GetStoreIdentKey() []byte
- func HasOverlap(c1, c2 *metapb.Cell) bool
- func SaveCell(driver storage.Driver, cell metapb.Cell) error
- func StalEpoch(target, check metapb.CellEpoch) bool
- type CellSplits
- type Cfg
- type DocPtr
- type IndicesDiff
- type PeerReplicate
- type QueryRequestCb
- type QueryState
- type SnapshotManager
- type Store
- func (s *Store) GetID() uint64
- func (s *Store) GetMeta() metapb.Store
- func (s *Store) OnProxyReq(req *raftcmdpb.Request, cb func(*raftcmdpb.RaftCMDResponse)) error
- func (s *Store) OnRedisCommand(sessionID int64, cmdType raftcmdpb.CMDType, cmd redis.Command, ...) ([]byte, error)
- func (s *Store) SetKeyConvertFun(fn func([]byte, func([]byte) metapb.Cell) metapb.Cell)
- func (s *Store) Start()
- func (s *Store) Stop() error
Constants ¶
View Source
const ( IdxReqBatch = 100000 IdxSplitReqBatch = 10 )
Variables ¶
This section is empty.
Functions ¶
func DeleteCell ¶
func DeleteCell(id uint64, wb storage.WriteBatch) error
DeleteCell delete cell with state, raft state and apply state.
Types ¶
type CellSplits ¶
type CellSplits struct {
// contains filtered or unexported fields
}
CellSplits is splits observed at a single iteration
type Cfg ¶
type Cfg struct { Addr string DataPath string OptionPath string CellCapacity uint64 DurationHeartbeatStore time.Duration DurationHeartbeatCell time.Duration DurationSplitCheck time.Duration DurationCompact time.Duration DurationReportMetric time.Duration DurationRaftTick time.Duration DurationRetrySentSnapshot time.Duration LimitPeerDownDuration time.Duration LimitCompactCount uint64 LimitCompactBytes uint64 LimitCompactLag uint64 LimitRaftMsgCount int LimitRaftMsgBytes uint64 LimitRaftEntryBytes uint64 LimitSnapChunkBytes uint64 LimitSnapChunkRate uint64 LimitConcurrencyWrite uint64 ThresholdCompact uint64 ThresholdSplitCheckBytes uint64 ThresholdRaftElection int ThresholdRaftHeartbeat int BatchSizeProposal uint64 BatchSizeSent uint64 WorkerCountSent uint64 WorkerCountSentSnap uint64 WorkerCountApply uint64 EnableSyncRaftLog bool EnableMetricsRequest bool }
Cfg for raftstore
type DocPtr ¶
DocPtr is alias of querypb.Document
func (DocPtr) Compare ¶
func (d DocPtr) Compare(other datastructures.Comparable) int
Compare is part of Comparable interface
type IndicesDiff ¶
type IndicesDiff struct {
// contains filtered or unexported fields
}
IndicesDiff is indices definion difference
type PeerReplicate ¶
type PeerReplicate struct {
// contains filtered or unexported fields
}
PeerReplicate is the cell's peer replicate. Every cell replicate has a PeerReplicate.
type QueryRequestCb ¶
type QueryRequestCb struct {
// contains filtered or unexported fields
}
QueryRequestCb is query request from elasticell-proxy(cb!=nil) or a store(cb==nil)
type QueryState ¶
type QueryState struct {
// contains filtered or unexported fields
}
QueryState is state of a query
type SnapshotManager ¶
type SnapshotManager interface { Register(msg *mraft.SnapshotMessage, step int) bool Deregister(msg *mraft.SnapshotMessage, step int) Create(msg *mraft.SnapshotMessage) error Exists(msg *mraft.SnapshotMessage) bool WriteTo(msg *mraft.SnapshotMessage, conn goetty.IOSession) (uint64, error) CleanSnap(msg *mraft.SnapshotMessage) error ReceiveSnapData(msg *mraft.SnapshotMessage) error Apply(msg *mraft.SnapshotMessage) error }
SnapshotManager manager snapshot
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the store for raft
func NewStore ¶
func NewStore(clusterID uint64, pdClient *pd.Client, meta metapb.Store, engine storage.Driver, cfg *Cfg) *Store
NewStore returns store
func (*Store) OnProxyReq ¶
OnProxyReq process proxy req
func (*Store) OnRedisCommand ¶
func (s *Store) OnRedisCommand(sessionID int64, cmdType raftcmdpb.CMDType, cmd redis.Command, cb func(*raftcmdpb.RaftCMDResponse)) ([]byte, error)
OnRedisCommand process redis command
func (*Store) SetKeyConvertFun ¶
SetKeyConvertFun set key convert function
Source Files
¶
- cfg.go
- cmd.go
- codec.go
- errors.go
- keys.go
- map.go
- metrics.go
- metrics_command.go
- metrics_raft.go
- metrics_request.go
- metrics_snapshot.go
- metrics_store.go
- peer.go
- peer_job.go
- peer_raft.go
- peer_storage.go
- pool.go
- propose_batch.go
- raft_apply.go
- raft_apply_cmd.go
- raft_handle_do.go
- redis.go
- redis_hash.go
- redis_kv.go
- redis_list.go
- redis_set.go
- redis_zset.go
- snap.go
- store.go
- store_check.go
- store_index.go
- store_query.go
- transport.go
- util.go
Click to show internal directories.
Click to hide internal directories.