You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "kaijchen (via GitHub)" <gi...@apache.org> on 2023/01/30 07:37:23 UTC
[GitHub] [incubator-uniffle] kaijchen opened a new pull request, #520: [Refactor] Change abstract class Checker to interface
kaijchen opened a new pull request, #520:
URL: https://github.com/apache/incubator-uniffle/pull/520
### What changes were proposed in this pull request?
1. Change abstract class Checker to interface.
2. Remove spotbugs exclusion `URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD`.
### Why are the changes needed?
Cleanup code.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #520: [SpotBugs] Ignore URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD in Checker
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#issuecomment-1408198415
# [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#520](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b6dd573) into [master](https://codecov.io/gh/apache/incubator-uniffle/commit/b80972c226a3afd5568555a9a76fe3bb70ed3d9b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b80972c) will **increase** coverage by `0.74%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #520 +/- ##
============================================
+ Coverage 59.76% 60.51% +0.74%
+ Complexity 1768 1635 -133
============================================
Files 205 192 -13
Lines 11531 10255 -1276
Branches 1033 911 -122
============================================
- Hits 6892 6206 -686
+ Misses 4233 3673 -560
+ Partials 406 376 -30
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...c/main/java/org/apache/uniffle/server/Checker.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9DaGVja2VyLmphdmE=) | `100.00% <ø> (ø)` | |
| [...storage/handler/impl/DataSkippableReadHandler.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmFnZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvdW5pZmZsZS9zdG9yYWdlL2hhbmRsZXIvaW1wbC9EYXRhU2tpcHBhYmxlUmVhZEhhbmRsZXIuamF2YQ==) | `83.78% <0.00%> (-2.71%)` | :arrow_down: |
| [...apache/hadoop/mapreduce/v2/app/RssMRAppMaster.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL3YyL2FwcC9Sc3NNUkFwcE1hc3Rlci5qYXZh) | | |
| [.../java/org/apache/hadoop/mapreduce/RssMRConfig.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL1Jzc01SQ29uZmlnLmphdmE=) | | |
| [...preduce/task/reduce/RssRemoteMergeManagerImpl.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL3Rhc2svcmVkdWNlL1Jzc1JlbW90ZU1lcmdlTWFuYWdlckltcGwuamF2YQ==) | | |
| [...mapreduce/task/reduce/RssInMemoryRemoteMerger.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL3Rhc2svcmVkdWNlL1Jzc0luTWVtb3J5UmVtb3RlTWVyZ2VyLmphdmE=) | | |
| [.../hadoop/mapreduce/task/reduce/RssBypassWriter.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL3Rhc2svcmVkdWNlL1Jzc0J5cGFzc1dyaXRlci5qYXZh) | | |
| [...n/java/org/apache/hadoop/mapreduce/RssMRUtils.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL1Jzc01SVXRpbHMuamF2YQ==) | | |
| [...n/java/org/apache/hadoop/mapreduce/MRIdHelper.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL01SSWRIZWxwZXIuamF2YQ==) | | |
| [...java/org/apache/hadoop/mapred/SortWriteBuffer.java](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkL1NvcnRXcml0ZUJ1ZmZlci5qYXZh) | | |
| ... and [5 more](https://codecov.io/gh/apache/incubator-uniffle/pull/520?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #520: [Refactor] Change abstract class Checker to interface
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#discussion_r1090262266
##########
server/src/main/java/org/apache/uniffle/server/Checker.java:
##########
@@ -17,13 +17,6 @@
package org.apache.uniffle.server;
-public abstract class Checker {
-
- protected ShuffleServerConf conf;
-
- Checker(ShuffleServerConf conf) {
- this.conf = conf;
- }
-
- abstract boolean checkIsHealthy();
+public interface Checker {
Review Comment:
Rename to `StorageChecker` ? And this part could be moved into Storage's checker package? WDYT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #520: [SpotBugs] Ignore URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD in Checker
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#discussion_r1090393311
##########
server/src/main/java/org/apache/uniffle/server/Checker.java:
##########
@@ -17,8 +17,11 @@
package org.apache.uniffle.server;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
public abstract class Checker {
+ @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
protected ShuffleServerConf conf;
Review Comment:
seems like this conf is never used?
We could delete this field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on pull request #520: [SpotBugs] Remove unread protected field in Checker
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#issuecomment-1409881034
Thanks @kaijchen
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #520: [Refactor] Change abstract class Checker to interface
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#discussion_r1090264853
##########
server/src/main/java/org/apache/uniffle/server/Checker.java:
##########
@@ -17,13 +17,6 @@
package org.apache.uniffle.server;
-public abstract class Checker {
-
- protected ShuffleServerConf conf;
-
- Checker(ShuffleServerConf conf) {
- this.conf = conf;
- }
-
- abstract boolean checkIsHealthy();
+public interface Checker {
Review Comment:
And why we need to change this class to interface? It looks fine for me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy merged pull request #520: [SpotBugs] Remove unread protected field in Checker
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy merged PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] kaijchen commented on a diff in pull request #520: [Refactor] Change abstract class Checker to interface
Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen commented on code in PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#discussion_r1090276313
##########
server/src/main/java/org/apache/uniffle/server/Checker.java:
##########
@@ -17,13 +17,6 @@
package org.apache.uniffle.server;
-public abstract class Checker {
-
- protected ShuffleServerConf conf;
-
- Checker(ShuffleServerConf conf) {
- this.conf = conf;
- }
-
- abstract boolean checkIsHealthy();
+public interface Checker {
Review Comment:
> Rename to `StorageChecker` ? And this part could be moved into Storage's checker package? WDYT
`HealthCheck` is also in `org.apache.uniffle.server`, should we move that too?
> And why we need to change this class to interface? It looks fine for me.
The protected field `conf` is never read. But seems the failed test is relying on constructor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] kaijchen commented on a diff in pull request #520: [Refactor] Change abstract class Checker to interface
Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen commented on code in PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#discussion_r1090276313
##########
server/src/main/java/org/apache/uniffle/server/Checker.java:
##########
@@ -17,13 +17,6 @@
package org.apache.uniffle.server;
-public abstract class Checker {
-
- protected ShuffleServerConf conf;
-
- Checker(ShuffleServerConf conf) {
- this.conf = conf;
- }
-
- abstract boolean checkIsHealthy();
+public interface Checker {
Review Comment:
> Rename to `StorageChecker` ? And this part could be moved into Storage's checker package? WDYT
`HealthCheck` is also in `org.apache.uniffle.server`, should we move that also?
> And why we need to change this class to interface? It looks fine for me.
The protected field `conf` is never read. But seems the failed test is relying on constructor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] kaijchen commented on a diff in pull request #520: [SpotBugs] Ignore URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD in Checker
Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen commented on code in PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#discussion_r1090400374
##########
server/src/main/java/org/apache/uniffle/server/Checker.java:
##########
@@ -17,8 +17,11 @@
package org.apache.uniffle.server;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
public abstract class Checker {
+ @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
protected ShuffleServerConf conf;
Review Comment:
It looks strange to have a constructor like this:
```java
Checker(ShuffleServerConf conf) {
// do nothing
}
```
Changing `Checker` to interface breaks the signature assumption of the constructor: https://github.com/apache/incubator-uniffle/commit/f159cc6b9b61e0ba46155bd6a47268fe0befd85c
Do you have a better idea?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #520: [SpotBugs] Remove unread protected field in Checker
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#discussion_r1090525332
##########
server/src/main/java/org/apache/uniffle/server/Checker.java:
##########
@@ -17,8 +17,11 @@
package org.apache.uniffle.server;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
public abstract class Checker {
+ @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
protected ShuffleServerConf conf;
Review Comment:
An abstract class has an empty constructor is ok.
However it's also possible to provide checker as an interface, then a `AbstractChecker` with the one parameter constructor.
something like
```
// Checker.java
public interface Checker {
boolean checkIsHealthy();
}
// AbstractChecker.java
public abstract class AbstractChecker implements Checker {
AbstractChecker(ShuffleServerConf conf) {}
}
```
All the subclass of checker should extends `AbstractChecker`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] kaijchen commented on pull request #520: [SpotBugs] Remove unread protected field in Checker
Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen commented on PR #520:
URL: https://github.com/apache/incubator-uniffle/pull/520#issuecomment-1410224833
Ref #532
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org