You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "RongtongJin (via GitHub)" <gi...@apache.org> on 2025/09/18 10:53:49 UTC

[PR] refactor: replace RandomAccessFile with FileChannel [rocketmq]

RongtongJin opened a new pull request, #9715:
URL: https://github.com/apache/rocketmq/pull/9715

   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
   
   Fixes #issue_id
   
   ### Brief Description
   
   - Remove RandomAccessFile field and related logic completely
   - Use FileChannel for all write operations when writeWithoutMmap is enabled
   - Change SharedByteBuffer to use direct memory allocation (ByteBuffer.allocateDirect)
   - Add RunningFlags support for better error handling
   - Improve constructor design with better parameter handling
   - Fix SharedByteBuffer write operation to ensure correct byte count
   
   This change improves I/O performance by:
   1. Eliminating the overhead of RandomAccessFile
   2. Using direct memory allocation for better memory management
   3. Providing more consistent I/O operations through FileChannel
   4. Better error handling with RunningFlags integration
   
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
   


-- 
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@rocketmq.apache.org

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


Re: [PR] [ISSUE #9716] refactor: replace RandomAccessFile with FileChannel [rocketmq]

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin merged PR #9715:
URL: https://github.com/apache/rocketmq/pull/9715


-- 
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@rocketmq.apache.org

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


Re: [PR] refactor: replace RandomAccessFile with FileChannel [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #9715:
URL: https://github.com/apache/rocketmq/pull/9715#issuecomment-3306929482

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/9715?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `90.47619%` with `2 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 48.10%. Comparing base ([`73e8fdb`](https://app.codecov.io/gh/apache/rocketmq/commit/73e8fdbdb8b04282305ff579cf0901835bb983b5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`dbe670b`](https://app.codecov.io/gh/apache/rocketmq/commit/dbe670b00d9847e28d57cf2306bd0c7fda110d24?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/rocketmq/pull/9715?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ache/rocketmq/store/logfile/DefaultMappedFile.java](https://app.codecov.io/gh/apache/rocketmq/pull/9715?src=pr&el=tree&filepath=store%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fstore%2Flogfile%2FDefaultMappedFile.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2xvZ2ZpbGUvRGVmYXVsdE1hcHBlZEZpbGUuamF2YQ==) | 90.47% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/9715?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #9715      +/-   ##
   =============================================
   - Coverage      48.22%   48.10%   -0.13%     
   + Complexity     12167    12132      -35     
   =============================================
     Files           1313     1313              
     Lines          93238    93229       -9     
     Branches       11950    11946       -4     
   =============================================
   - Hits           44966    44847     -119     
   - Misses         42708    42805      +97     
   - Partials        5564     5577      +13     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq/pull/9715?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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@rocketmq.apache.org

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