-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Do not put data to ETCD when no date is changed. #5291
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
Conversation
|
||
def canEqual(a: Any) = a.isInstanceOf[InvokerResourceMessage] | ||
|
||
override def equals(that: Any): Boolean = |
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.
The data management service compares the message to decide whether to put data or not.
https://github.com/apache/openwhisk/blob/master/common/scala/src/main/scala/org/apache/openwhisk/core/service/DataManagementService.scala#L161
So we need to override the equals
method to make it compare messages with ==
.
Codecov Report
@@ Coverage Diff @@
## master #5291 +/- ##
==========================================
- Coverage 79.91% 75.32% -4.59%
==========================================
Files 238 238
Lines 14161 14199 +38
Branches 603 577 -26
==========================================
- Hits 11317 10696 -621
- Misses 2844 3503 +659
Help us with your feedback. Take ten seconds to tell us how you rate us. |
override def equals(that: Any): Boolean = | ||
that match { | ||
case that: InvokerResourceMessage => { | ||
that.canEqual(this) && |
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.
I think isInstanceOf
is not required after using the case match?
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.
Good.
Updated accordingly.
override def equals(that: Any): Boolean = | ||
that match { | ||
case that: SchedulerStates => { | ||
that.canEqual(this) && |
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.
doesn't required either
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.
Updated.
@jiangpengcheng If you have no comment, I would merge this. |
Description
Schedulers and invokers periodically publish their states to ETCD but when no data is changed, we don't need to keep sending the same request to ETCD.
This is not to put data to ETCD when no data is changed.
Related issue and scope
My changes affect the following components
Types of changes
Checklist: