Documentation ¶
Index ¶
Constants ¶
View Source
const ( ManagerNode = 1 DataNode = 2 SearchNode = 3 )
View Source
const ( LeaderSharding = 1 FollowerSharding = 2 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cluster ¶
type Cluster struct { ShardingNum int //分片数 ReplicateNum int //数据备份数 SearchNodeCorpus []Node DataNodeCorpus map[string]Node }
func NewCluster ¶
func (*Cluster) RouteSearchNode ¶
func (*Cluster) RouteShardingNode ¶
func (c *Cluster) RouteShardingNode(flag int) (Sharding2Node, error)
type DataServer ¶
type DataServer struct {
// contains filtered or unexported fields
}
func NewDataServer ¶
func NewDataServer(config *config.Config) *DataServer
func (*DataServer) Run ¶
func (s *DataServer) Run()
func (*DataServer) Search ¶
func (s *DataServer) Search(request SearchRequest, response *[]index.Doc) error
Search 搜索
type ManagerServer ¶
type ManagerServer struct {
// contains filtered or unexported fields
}
func NewManagerServer ¶
func NewManagerServer(config *config.Config) *ManagerServer
func (*ManagerServer) AddServer ¶
func (m *ManagerServer) AddServer(request Node, response *Node) error
AddServer called by SearchServer
func (*ManagerServer) GetCluster ¶
func (m *ManagerServer) GetCluster(request string, response *Cluster) error
GetCluster called by DataServer
func (*ManagerServer) ReBalance ¶
func (m *ManagerServer) ReBalance() error
func (*ManagerServer) Run ¶
func (m *ManagerServer) Run()
type SearchClient ¶
type SearchClient struct { ServerConfig *config.Server //manager server config // contains filtered or unexported fields }
func NewSearchClient ¶
func NewSearchClient(config *config.Server) *SearchClient
type SearchRequest ¶
type SearchServer ¶
type SearchServer struct {
// contains filtered or unexported fields
}
func NewSearchServer ¶
func NewSearchServer(config *config.Config) *SearchServer
func (*SearchServer) Run ¶
func (s *SearchServer) Run()
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterName ¶
type Sharding2Node ¶
Click to show internal directories.
Click to hide internal directories.