Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
612b3c9b
Commit
612b3c9b
authored
Dec 04, 2018
by
Bobby (Babak) Salamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run old-style priority functions in parallel to the map-reduce style ones
parent
a2e74f28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
generic_scheduler.go
pkg/scheduler/core/generic_scheduler.go
+13
-11
No files found.
pkg/scheduler/core/generic_scheduler.go
View file @
612b3c9b
...
@@ -655,19 +655,21 @@ func PrioritizeNodes(
...
@@ -655,19 +655,21 @@ func PrioritizeNodes(
// DEPRECATED: we can remove this when all priorityConfigs implement the
// DEPRECATED: we can remove this when all priorityConfigs implement the
// Map-Reduce pattern.
// Map-Reduce pattern.
workqueue
.
ParallelizeUntil
(
context
.
TODO
(),
16
,
len
(
priorityConfigs
),
func
(
i
int
)
{
for
i
:=
range
priorityConfigs
{
priorityConfig
:=
priorityConfigs
[
i
]
if
priorityConfigs
[
i
]
.
Function
!=
nil
{
if
priorityConfig
.
Function
==
nil
{
wg
.
Add
(
1
)
go
func
(
index
int
)
{
defer
wg
.
Done
()
var
err
error
results
[
index
],
err
=
priorityConfigs
[
index
]
.
Function
(
pod
,
nodeNameToInfo
,
nodes
)
if
err
!=
nil
{
appendError
(
err
)
}
}(
i
)
}
else
{
results
[
i
]
=
make
(
schedulerapi
.
HostPriorityList
,
len
(
nodes
))
results
[
i
]
=
make
(
schedulerapi
.
HostPriorityList
,
len
(
nodes
))
return
}
var
err
error
results
[
i
],
err
=
priorityConfig
.
Function
(
pod
,
nodeNameToInfo
,
nodes
)
if
err
!=
nil
{
appendError
(
err
)
}
}
}
)
}
workqueue
.
ParallelizeUntil
(
context
.
TODO
(),
16
,
len
(
nodes
),
func
(
index
int
)
{
workqueue
.
ParallelizeUntil
(
context
.
TODO
(),
16
,
len
(
nodes
),
func
(
index
int
)
{
nodeInfo
:=
nodeNameToInfo
[
nodes
[
index
]
.
Name
]
nodeInfo
:=
nodeNameToInfo
[
nodes
[
index
]
.
Name
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment