Пример #1
0
func (top *Topology) Close(proxyName string) {
	// delete fence znode
	pi, err := models.GetProxyInfo(top.coordConn, top.ProductName, proxyName)
	if err != nil {
		log.Error("killing fence error, proxy %s is not exists", proxyName)
	} else {
		zkhelper.DeleteRecursive(top.coordConn, path.Join(models.GetProxyFencePath(top.ProductName), pi.Addr), -1)
	}
	// delete ephemeral znode
	zkhelper.DeleteRecursive(top.coordConn, path.Join(models.GetProxyPath(top.ProductName), proxyName), -1)
	top.coordConn.Close()
}
Пример #2
0
func (top *Topology) GetProxyInfo(proxyName string) (*models.ProxyInfo, error) {
	return models.GetProxyInfo(top.coordConn, top.ProductName, proxyName)
}