feat: add load_to_cache
field in preheat request using Open API
#3838
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A new
load_to_cache
field has been added to the OpenAPI format to indicate whether to write the downloaded piece content to the user-space cache. This field is a Boolean type. Users can set it to true to cache the content locally to improve subsequent access efficiency. If it is set to false, no caching will be performed.Related Issue
#3742
Motivation and Context
Purpose
This change enhances control over the caching behavior during preheating, allowing for optimization of data retrieval. By using the
LoadToCache
field, users can decide whether to store the downloaded content in cache memory, improving performance for repeated access.Changes:
internal/job/types.go
, a new boolean field LoadToCache has been added to the PreheatRequest struct, indicating whether the content should be cached.manager/types/job.go
, the PreheatArgs struct now includes the LoadToCache field to handle the preheating caching behavior.scheduler/job/job.go
, the LoadToCache field is integrated into the preheating job execution, ensuring that the preheating behavior respects the cache flag.manager/job/preheat.go
, the CreatePreheat method now passes the LoadToCache flag in the request, ensuring that the cache option is handled during the preheating process.preheatAllSeedPeers
,preheatAllPeers
, andpreheatV2
) inscheduler/job/job.go
have been updated to incorporate the LoadToCache field when executing preheating operations.Screenshots (if appropriate)
Types of changes
Checklist