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