Documentation ¶
Index ¶
- Constants
- func GetValidPartitionID(numStr string) (int, error)
- func GetValidPartitionNum(numStr string) (int, error)
- func GetValidReplicator(r string) (int, error)
- func GetValidSuggestLF(r string) (int, error)
- func HandleBlockRate(w http.ResponseWriter, req *http.Request, ps httprouter.Params) (interface{}, error)
- func SetLogger(logger levellogger.Logger, level int32)
- type ChannelReg
- type ChannelRegistrations
- type ClientV1
- type Context
- type LookupProtocolV1
- func (p *LookupProtocolV1) Exec(client *ClientV1, reader *bufio.Reader, params []string) ([]byte, error)
- func (p *LookupProtocolV1) IDENTIFY(client *ClientV1, reader *bufio.Reader, params []string) ([]byte, error)
- func (p *LookupProtocolV1) IOLoop(conn net.Conn) error
- func (p *LookupProtocolV1) PING(client *ClientV1, params []string) ([]byte, error)
- func (p *LookupProtocolV1) REGISTER(client *ClientV1, reader *bufio.Reader, params []string) ([]byte, error)
- func (p *LookupProtocolV1) UNREGISTER(client *ClientV1, reader *bufio.Reader, params []string) ([]byte, error)
- type NSQLookupd
- type NodeStat
- type Options
- type PeerInfo
- type PeerInfoList
- type Producer
- type Producers
- type RegistrationDB
- func (r *RegistrationDB) AddChannelReg(topic string, k ChannelReg) bool
- func (r *RegistrationDB) AddTopicProducer(topic string, pidStr string, p *Producer) bool
- func (r *RegistrationDB) DelTombstoneLookupdNode(nid string) bool
- func (r *RegistrationDB) FindChannelRegs(topic string, pid string) ChannelRegistrations
- func (r *RegistrationDB) FindPeerTopics(id string) map[string]TopicRegistrations
- func (r *RegistrationDB) FindTopicProducers(topic string, pid string) TopicRegistrations
- func (r *RegistrationDB) FindTopics() []string
- func (r *RegistrationDB) GetAllPeerClients() PeerInfoList
- func (r *RegistrationDB) IsTombstoneLookupdNode(nid string) bool
- func (r *RegistrationDB) RemoveAllByPeerId(id string)
- func (r *RegistrationDB) RemoveChannelReg(topic string, k ChannelReg) bool
- func (r *RegistrationDB) RemoveTopicProducer(topic string, pid string, id string) bool
- func (r *RegistrationDB) SearchPeerClientByClusterID(id string) *PeerInfo
- func (r *RegistrationDB) SearchPeerClientByID(id string) *PeerInfo
- func (r *RegistrationDB) TombstoneLookupdNode(nid string, pinfo PeerInfo)
- type TopNInfo
- type TopicProducerReg
- type TopicRegistrations
Constants ¶
View Source
const ( MAX_PARTITION_NUM = 255 MAX_REPLICATOR = 5 MAX_LOAD_FACTOR = 10000 )
View Source
const (
OLD_VERSION_PID = -11
)
Variables ¶
This section is empty.
Functions ¶
func HandleBlockRate ¶
func HandleBlockRate(w http.ResponseWriter, req *http.Request, ps httprouter.Params) (interface{}, error)
func SetLogger ¶
func SetLogger(logger levellogger.Logger, level int32)
Types ¶
type ChannelReg ¶
type ChannelRegistrations ¶
type ChannelRegistrations []ChannelReg
func (ChannelRegistrations) Channels ¶
func (rr ChannelRegistrations) Channels() []string
type ClientV1 ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
type LookupProtocolV1 ¶
type LookupProtocolV1 struct {
// contains filtered or unexported fields
}
func (*LookupProtocolV1) Exec ¶
func (*LookupProtocolV1) IDENTIFY ¶
func (*LookupProtocolV1) IOLoop ¶
func (p *LookupProtocolV1) IOLoop(conn net.Conn) error
func (*LookupProtocolV1) PING ¶
func (p *LookupProtocolV1) PING(client *ClientV1, params []string) ([]byte, error)
func (*LookupProtocolV1) REGISTER ¶
type NSQLookupd ¶
type NSQLookupd struct { sync.RWMutex DB *RegistrationDB // contains filtered or unexported fields }
func New ¶ added in v0.3.6
func New(opts *Options) *NSQLookupd
func (*NSQLookupd) Exit ¶
func (l *NSQLookupd) Exit()
func (*NSQLookupd) Main ¶
func (l *NSQLookupd) Main()
func (*NSQLookupd) RealHTTPAddr ¶ added in v0.3.3
func (l *NSQLookupd) RealHTTPAddr() *net.TCPAddr
func (*NSQLookupd) RealTCPAddr ¶ added in v0.3.3
func (l *NSQLookupd) RealTCPAddr() *net.TCPAddr
type NodeStat ¶
type Options ¶ added in v0.3.6
type Options struct { Verbose bool `flag:"verbose"` TCPAddress string `flag:"tcp-address"` HTTPAddress string `flag:"http-address"` RPCPort string `flag:"rpc-port"` BroadcastAddress string `flag:"broadcast-address"` BroadcastInterface string `flag:"broadcast-interface"` ReverseProxyPort string `flag:"reverse-proxy-port"` ClusterID string `flag:"cluster-id"` ClusterLeadershipAddresses string `flag:"cluster-leadership-addresses" cfg:"cluster_leadership_addresses"` ClusterLeadershipUsername string `flag:"cluster-leadership-username" cfg:"cluster_leadership_username"` ClusterLeadershipPassword string `flag:"cluster-leadership-password" cfg:"cluster_leadership_password"` ClusterLeadershipRootDir string `flag:"cluster-leadership-root-dir" cfg:"cluster_leadership_root_dir"` InactiveProducerTimeout time.Duration `flag:"inactive-producer-timeout"` NsqdPingTimeout time.Duration `flag:"nsqd-ping-timeout"` BalanceInterval []string `flag:"balance-interval"` AllowWriteWithNoChannels bool `flag:"allow-write-with-nochannels"` LogLevel int32 `flag:"log-level" cfg:"log_level"` LogDir string `flag:"log-dir" cfg:"log_dir"` Logger levellogger.Logger }
type PeerInfo ¶
type PeerInfo struct { Id string `json:"id"` RemoteAddress string `json:"remote_address"` Hostname string `json:"hostname"` BroadcastAddress string `json:"broadcast_address"` TCPPort int `json:"tcp_port"` HTTPPort int `json:"http_port"` Version string `json:"version"` // the node id used in the cluster. DistributedID string `json:"distributed_id"` // contains filtered or unexported fields }
type PeerInfoList ¶
type PeerInfoList []*PeerInfo
func (PeerInfoList) FilterByActive ¶
func (pp PeerInfoList) FilterByActive(inactivityTimeout time.Duration) PeerInfoList
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
type RegistrationDB ¶
func NewRegistrationDB ¶
func NewRegistrationDB() *RegistrationDB
func (*RegistrationDB) AddChannelReg ¶
func (r *RegistrationDB) AddChannelReg(topic string, k ChannelReg) bool
add a registration key
func (*RegistrationDB) AddTopicProducer ¶
func (r *RegistrationDB) AddTopicProducer(topic string, pidStr string, p *Producer) bool
func (*RegistrationDB) DelTombstoneLookupdNode ¶
func (r *RegistrationDB) DelTombstoneLookupdNode(nid string) bool
func (*RegistrationDB) FindChannelRegs ¶
func (r *RegistrationDB) FindChannelRegs(topic string, pid string) ChannelRegistrations
func (*RegistrationDB) FindPeerTopics ¶
func (r *RegistrationDB) FindPeerTopics(id string) map[string]TopicRegistrations
func (*RegistrationDB) FindTopicProducers ¶
func (r *RegistrationDB) FindTopicProducers(topic string, pid string) TopicRegistrations
func (*RegistrationDB) FindTopics ¶
func (r *RegistrationDB) FindTopics() []string
func (*RegistrationDB) GetAllPeerClients ¶
func (r *RegistrationDB) GetAllPeerClients() PeerInfoList
func (*RegistrationDB) IsTombstoneLookupdNode ¶
func (r *RegistrationDB) IsTombstoneLookupdNode(nid string) bool
func (*RegistrationDB) RemoveAllByPeerId ¶
func (r *RegistrationDB) RemoveAllByPeerId(id string)
remove all topic producers and channels related with peer id
func (*RegistrationDB) RemoveChannelReg ¶
func (r *RegistrationDB) RemoveChannelReg(topic string, k ChannelReg) bool
func (*RegistrationDB) RemoveTopicProducer ¶
func (r *RegistrationDB) RemoveTopicProducer(topic string, pid string, id string) bool
func (*RegistrationDB) SearchPeerClientByClusterID ¶
func (r *RegistrationDB) SearchPeerClientByClusterID(id string) *PeerInfo
func (*RegistrationDB) SearchPeerClientByID ¶
func (r *RegistrationDB) SearchPeerClientByID(id string) *PeerInfo
func (*RegistrationDB) TombstoneLookupdNode ¶
func (r *RegistrationDB) TombstoneLookupdNode(nid string, pinfo PeerInfo)
type TopNInfo ¶
type TopicRegistrations ¶
type TopicRegistrations []TopicProducerReg
func (TopicRegistrations) FilterByActive ¶
func (pp TopicRegistrations) FilterByActive(inactivityTimeout time.Duration, filterTomb bool) TopicRegistrations
Click to show internal directories.
Click to hide internal directories.