Skip to content
Snippets Groups Projects
Commit a723f53d authored by pengganyu's avatar pengganyu
Browse files

Add feature: rename func name : GetParamInt0 -> GetParamIntValue

parent b3cf2d51
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ func (invoker *forkingClusterInvoker) Invoke(ctx context.Context, invocation pro
}
var selected []protocol.Invoker
forks := invoker.GetUrl().GetParamByInt0(constant.FORKS_KEY, constant.DEFAULT_FORKS)
forks := invoker.GetUrl().GetParamByIntValue(constant.FORKS_KEY, constant.DEFAULT_FORKS)
timeouts := invoker.GetUrl().GetParamInt(constant.TIMEOUT_KEY, constant.DEFAULT_TIMEOUT)
if forks < 0 || forks > len(invokers) {
selected = invokers
......
......@@ -105,7 +105,7 @@ func newConsistentHashSelector(invokers []protocol.Invoker, methodName string,
selector.virtualInvokers = make(map[uint32]protocol.Invoker)
selector.hashCode = hashCode
url := invokers[0].GetUrl()
selector.replicaNum = url.GetMethodParamInt0(methodName, HashNodes, 160)
selector.replicaNum = url.GetMethodParamIntValue(methodName, HashNodes, 160)
indices := re.Split(url.GetMethodParam(methodName, HashArguments, "0"), -1)
for _, index := range indices {
i, err := strconv.Atoi(index)
......
......@@ -502,8 +502,8 @@ func (c URL) GetParamInt32(key string, d int32) int32 {
return int32(r)
}
// GetParamByInt0 gets int value by @key
func (c URL) GetParamByInt0(key string, d int) int {
// GetParamByIntValue gets int value by @key
func (c URL) GetParamByIntValue(key string, d int) int {
r, err := strconv.ParseInt(c.GetParam(key, ""), 10, 0)
if r == 0 || err != nil {
return d
......@@ -520,8 +520,8 @@ func (c URL) GetMethodParamInt(method string, key string, d int64) int64 {
return r
}
// GetMethodParamInt0 gets int method param
func (c URL) GetMethodParamInt0(method string, key string, d int) int {
// GetMethodParamIntValue gets int method param
func (c URL) GetMethodParamIntValue(method string, key string, d int) int {
r, err := strconv.ParseInt(c.GetParam("methods."+method+"."+key, ""), 10, 0)
if r == 0 || err != nil {
return d
......
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