Documentation
¶
Index ¶
- func NewBrokerHousekeepingService(controller *DefaultNamesrvController) netm.ContextListener
- func NewDefaultRequestProcessor(controller *DefaultNamesrvController) remoting.RequestProcessor
- type BrokerHousekeepingService
- type DefaultNamesrvController
- type DefaultRequestProcessor
- type KVConfigManager
- type KVConfigSerializeWrapper
- type NamesrvControllerTask
- type RouteInfoManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBrokerHousekeepingService ¶
func NewBrokerHousekeepingService(controller *DefaultNamesrvController) netm.ContextListener
NewBrokerHousekeepingService 初始化Broker活动检测服务 Author: tianyuliang Since: 2017/9/6
func NewDefaultRequestProcessor ¶
func NewDefaultRequestProcessor(controller *DefaultNamesrvController) remoting.RequestProcessor
NewDefaultRequestProcessor 初始化NameServer网络请求处理 Author: tianyuliang Since: 2017/9/6
Types ¶
type BrokerHousekeepingService ¶
type BrokerHousekeepingService struct {
NamesrvController *DefaultNamesrvController
}
BrokerHousekeepingServices Broker活动检测服务
(1)ContextListener是smartnet模块封装接口 (2)NameSrv监测Broker的死亡:当Broker和NameSrv之间的长连接断掉之后,回调ContextListener对应的函数,从而触发NameServer的路由信息更新
Author: tianyuliang Since: 2017/9/6
func (*BrokerHousekeepingService) OnContextClose ¶
func (self *BrokerHousekeepingService) OnContextClose(ctx netm.Context)
OnContextClose 关闭Channel,通知Topic路由管理器,清除无效Broker Author: tianyuliang Since: 2017/9/6
func (*BrokerHousekeepingService) OnContextConnect ¶
func (self *BrokerHousekeepingService) OnContextConnect(ctx netm.Context)
OnContextConnect 创建Channel连接 Author: tianyuliang Since: 2017/9/6
func (*BrokerHousekeepingService) OnContextError ¶
func (self *BrokerHousekeepingService) OnContextError(ctx netm.Context)
OnContextError Channel出现异常,通知Topic路由管理器,清除无效Broker Author: tianyuliang Since: 2017/9/6
func (*BrokerHousekeepingService) OnContextIdle ¶
func (self *BrokerHousekeepingService) OnContextIdle(ctx netm.Context)
OnContextIdle Channe的Idle时间超时,通知Topic路由管理器,清除无效Brokers Author: tianyuliang Since: 2017/9/6
type DefaultNamesrvController ¶
type DefaultNamesrvController struct {
NamesrvConfig *namesrv.NamesrvConfig // namesrv配置项
RemotingServer *remoting.DefalutRemotingServer // 远程请求server端
RouteInfoManager *RouteInfoManager // topic路由管理器
KvConfigManager *KVConfigManager // kv管理器
BrokerHousekeepingService netm.ContextListener // 扫描不活跃broker
ScheduledExecutorService *NamesrvControllerTask // Namesrv定时器服务
RequestProcessor remoting.RequestProcessor // 默认请求处理器
}
DefaultNamesrvController 注意循环引用 Author: tianyuliang Since: 2017/9/6
func CreateNamesrvController ¶
func CreateNamesrvController(registryPort int) *DefaultNamesrvController
CreateNamesrvController 创建默认Namesrv控制器 Author: tianyuliang Since: 2017/9/15
func NewNamesrvController ¶
func NewNamesrvController(namesrvConfig *namesrv.NamesrvConfig, remotingServer *remoting.DefalutRemotingServer) *DefaultNamesrvController
NewNamesrvController 初始化默认的NamesrvController Author: tianyuliang Since: 2017/9/12
func Startup ¶
func Startup(stopChannel chan bool, registryPort int) *DefaultNamesrvController
Startup 启动Namesrv控制器 Author: tianyuliang Since: 2017/9/14
type DefaultRequestProcessor ¶
type DefaultRequestProcessor struct {
NamesrvController *DefaultNamesrvController
}
DefaultRequestProcessor NameServer网络请求处理结构体 Author: tianyuliang Since: 2017/9/6
func (*DefaultRequestProcessor) ProcessRequest ¶
func (self *DefaultRequestProcessor) ProcessRequest(ctx netm.Context, request *protocol.RemotingCommand) (*protocol.RemotingCommand, error)
ProcessRequest 默认请求处理器 Author: tianyuliang Since: 2017/9/6
type KVConfigManager ¶
type KVConfigManager struct {
ConfigTable map[string]map[string]string // 数据格式:Namespace[Key[Value]]
ReadWriteLock *sync.RWMutex
NamesrvController *DefaultNamesrvController
}
KVConfigManager KV配置管理器 Author: tianyuliang Since: 2017/9/8
func NewKVConfigManager ¶
func NewKVConfigManager(controller *DefaultNamesrvController) *KVConfigManager
NewKVConfigManager 初始化KV配置管理器 // NamesrvController *stgregistry.DefaultNamesrvController Author: tianyuliang Since: 2017/9/6
type KVConfigSerializeWrapper ¶
type KVConfigSerializeWrapper struct {
ConfigTable map[string]map[string]string `json:"configTable"` // 数据格式:Namespace[Key[Value]]
*protocol.RemotingSerializable
}
KVConfigSerializeWrapper KV配置的json序列化结构 Author: tianyuliang Since: 2017/9/4
func NewKVConfigSerializeWrapper ¶
func NewKVConfigSerializeWrapper(configTable map[string]map[string]string) *KVConfigSerializeWrapper
NewKVConfigSerializeWrapper 初始化KV配置 Author: tianyuliang Since: 2017/9/4
type NamesrvControllerTask ¶
type NamesrvControllerTask struct {
NamesrvController *DefaultNamesrvController
// contains filtered or unexported fields
}
func NewNamesrvControllerTask ¶
func NewNamesrvControllerTask(controller *DefaultNamesrvController) *NamesrvControllerTask
type RouteInfoManager ¶
type RouteInfoManager struct {
TopicQueueTable map[string][]*route.QueueData // topic[list<QueueData>]
BrokerAddrTable map[string]*route.BrokerData // brokerName[BrokerData]
ClusterAddrTable map[string]set.Set // clusterName[set<brokerName>]
BrokerLiveTable map[string]*routeinfo.BrokerLiveInfo // brokerAddr[brokerLiveTable]
FilterServerTable map[string][]string // brokerAddr[FilterServer]
ReadWriteLock *sync.RWMutex // read & write lock
}
RouteInfoManager Topic路由管理器 Author: tianyuliang Since: 2017/9/6
func NewRouteInfoManager ¶
func NewRouteInfoManager() *RouteInfoManager
NewRouteInfoManager 初始化Topic路由管理器 Author: tianyuliang Since: 2017/9/6
Source Files
¶
- broker_house_keeping_service.go
- default_request_processor.go
- kv_config_manager.go
- kv_config_serialize_wrapper.go
- namesrv_controller.go
- namesrv_controller_task.go
- namesrv_startup.go
- route_info_manager.go