Skip to content

improve FileWriteOutBytes.readFully#12323

Merged
clintropolis merged 2 commits intoapache:masterfrom
clintropolis:optimize-file-writeout-bytes-readfully
Mar 9, 2022
Merged

improve FileWriteOutBytes.readFully#12323
clintropolis merged 2 commits intoapache:masterfrom
clintropolis:optimize-file-writeout-bytes-readfully

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Description

Improves the performance of FileWriteOutBytes.readFully by using the tracked byte size added in #9722, instead of calling the channel size() method, which ends up in a native syscall to check the size of the file on disk. This readFully method is used by GenericIndexedWriter.get which is currently only used when merging spatial indexes, but would be an improvement for anything looking to read stuff out of the channel.

This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.

@clintropolis clintropolis merged commit dc0372a into apache:master Mar 9, 2022
@clintropolis clintropolis deleted the optimize-file-writeout-bytes-readfully branch March 9, 2022 19:45
TSFenwick pushed a commit to TSFenwick/druid that referenced this pull request Apr 11, 2022
* improve FileWriteOutBytes.readFully

* no need to flush if out of bounds
@abhishekagarwal87 abhishekagarwal87 added this to the 0.23.0 milestone May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants