homatthew commented on code in PR #3910:
URL: https://github.com/apache/gobblin/pull/3910#discussion_r1548296932


##########
gobblin-core-base/src/main/java/org/apache/gobblin/source/extractor/extract/FlushingExtractor.java:
##########
@@ -129,6 +134,21 @@ public FlushingExtractor(WorkUnitState state) {
     initFlushPublisher();
     MetricContextUtils.registerGauge(this.getMetricContext(), 
WATERMARK_COMMIT_TIME_METRIC, this.watermarkCommitTime);
     initCommitStepMetrics(this.preCommitSteps, this.postCommitSteps);
+
+    if (state.getPropAsBoolean(WRITER_OUTPUT_DIR_UPDATE_ENABLED, false)) {

Review Comment:
   I think context is important when adding this flag. Make sure to add a short 
java doc to the public constant.
   
   And in my opinion, a loud failure for workunits that are missing the task 
attempt id and writer output dir is more appropriate. Since in the current 
state, it would silently fail, and we wouldn't know if something was 
misconfigured.
   
   I.e. something like
   ```
   Preconditions.checkArguments(workunitState.contains(TASK_ATTEMPT_ID_KEY), 
String.format("work unit state must contain %s because %s is enabled", 
WRITER_OUTPUT_DIR_UPDATE_ENABLED"));
   Preconditions.checkArguments(workunitState.contains(WRITER_OUTPUT_DIR), 
String.format("work unit state must contain %s because %s is enabled", 
WRITER_OUTPUT_DIR, WRITER_OUTPUT_DIR_UPDATE_ENABLED"));
   ```



-- 
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]

Reply via email to