phet commented on code in PR #3899:
URL: https://github.com/apache/gobblin/pull/3899#discussion_r1540626407
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManagementTaskStreamImpl.java:
##########
@@ -108,6 +132,36 @@ public DagTask next() {
return null;
}
+ /**
+ * Returns a {@link
org.apache.gobblin.runtime.api.MultiActiveLeaseArbiter.LeaseAttemptStatus}
associated with the
+ * `dagAction`. If in multi-active execution mode, it retrieves the status
from calling
+ * {@link MultiActiveLeaseArbiter#tryAcquireLease(DagActionStore.DagAction,
long, boolean, boolean)}, otherwise
+ * it returns a {@link
org.apache.gobblin.runtime.api.MultiActiveLeaseArbiter.LeaseObtainedStatus}
that will not
+ * expire for a very long time to the current instance.
+ * @param dagAction
+ * @return
+ * @throws IOException
+ * @throws SchedulerException
+ */
+ private MultiActiveLeaseArbiter.LeaseAttemptStatus
retrieveLeaseStatus(DagActionStore.DagAction dagAction)
+ throws IOException, SchedulerException {
+ MultiActiveLeaseArbiter.LeaseAttemptStatus leaseAttemptStatus;
+ if (!this.isMultiActiveExecutionEnabled) {
+ leaseAttemptStatus = new
MultiActiveLeaseArbiter.LeaseObtainedStatus(dagAction,
System.currentTimeMillis(), Long.MAX_VALUE, null);
Review Comment:
let's keep the code simple by using an alternative MALA rather than directly
faking a `LeaseObtainedStatus`.
really, that's the power of DI!
--
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]