[ 
https://issues.apache.org/jira/browse/GOBBLIN-846?focusedWorklogId=291568&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-291568
 ]

ASF GitHub Bot logged work on GOBBLIN-846:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Aug/19 20:39
            Start Date: 08/Aug/19 20:39
    Worklog Time Spent: 10m 
      Work Description: sv2000 commented on pull request #2701: GOBBLIN-846: 
Enhance LogCopier service to handle continuous YARN log …
URL: https://github.com/apache/incubator-gobblin/pull/2701#discussion_r312232832
 
 

 ##########
 File path: 
gobblin-utility/src/main/java/org/apache/gobblin/util/logs/LogCopier.java
 ##########
 @@ -536,14 +521,15 @@ private void copyChangesOfLogFile(Path srcFile, Path 
destFile) throws IOExceptio
 
       try (Closer closer = Closer.create()) {
         fsDataInputStream = 
closer.register(LogCopier.this.srcFs.open(srcFile));
-        // Seek to the the most recent position if it is available
-        LOGGER.debug(String.format("Reading log file %s from position %d", 
srcFile, this.currentPos));
-        fsDataInputStream.seek(this.currentPos);
         BufferedReader srcLogFileReader = closer.register(
             new BufferedReader(new InputStreamReader(fsDataInputStream, 
ConfigurationKeys.DEFAULT_CHARSET_ENCODING)));
 
-        FSDataOutputStream outputStream = 
LogCopier.this.destFs.exists(destFile)
-            ? LogCopier.this.destFs.append(destFile) : 
LogCopier.this.destFs.create(destFile);
+        //If file already exists, delete and re-copy the file.
+        if (LogCopier.this.destFs.exists(destFile)) {
+          LogCopier.this.destFs.delete(destFile, false);
+        }
+
+        FSDataOutputStream outputStream = 
LogCopier.this.destFs.create(destFile);
 
 Review comment:
   This should not happen. The set of files to copy in each iteration does not 
have duplicates. Further, each iteration finishes only when all copy tasks 
complete. So we should not have a situation where two or more threads to copy 
the same file.
 
----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 291568)
    Time Spent: 1h 10m  (was: 1h)

> Enhance LogCopier service to handle continuous YARN log aggregation
> -------------------------------------------------------------------
>
>                 Key: GOBBLIN-846
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-846
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-yarn
>    Affects Versions: 0.15.0
>            Reporter: Sudarshan Vasudevan
>            Assignee: Abhishek Tiwari
>            Priority: Major
>             Fix For: 0.15.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> This task enhances LogCopier service to perform continuous log aggregation 
> for long-running Gobblin-on-Yarn applications. It periodically copies rolled 
> container logs to a specified location on HDFS. The "current" log file is 
> copied in the end as part of the service shutdown sequence. 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to