[GOBBLIN-2027] move DagActionStore, MultiActiveLeaseArbiter and their implementation/test classes from gobblin-runtime to gobblin-service#3904
Conversation
move LeaseAttemptStatus out of MultiActiveLeaseArbiter interface
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3904 +/- ##
============================================
- Coverage 46.61% 46.60% -0.02%
+ Complexity 11219 11216 -3
============================================
Files 2241 2241
Lines 88342 88344 +2
Branches 9673 9673
============================================
- Hits 41184 41169 -15
- Misses 43447 43465 +18
+ Partials 3711 3710 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
phet
left a comment
There was a problem hiding this comment.
looks really good... just some minor feedback
also, are you thinking to make any of the other mods suggested here into a third PR? such as:
- reworking DagProc to remove the type param and perhaps the commit method too
- changing the KJSM::addJobStatusToStateStore method (as suggested below)
- (and similar)
| } | ||
| try { | ||
| MultiActiveLeaseArbiter.LeaseAttemptStatus leaseAttemptStatus = null; | ||
| LeaseAttemptStatus leaseAttemptStatus = null; |
There was a problem hiding this comment.
since they're part and parcel of the MALA abstraction, I'd personally keep these as static inner classes. did you find a particular motivation to move them?
either way is not a big deal actually...
There was a problem hiding this comment.
The only motivation was that there were too many (inner) classes in one file, total 4.
and to access LeaseObtainedStatus, one would have to write MultiActiveLeaseArbiter.LeaseObtainedStatus while imo LeaseAttemptStatus.LeaseObtainedStatus makes more sense, because it is closer to LeaseObtainedStatus than to MultiActiveLeaseArbiter
...ain/java/org/apache/gobblin/service/monitoring/DagManagementDagActionStoreChangeMonitor.java
Outdated
Show resolved
Hide resolved
...rvice/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java
Outdated
Show resolved
Hide resolved
...rvice/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java
Outdated
Show resolved
Hide resolved
...rvice/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java
Show resolved
Hide resolved
| current LeaseObtainedStatus via the completeLease method from a caller without access to the {@link MultiActiveLeaseArbiter}. | ||
| */ | ||
| @Data | ||
| public static class LeaseObtainedStatus extends LeaseAttemptStatus { |
There was a problem hiding this comment.
it's atypical to have a derived class defined inside the class it's extending. is this borne of a desire to keep these all together, rather than having a separate top-level file for each?
(I do agree that separating into four separate files would be far less comprehensible.)
honestly, what I liked about having these defined inside MultiActiveLeaseArbiter was that they lived all together (as they do here) AND that they also all resided alongside the sole abstraction that uses them (the MALA itself).
There was a problem hiding this comment.
I agree that it's much easier to understand these classes when lie together in one file. I am okay with them being separated from the MALA file since removing the prefix from every place they are used makes code more readable and concise.
There was a problem hiding this comment.
After thinking about the structure, here's my opinion,
It maybe (?) atypical for a derived class be inside the parent class, but it looks more atypical for an interface to contain an abstract parent class and extended classes.
Being able to write LeaseAttemptStatus.LeaseObtainedStatus looked like a determining factor for choosing this structure. This is like how enums are addressed too.
phet
left a comment
There was a problem hiding this comment.
actually, seems you're moving more than just DagActionStore, so title of commit/PR could be updated
| current LeaseObtainedStatus via the completeLease method from a caller without access to the {@link MultiActiveLeaseArbiter}. | ||
| */ | ||
| @Data | ||
| public static class LeaseObtainedStatus extends LeaseAttemptStatus { |
There was a problem hiding this comment.
I agree that it's much easier to understand these classes when lie together in one file. I am okay with them being separated from the MALA file since removing the prefix from every place they are used makes code more readable and concise.
|
I agree with renaming the PR bc most of the changes are related to moving LeaseAttemptStatus to its own file. Let's also add javadoc for NoLongerLeasing |
...rvice/src/main/java/org/apache/gobblin/service/modules/orchestration/LeaseAttemptStatus.java
Outdated
Show resolved
Hide resolved
...ain/java/org/apache/gobblin/service/monitoring/DagManagementDagActionStoreChangeMonitor.java
Outdated
Show resolved
Hide resolved
5fc2942 to
49aa9ac
Compare
move LeaseAttemptStatus out of MultiActiveLeaseArbiter interface
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
This PR will move DagActionStore, MultiActiveLeaseArbiter and their implementation/test classes from gobblin-runtime to gobblin-service module, because DagAction is a concept used exclusively in Gobblin Service, not in core gobblin.
Also move
LeaseAttemptStatusout ofMultiActiveLeaseArbiterclass.This change also helped add a method
getDagNodeId()inDagActionclass, which would otherwise not be possible due to circular dependencies between the modules.Tests
Commits