umustafi commented on code in PR #3890:
URL: https://github.com/apache/gobblin/pull/3890#discussion_r1523940641
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/MultiActiveLeaseArbiter.java:
##########
@@ -82,15 +82,24 @@ abstract class LeaseAttemptStatus {}
class NoLongerLeasingStatus extends LeaseAttemptStatus {}
+
+ /** `j.u.Function` variant for an operation that may @throw IOException */
+ @FunctionalInterface
+ interface FunctionMayThrowIO<T, R> {
+ R apply(T t) throws IOException;
+ }
+
/*
The participant calling this method acquired the lease for the event in
question. `Flow action`'s flow execution id
is the timestamp associated with the lease and the time the caller obtained
the lease is stored within the
- `leaseAcquisitionTimestamp` field.
+ `leaseAcquisitionTimestamp` field. `completeLeaseRunnable` is a reference to
a method that will recordLeaseSuccess
+ for the current LeaseObtainedStatus from a caller without access to the
{@link MultiActiveLeaseArbiter}
*/
@Data
class LeaseObtainedStatus extends LeaseAttemptStatus {
private final DagActionStore.DagAction flowAction;
private final long leaseAcquisitionTimestamp;
+ protected final FunctionMayThrowIO<LeaseObtainedStatus, Boolean>
completeLeaseRunnable;
Review Comment:
Ah I did want to make the MALA reference as inaccessible as possible. It is
simpler to keep a reference to it like you're suggesting with access level
None. Updated code
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]