Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
a723f53d
Commit
a723f53d
authored
4 years ago
by
pengganyu
Browse files
Options
Downloads
Patches
Plain Diff
Add feature: rename func name : GetParamInt0 -> GetParamIntValue
parent
b3cf2d51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cluster/cluster_impl/forking_cluster_invoker.go
+1
-1
1 addition, 1 deletion
cluster/cluster_impl/forking_cluster_invoker.go
cluster/loadbalance/consistent_hash.go
+1
-1
1 addition, 1 deletion
cluster/loadbalance/consistent_hash.go
common/url.go
+4
-4
4 additions, 4 deletions
common/url.go
with
6 additions
and
6 deletions
cluster/cluster_impl/forking_cluster_invoker.go
+
1
−
1
View file @
a723f53d
...
...
@@ -56,7 +56,7 @@ func (invoker *forkingClusterInvoker) Invoke(ctx context.Context, invocation pro
}
var
selected
[]
protocol
.
Invoker
forks
:=
invoker
.
GetUrl
()
.
GetParamByInt
0
(
constant
.
FORKS_KEY
,
constant
.
DEFAULT_FORKS
)
forks
:=
invoker
.
GetUrl
()
.
GetParamByInt
Value
(
constant
.
FORKS_KEY
,
constant
.
DEFAULT_FORKS
)
timeouts
:=
invoker
.
GetUrl
()
.
GetParamInt
(
constant
.
TIMEOUT_KEY
,
constant
.
DEFAULT_TIMEOUT
)
if
forks
<
0
||
forks
>
len
(
invokers
)
{
selected
=
invokers
...
...
This diff is collapsed.
Click to expand it.
cluster/loadbalance/consistent_hash.go
+
1
−
1
View file @
a723f53d
...
...
@@ -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
.
GetMethodParamInt
0
(
methodName
,
HashNodes
,
160
)
selector
.
replicaNum
=
url
.
GetMethodParamInt
Value
(
methodName
,
HashNodes
,
160
)
indices
:=
re
.
Split
(
url
.
GetMethodParam
(
methodName
,
HashArguments
,
"0"
),
-
1
)
for
_
,
index
:=
range
indices
{
i
,
err
:=
strconv
.
Atoi
(
index
)
...
...
This diff is collapsed.
Click to expand it.
common/url.go
+
4
−
4
View file @
a723f53d
...
...
@@ -502,8 +502,8 @@ func (c URL) GetParamInt32(key string, d int32) int32 {
return
int32
(
r
)
}
// GetParamByInt
0
gets int value by @key
func
(
c
URL
)
GetParamByInt
0
(
key
string
,
d
int
)
int
{
// GetParamByInt
Value
gets int value by @key
func
(
c
URL
)
GetParamByInt
Value
(
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
}
// GetMethodParamInt
0
gets int method param
func
(
c
URL
)
GetMethodParamInt
0
(
method
string
,
key
string
,
d
int
)
int
{
// GetMethodParamInt
Value
gets int method param
func
(
c
URL
)
GetMethodParamInt
Value
(
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment