Documentation
¶
Index ¶
- Constants
- func ConvertToAllAgentsSyncDataParam(maintainer meta.AgentInfo, data *AllAgentsSyncData) param.AllAgentsSyncData
- type AgentSynchronizer
- type AllAgentsSyncData
- type Coordinator
- func (c *Coordinator) GetIdentiy() int
- func (c *Coordinator) HasMaintainer() bool
- func (c *Coordinator) IsFaulty() bool
- func (c *Coordinator) IsMaintainer() bool
- func (c *Coordinator) IsWatcher() bool
- func (c *Coordinator) Resume()
- func (c *Coordinator) Start() error
- func (c *Coordinator) Subscribe(obj interface{}) *coordinatorEventChan
- func (c *Coordinator) Suspend()
- type Maintainer
Constants ¶
View Source
const ( // FAULTY means coordinator is not initialized FAULTY = iota + 1 MAINTAINER WATCHER )
Variables ¶
This section is empty.
Functions ¶
func ConvertToAllAgentsSyncDataParam ¶
func ConvertToAllAgentsSyncDataParam(maintainer meta.AgentInfo, data *AllAgentsSyncData) param.AllAgentsSyncData
Types ¶
type AgentSynchronizer ¶
type AgentSynchronizer struct { AllAgentsSyncData // contains filtered or unexported fields }
var OCS_AGENT_SYNCHRONIZER *AgentSynchronizer
func NewAgentSynchronizer ¶
func NewAgentSynchronizer(coordinator *Coordinator) *AgentSynchronizer
func (*AgentSynchronizer) GetAllAgentsSyncDataIfChanged ¶
func (as *AgentSynchronizer) GetAllAgentsSyncDataIfChanged() *AllAgentsSyncData
func (*AgentSynchronizer) Start ¶
func (as *AgentSynchronizer) Start()
func (*AgentSynchronizer) Update ¶
func (as *AgentSynchronizer) Update(data *AllAgentsSyncData)
type AllAgentsSyncData ¶
type AllAgentsSyncData struct { // AllAgents is a map containing all the agents in the cluster. // It is used to maintain the agent information within the cluster. AllAgents map[meta.AgentInfo]oceanbase.AllAgent // LastSyncTime is the last time the all_agent was synchronized LastSyncTime time.Time }
func ConvertToAllAgentsSyncData ¶
func ConvertToAllAgentsSyncData(data param.AllAgentsSyncData) *AllAgentsSyncData
func NewAllAgentsSyncData ¶
type Coordinator ¶
type Coordinator struct { Maintainer *Maintainer // contains filtered or unexported fields }
var ( // OCS_COORDINATOR is the coordinator of agent and globally Unique OCS_COORDINATOR *Coordinator )
func NewCoordinator ¶
func NewCoordinator() *Coordinator
func (*Coordinator) GetIdentiy ¶
func (c *Coordinator) GetIdentiy() int
func (*Coordinator) HasMaintainer ¶
func (c *Coordinator) HasMaintainer() bool
func (*Coordinator) IsFaulty ¶
func (c *Coordinator) IsFaulty() bool
func (*Coordinator) IsMaintainer ¶
func (c *Coordinator) IsMaintainer() bool
func (*Coordinator) IsWatcher ¶
func (c *Coordinator) IsWatcher() bool
func (*Coordinator) Resume ¶
func (c *Coordinator) Resume()
func (*Coordinator) Start ¶
func (c *Coordinator) Start() error
func (*Coordinator) Subscribe ¶
func (c *Coordinator) Subscribe(obj interface{}) *coordinatorEventChan
func (*Coordinator) Suspend ¶
func (c *Coordinator) Suspend()
type Maintainer ¶
type Maintainer struct { MaintainerInfo oceanbase.TaskMaintainer LifeTime float64 // How long has it been since the maintainer's active time (seconds) LastUpdateTime time.Time // The last time the maintainer was updated (local time) ExpirationTime time.Time // The expiration time of the maintainer (local time) // contains filtered or unexported fields }
func GetMaintainer ¶
func GetMaintainer() (Maintainer, error)
GetMaintainer will get Coordinator Maintainer with LifeTime.
func (*Maintainer) GetExpirationTime ¶
func (m *Maintainer) GetExpirationTime() time.Time
func (*Maintainer) GetIp ¶
func (m *Maintainer) GetIp() string
func (*Maintainer) GetLastUpdateTime ¶
func (m *Maintainer) GetLastUpdateTime() time.Time
func (*Maintainer) GetLifeTime ¶
func (m *Maintainer) GetLifeTime() float64
func (*Maintainer) GetPort ¶
func (m *Maintainer) GetPort() int
func (*Maintainer) IsActive ¶
func (m *Maintainer) IsActive() bool
func (*Maintainer) String ¶
func (m *Maintainer) String() string
Click to show internal directories.
Click to hide internal directories.