You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/04/09 03:05:56 UTC

[GitHub] [incubator-inlong] huzk8 opened a new pull request, #3588: [INLONG-3587]auto close file resource

huzk8 opened a new pull request, #3588:
URL: https://github.com/apache/incubator-inlong/pull/3588

   
   
   Fixes #3587 
   
   ### Motivation
   
   fix bug.
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] healchow commented on a diff in pull request #3588: [INLONG-3587][Agent] Auto close file resource after list

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #3588:
URL: https://github.com/apache/incubator-inlong/pull/3588#discussion_r846569042


##########
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/trigger/DirectoryTrigger.java:
##########
@@ -159,9 +159,11 @@ private void registerNewDir(PathPattern entity,
                 LOGGER.info("overflow got {}", parentPath);
                 // check whether parent path is valid.
                 if (Files.isDirectory(parentPath)) {
-                    for (Iterator<Path> it = Files.list(parentPath).iterator(); it.hasNext();) {
-                        Path childPath = it.next();
-                        registerAllSubDir(entity, parentPath.resolve(childPath), tmpWatchers);
+                    try(final Stream<Path> pathStream = Files.list(parentPath)) {

Review Comment:
   Please refer to the link <https://github.com/apache/incubator-inlong/discussions/3082> to set your code style, then pull the request again.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] dockerzhang commented on pull request #3588: [INLONG-3587][Agent] Auto close file resource after list

Posted by GitBox <gi...@apache.org>.
dockerzhang commented on PR #3588:
URL: https://github.com/apache/incubator-inlong/pull/3588#issuecomment-1094300389

   @huzk8 https://github.com/apache/incubator-inlong/runs/5952307096?check_suite_focus=true
   ```
   [INFO] 开始检查……
   Error:  /home/runner/work/incubator-inlong/incubator-inlong/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/trigger/DirectoryTrigger.java:162:21: WhitespaceAround: 'try' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3) [WhitespaceAround]
   检查完成。
   [INFO] There is 1 error reported by Checkstyle 8.29 with codestyle/checkstyle.xml ruleset.
   Error:  src/main/java/org/apache/inlong/agent/plugin/trigger/DirectoryTrigger.java:[162,21] (whitespace) WhitespaceAround: WhitespaceAround: 'try' is not followed by whitespace. Empty blocks may only be represented as {} when not part of a multi-block statement (4.1.3)
   ```


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] dockerzhang merged pull request #3588: [INLONG-3587][Agent] Auto close file resource after list

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #3588:
URL: https://github.com/apache/incubator-inlong/pull/3588


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-inlong] dockerzhang commented on pull request #3588: [INLONG-3587][Agent] Auto close file resource after list

Posted by GitBox <gi...@apache.org>.
dockerzhang commented on PR #3588:
URL: https://github.com/apache/incubator-inlong/pull/3588#issuecomment-1094974329

   @EMsnap PTAL, thanks.


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org