Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob Download and Conversion (SIRI-1022) #2068

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,20 @@ public Optional<FileHandle> download(String blobKey, String variant) {
touch(blobKey);

try {
Tuple<String, Boolean> physicalKey = resolvePhysicalKey(blobKey, variant, false);
// first, attempt to resolve the physical key for the given blob and variant in a non-blocking manner; if
// the variant has been created before, independent of whether this node has conversion enabled, this will
// lead to a physical key that can be used to download the blob
Tuple<String, Boolean> physicalKey = resolvePhysicalKey(blobKey, variant, true);

// if a physical key cannot be determined, the blob has not yet been created in the requested variant; we
// now need to check if this node is allowed to perform the conversion itself; if so, we run the physical
// key lookup again in a blocking manner to ensure that the conversion is performed
if (conversionEnabled && physicalKey == null) {
physicalKey = resolvePhysicalKey(blobKey, variant, false);
}

// if the physical key is still null, this node is not allowed to perform the conversion itself or
// conversion on this node failed gracefully; in this case, we attempt to delegate the conversion
if (physicalKey == null) {
return tryDelegateDownload(blobKey, variant, MAX_CONVERSION_DELEGATE_ATTEMPTS);
}
Expand Down
Loading