topo

package
v0.0.0-...-17b9906 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Topo

type Topo struct {
	// for the base zk directory name
	Name string
	// contains filtered or unexported fields
}

We use zookeeper to store the configuration and cooperate all services

func NewTopo

func NewTopo(name string, conn zkhelper.Conn) *Topo

func (*Topo) AddGroupNode

func (t *Topo) AddGroupNode(groupID int, addr string, tp string, status string, weight int) (string, error)

func (*Topo) AddSchemaGroup

func (t *Topo) AddSchemaGroup(db string, groupID int) error

func (*Topo) Close

func (t *Topo) Close()

func (*Topo) CreateAgent

func (t *Topo) CreateAgent(nodeAddr string) (string, error)

func (*Topo) CreateGroup

func (t *Topo) CreateGroup(groupID int) (string, error)

group:

/zk/myshard/groups/group_000001
/zk/myshard/groups/group_000002

func (*Topo) CreateProxy

func (t *Topo) CreateProxy(p *model.Proxy) (string, error)

func (*Topo) CreateSchema

func (t *Topo) CreateSchema(db string, groupIDs []int, defaultGroupID int) (string, error)

func (*Topo) DeleteAgent

func (t *Topo) DeleteAgent(nodeAddr string) error

func (*Topo) DeleteGroup

func (t *Topo) DeleteGroup(groupID int) error

func (*Topo) DeleteGroupNode

func (t *Topo) DeleteGroupNode(groupID int, addr string) error

func (*Topo) DeleteProxy

func (t *Topo) DeleteProxy(addr string) error

func (*Topo) DeleteSchema

func (t *Topo) DeleteSchema(db string) error

func (*Topo) DeleteSchemaGroup

func (t *Topo) DeleteSchemaGroup(db string, groupID int) error

func (*Topo) GetAgentBasePath

func (t *Topo) GetAgentBasePath() string

agent:

func (*Topo) GetGroup

func (t *Topo) GetGroup(groupID int) (*model.Group, error)

func (*Topo) GetGroupBasePath

func (t *Topo) GetGroupBasePath() string

func (*Topo) GetGroupNode

func (t *Topo) GetGroupNode(groupID int, addr string) (*model.Node, error)

func (*Topo) GetGroupNodePath

func (t *Topo) GetGroupNodePath(groupID int, addr string) string

func (*Topo) GetGroupPath

func (t *Topo) GetGroupPath(groupID int) string

func (*Topo) GetProxy

func (t *Topo) GetProxy(addr string) (*model.Proxy, error)

func (*Topo) GetProxyBasePath

func (t *Topo) GetProxyBasePath() string

func (*Topo) GetSchema

func (t *Topo) GetSchema(db string) (*model.Schema, error)

func (*Topo) GetSchemaBasePath

func (t *Topo) GetSchemaBasePath() string

func (*Topo) GetSchemaPath

func (t *Topo) GetSchemaPath(db string) string

func (*Topo) GetSchemaTablePath

func (t *Topo) GetSchemaTablePath(db string, table string) string

func (*Topo) ListAgents

func (t *Topo) ListAgents() ([]string, error)

func (*Topo) ListProxys

func (t *Topo) ListProxys() ([]*model.Proxy, error)

func (*Topo) SetGroupNodeStatus

func (t *Topo) SetGroupNodeStatus(groupID int, addr string, status string) error

func (*Topo) SetGroupNodeWeight

func (t *Topo) SetGroupNodeWeight(groupID int, addr string, weight int) error

func (*Topo) SetGroupStatus

func (t *Topo) SetGroupStatus(groupID int, status string) error

func (*Topo) SetProxyStatus

func (t *Topo) SetProxyStatus(addr string, status string) error

func (*Topo) UpdateSchemaDefaultGroup

func (t *Topo) UpdateSchemaDefaultGroup(db string, defaultGroupID int) error

Jump to

Keyboard shortcuts

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