-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change task worker node to list; add target worker node to cache #656
Conversation
Signed-off-by: Yaliang Wu <[email protected]>
Codecov Report
@@ Coverage Diff @@
## 2.x #656 +/- ##
============================================
+ Coverage 84.58% 84.62% +0.03%
- Complexity 998 1001 +3
============================================
Files 93 93
Lines 3582 3597 +15
Branches 325 327 +2
============================================
+ Hits 3030 3044 +14
+ Misses 417 415 -2
- Partials 135 138 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Yaliang Wu <[email protected]>
Signed-off-by: Yaliang Wu <[email protected]>
} else { | ||
String[] nodes = parser.text().split(","); | ||
workerNodes = Arrays.asList(nodes); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't go into this branch, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For old ML tasks, the worker nodes saved as String, for example "node1,node2,node3". This branch is for BWC. When user get old ML task, will go to this branch.
workerNodes = ConcurrentHashMap.newKeySet(); | ||
modelInferenceDurationQueue = new ConcurrentLinkedQueue<>(); | ||
predictRequestDurationQueue = new ConcurrentLinkedQueue<>(); | ||
} | ||
|
||
public void setTargetWorkerNodes(List<String> targetWorkerNodes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here targetWorkerNodes is a private concurrent set, so I assume MLModelCache needs to be threadsafe. In this case, if setTargetWorkerNodes can be run by multi-threads, we need to protect it by synchronize, otherwise, the targetWorkerNodes could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method will be used by MLModelCacheHelper.initModelState
method, which already has synchronize
…nsearch-project#656) * change task worker node to list; add target worker node to cache Signed-off-by: Yaliang Wu <[email protected]> * fix target worker node field name Signed-off-by: Yaliang Wu <[email protected]> * support work nodes string in old tasks Signed-off-by: Yaliang Wu <[email protected]> Signed-off-by: Yaliang Wu <[email protected]>
…nsearch-project#656) * change task worker node to list; add target worker node to cache Signed-off-by: Yaliang Wu <[email protected]> * fix target worker node field name Signed-off-by: Yaliang Wu <[email protected]> * support work nodes string in old tasks Signed-off-by: Yaliang Wu <[email protected]> Signed-off-by: Yaliang Wu <[email protected]>
… (#769) * change task worker node to list; add target worker node to cache * fix target worker node field name * support work nodes string in old tasks Signed-off-by: Yaliang Wu <[email protected]>
Signed-off-by: Yaliang Wu [email protected]
Description
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.