You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/23 10:21:43 UTC

[GitHub] [kafka] divijvaidya opened a new pull request, #12197: KAFKA-13929: Replace legacy File.createNewFile() with NIO.2 Files.createFile()

divijvaidya opened a new pull request, #12197:
URL: https://github.com/apache/kafka/pull/12197

   `File.createNewFile()` returns a boolean signifying whether the file creation was successful or not. There are multiple places in the Kafka code base where we are not checking the value of the returned boolean.
   
   Replacing it with the Files.createFile() API will decrease the chances of inadvertent bugs in the code base since Files.createFile() API thrown exceptions when the creation is not successful.
   
   Note that this is one of many PRs which would help us leverage new features introduced in NIO.2 Java APIs. The parent task is listed at https://issues.apache.org/jira/browse/KAFKA-13928
   


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] mimaison commented on pull request #12197: KAFKA-13929: Replace legacy File.createNewFile() with NIO.2 Files.createFile()

Posted by GitBox <gi...@apache.org>.
mimaison commented on PR #12197:
URL: https://github.com/apache/kafka/pull/12197#issuecomment-1141333932

   Thanks @divijvaidya for the PR!
   
   Should we also update this instance https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/log/AbstractIndex.scala#L110 ?


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] divijvaidya commented on pull request #12197: KAFKA-13929: Replace legacy File.createNewFile() with NIO.2 Files.createFile()

Posted by GitBox <gi...@apache.org>.
divijvaidya commented on PR #12197:
URL: https://github.com/apache/kafka/pull/12197#issuecomment-1141344082

   > Thanks @divijvaidya for the PR!
   > 
   > Should we also update this instance https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/log/AbstractIndex.scala#L110 ?
   
   @mimaison I am going to address that code block in a separate PR along with replacement of RandomAccessFile with newer (SeekableByteChannel) APIs. This code block also requires some refactoring since we have code logic which relies on whether a new file was created or not. I will prefer to pick this file separately. 


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] divijvaidya commented on pull request #12197: KAFKA-13929: Replace legacy File.createNewFile() with NIO.2 Files.createFile()

Posted by GitBox <gi...@apache.org>.
divijvaidya commented on PR #12197:
URL: https://github.com/apache/kafka/pull/12197#issuecomment-1149992127

   @mimaison please take another look at it! 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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] mimaison merged pull request #12197: KAFKA-13929: Replace legacy File.createNewFile() with NIO.2 Files.createFile()

Posted by GitBox <gi...@apache.org>.
mimaison merged PR #12197:
URL: https://github.com/apache/kafka/pull/12197


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] divijvaidya commented on pull request #12197: KAFKA-13929: Replace legacy File.createNewFile() with NIO.2 Files.createFile()

Posted by GitBox <gi...@apache.org>.
divijvaidya commented on PR #12197:
URL: https://github.com/apache/kafka/pull/12197#issuecomment-1134867088

   @hachikuji @mimaison perhaps you folks would be interested to look into this code improvement?


-- 
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: jira-unsubscribe@kafka.apache.org

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