GWphua opened a new pull request, #18489:
URL: https://github.com/apache/druid/pull/18489

   ### Description
   
   <!-- Describe the goal of this PR, what problem are you fixing. If there is 
a corresponding issue (referenced above), it's not necessary to repeat the 
description here, however, you may choose to keep one summary sentence. -->
   
   <!-- Describe your patch: what did you change in code? How did you fix the 
problem? -->
   
   <!-- If there are several relatively logically separate changes in this PR, 
create a mini-section for each of them. For example: -->
   
   #### Concurrent loading of cached segments during startup
   
   Previously, we are using 1 thread to run 
`SegmentLocalCacheManager#getCachedSegments`. We may take quite a bit of time 
if the number of segments is large. 
   
   We can do better by multithreading using `loadOnBootstrapExec`, and speed up 
segment retrieval. 
   
   #### Refactoring
   - Create segmentsToLoad array via extracted method: 
`retrieveSegmentMetadataFiles`.
   - Extract logic to load segments into `addFilesToCachedSegments`
   
   #### Log Changes
   - Add stopwatch to report time taken to load cached segments.
   - Removed log "Loading segment cache file [%d/%d][%s]." to remove log 
clutter, stopwatch will help to handle this better. (It was annoying to 
navigate ~100k lines of this when looking through logs)
   
   #### Release note
   <!-- Give your best effort to summarize your changes in a couple of 
sentences aimed toward Druid users. 
   
   If your change doesn't have end user impact, you can skip this section.
   
   For tips about how to write a good release note, see [Release 
notes](https://github.com/apache/druid/blob/master/CONTRIBUTING.md#release-notes).
   
   -->
   
   Speed up load of cached segments during Historical startup.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `SegmentLocalCacheManager`
    * `SegmentCacheManager` + Relevant implementations.
   
   <hr>
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not 
all of these items apply to every PR. Remove the items which are not done or 
not relevant to the PR. None of the items from the checklist below are strictly 
necessary, but it would be very helpful if you at least self-review the PR. -->
   
   This PR has:
   
   - [x] been self-reviewed.
      - [ ] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [x] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] been tested in a test Druid cluster. (TBD)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to