Exemple #1
0
func GroupExists(zkConn zkhelper.Conn, productName string, groupId int) (bool, error) {
	zkPath := fmt.Sprintf("/zk/codis/db_%s/servers/group_%d", productName, groupId)
	exists, _, err := zkConn.Exists(zkPath)
	if err != nil {
		return false, errors.Trace(err)
	}
	return exists, nil
}
Exemple #2
0
func releaseDashboardNode(conn zkhelper.Conn) {
	coordPath := fmt.Sprintf("/zk/reborn/db_%s/dashboard", globalEnv.ProductName())

	if exists, _, _ := conn.Exists(coordPath); exists {
		log.Info("removing dashboard node")
		conn.Delete(coordPath, 0)
	}
}