Skip to content
Snippets Groups Projects
Commit 96b655d4 authored by 邹毅贤's avatar 邹毅贤
Browse files

fix review comment

parent 2c98773c
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package condition
import (
......
......@@ -55,7 +55,8 @@ const (
var (
// DubboNodes ...
DubboNodes = [...]string{"consumers", "configurators", "routers", "providers"}
DubboRole = [...]string{"consumer", "", "routers", "provider"}
// DubboRole dubbo service role
DubboRole = [...]string{"consumer", "", "routers", "provider"}
)
// RoleType ...
......@@ -309,6 +310,7 @@ func (c URL) Key() string {
//return c.ServiceKey()
}
// ColonSeparatedKey The format is "{interface}:[version]:[group]"
func (c *URL) ColonSeparatedKey() string {
intf := c.GetParam(constant.INTERFACE_KEY, strings.TrimPrefix(c.Path, "/"))
if intf == "" {
......@@ -329,36 +331,6 @@ func (c *URL) ColonSeparatedKey() string {
return buf.String()
}
func (c *URL) GetBackupUrls() []*URL {
var (
urls []*URL
host string
)
urls = append(urls, c)
backups := strings.Split(c.GetParam(constant.BACKUP_KEY, ""), "")
for _, address := range backups {
index := strings.LastIndex(address, ":")
port := c.Port
if index > 0 {
host = address[:index]
port = address[index+1:]
} else {
host = address
}
newURL := NewURLWithOptions(
WithProtocol(c.Protocol),
WithPath(c.Path),
WithIp(host),
WithUsername(c.Username),
WithPassword(c.Password),
WithPort(port),
WithParams(c.params))
urls = append(urls, newURL)
}
return urls
}
// ServiceKey ...
func (c URL) ServiceKey() string {
intf := c.GetParam(constant.INTERFACE_KEY, strings.TrimPrefix(c.Path, "/"))
......
......@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package config
import (
......
......@@ -131,7 +131,6 @@ func (dir *registryDirectory) refreshInvokers(res *registry.ServiceEvent) {
}
switch res.Action {
case remoting.EventTypeAdd, remoting.EventTypeUpdate:
dirUrl := &res.Service
var urls []*common.URL
for _, v := range directory.GetRouterURLSet().Values() {
......
......@@ -391,7 +391,6 @@ func (r *zkRegistry) register(c common.URL) error {
logger.Debugf("consumer path:%s, url:%s", dubboPath, rawURL)
case common.ROUTER:
//todo
dubboPath = fmt.Sprintf("/dubbo/%s/%s", c.Service(), common.DubboNodes[common.ROUTER])
r.cltLock.Lock()
err = r.client.Create(dubboPath)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment