root

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StateMachinePaths = make(map[string]models.StateMachineInfo)

StateMachinePaths represents the paths which root state machine need watch.

Functions

func NewStateMachineFactory

func NewStateMachineFactory(
	ctx context.Context,
	discoveryFactory discovery.Factory,
	stateMgr StateManager,
) discovery.StateMachineFactory

NewStateMachineFactory creates a StateMachineFactory instance.

Types

type BrokerCluster

type BrokerCluster interface {
	// Start starts the state machine for broker state change.
	Start() error
	// GetState returns the current state of broker cluster.
	GetState() *models.BrokerState
	// Close closes broker cluster controller
	Close()
}

BrokerCluster represents broker cluster controller, 1) discovery active node list in broker cluster

type StateManager

type StateManager interface {
	discovery.StateMachineEventHandle
	flow.NodeChoose
	// SetStateMachineFactory sets state machine factory.
	SetStateMachineFactory(stateMachineFct *stateMachineFactory)
	// GetStateMachineFactory returns state machine factory.
	GetStateMachineFactory() *stateMachineFactory
	// GetBrokerStates returns current broker state list.
	GetBrokerStates() []models.BrokerState
	// GetBrokerState returns current broker state by name.
	GetBrokerState(name string) (models.BrokerState, bool)
	// GetDatabase returns the logic database config by name.
	GetDatabase(name string) (models.LogicDatabase, bool)
	// GetDatabases returns all logic databases' config.
	GetDatabases() []models.LogicDatabase
	// GetLiveNodes returns all live broker nodes.
	GetLiveNodes() []models.StatelessNode
}

StateManager represents root state manager, state coordinator.

func NewStateManager

func NewStateManager(
	ctx context.Context,
	repoFactory statepkg.RepositoryFactory,
	connectionManager rpc.ConnectionManager,
) StateManager

NewStateManager creates a StateManager instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL