You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2019/05/29 02:36:08 UTC

[GitHub] [incubator-gobblin] jhsenjaliya commented on a change in pull request #2653: [GOBBLIN-787] Add an option to include the task start time in the out…

jhsenjaliya commented on a change in pull request #2653: [GOBBLIN-787] Add an option to include the task start time in the out…
URL: https://github.com/apache/incubator-gobblin/pull/2653#discussion_r288372324
 
 

 ##########
 File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/fork/Fork.java
 ##########
 @@ -529,9 +529,18 @@ protected void cleanup() {
    */
   private DataWriter<Object> buildWriter()
       throws IOException {
+    String writerId = this.taskId;
+
+    // Add the task starting time if configured.
+    // This is used to reduce file name collisions which can happen due to the scheduling of a task on multiple workers.
+    // One case where this occurs is when a worker gets disconnected from a Helix cluster.
+    if (this.taskState.getPropAsBoolean(ConfigurationKeys.WRITER_ADD_TASK_TIMESTAMP, false)) {
+        writerId = this.taskId + "_" + this.taskState.getProp(ConfigurationKeys.TASK_START_TIME_MILLIS_KEY, "0");
 
 Review comment:
   minor : not sure if all task execution will always come from `GobblinMultiTaskAttempt.java`, so can it use `Long.toString(System.currentTimeMillis())` instead of "0" as default? Also do we have to put `TASK_START_TIME_MILLIS_KEY` while beginning the task? can it not be just any current time when it comes here if its configured? ( start time would be helpful for other metrics though) 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services