Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StateMachinePaths = make(map[string]models.StateMachineInfo)
StateMachinePaths represents the paths which storage state machine need watch.
Functions ¶
This section is empty.
Types ¶
type StateMachineFactory ¶
type StateMachineFactory struct {
// contains filtered or unexported fields
}
StateMachineFactory represents storage state machine maintainer.
func NewStateMachineFactory ¶
func NewStateMachineFactory(ctx context.Context, discoveryFactory discovery.Factory, stateMgr StateManager, ) *StateMachineFactory
NewStateMachineFactory creates a StateMachineFactory instance.
func (*StateMachineFactory) Start ¶
func (f *StateMachineFactory) Start() (err error)
Start starts all storage's related state machines.
func (*StateMachineFactory) Stop ¶
func (f *StateMachineFactory) Stop()
Stop stops all storage's related state machines.
type StateManager ¶
type StateManager interface { discovery.StateMachineEventHandle // GetLiveNode returns storage live node by node id, return false if not exist. GetLiveNode(nodeID models.NodeID) (models.StatefulNode, bool) // WatchNodeStateChangeEvent registers node state change event handle. WatchNodeStateChangeEvent(nodeID models.NodeID, fn func(state models.NodeStateType)) // GetLiveNodes returns the current live nodes. GetLiveNodes() []models.StatefulNode // GetDatabaseAssignments returns the current database assignments. GetDatabaseAssignments() []*models.DatabaseAssignment }
StateManager represents storage state manager, maintains storage node in memory.
func NewStateManager ¶
func NewStateManager( ctx context.Context, current *models.StatefulNode, engine tsdb.Engine, ) StateManager
NewStateManager creates a StateManager instance.
Click to show internal directories.
Click to hide internal directories.