phet commented on code in PR #3899:
URL: https://github.com/apache/gobblin/pull/3899#discussion_r1543638476
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManagementTaskStreamImpl.java:
##########
@@ -51,20 +70,33 @@ public class DagManagementTaskStreamImpl implements
DagManagement, DagTaskStream
@Inject(optional=true)
protected Optional<DagActionStore> dagActionStore;
- protected Optional<ReminderSettingDagProcLeaseArbiter>
reminderSettingDagProcLeaseArbiter;
+ protected MultiActiveLeaseArbiter dagActionProcessingLeaseArbiter;
+ protected Optional<DagActionReminderScheduler> dagActionReminderScheduler;
+ private final boolean isMultiActiveExecutionEnabled;
@Inject
private static final int MAX_HOUSEKEEPING_THREAD_DELAY = 180;
private final BlockingQueue<DagActionStore.DagAction> dagActionQueue = new
LinkedBlockingQueue<>();
+ private final String MISSING_OPTIONAL_ERROR_MESSAGE =
String.format("Multi-active execution enabled but required "
+ + "instance %s is absent.",
DagActionReminderScheduler.class.getSimpleName());
- // TODO: need to pass reference to DagProcLeaseArbiter without creating a
circular reference in Guice
@Inject
public DagManagementTaskStreamImpl(Config config, Optional<DagActionStore>
dagActionStore,
- Optional<ReminderSettingDagProcLeaseArbiter>
reminderSettingDagProcLeaseArbiter) {
+ @Named(ConfigurationKeys.PROCESSING_LEASE_ARBITER_NAME)
MultiActiveLeaseArbiter dagActionProcessingLeaseArbiter,
+ Optional<DagActionReminderScheduler> dagActionReminderScheduler,
+ @Named(InjectionNames.MULTI_ACTIVE_EXECUTION_ENABLED) boolean
isMultiActiveExecutionEnabled) {
this.config = config;
+ if (!dagActionStore.isPresent()) {
+ throw new RuntimeException("DagProcessingEngine should not be enabled
without dagActionStore enabled.");
+ }
Review Comment:
I suggested elsewhere to have this be non-`Optional`. if that's not
possible or desired, let's add a comment here explaining why. it's strange to
declare an `Optional` that isn't actually allowed to be
--
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]