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

Conversation

jakobvogel
Copy link
Member

Description

When converting "virtual" blob information into physical keys, the framework generally distinguishes between blocking and non-blocking operation. In the former case, if a variant does not exist yet, the node is required to have conversion enabled as an exception would be thrown else. In the latter case of non-blocking operation, even on nodes with conversion enabled, no conversion would be attempted. This requires the invoker to explicitly deal with the case when conversion is required.

Before, the download method simply used a blocking call, obviously assuming that it would return a null object in case conversion is disabled. This assumption is wrong. We need to make sure that the current node has conversion enabled before invoking a blocking call. For nodes without conversion, we need to delegate immediately.

Note that there are several possible ways to implement this. We could also immediately check for whether conversion is enabled and directly resolve the physical key in a blocking manner. However, I personally consider the code as suggested more flexible, as it would allow to attempt to delegate even on a node with conversion if that conversion has failed gracefully for any reason.

Additional Notes

  • This PR fixes or works on following ticket(s): SIRI-1022

Checklist

  • Code change has been tested and works locally (as fast as as one can test this locally)
  • Code was formatted via IntelliJ and follows SonarLint & best practices

When converting "virtual" blob information into physical keys, the framework generally distinguishes between blocking and non-blocking operation. In the former case, if a variant does not exist yet, the node is required to have conversion enabled as an exception would be thrown else. In the latter case of non-blocking operation, even on nodes with conversion enabled, no conversion would be attempted. This requires the invoker to explicitly deal with the case when conversion is required.

Before, the `download` method simply used a blocking call, obviously assuming that it would return a `null` object in case conversion is disabled. This assumption is wrong. We need to make sure that the current node has conversion enabled before invoking a blocking call. For nodes without conversion, we need to delegate immediately.

Note that there are several possible ways to implement this. We could also immediately check for whether conversion is enabled and directly resolve the physical key in a blocking manner. However, I personally consider the code as suggested more flexible, as it would allow to attempt to delegate even on a node with conversion if that conversion has failed gracefully for any reason.

SIRI-1022
@jakobvogel jakobvogel added the 🐛 Bugfix Contains only a small fix for an existing bug label Dec 18, 2024
@idlira idlira merged commit 358ae5b into develop Dec 19, 2024
4 checks passed
@idlira idlira deleted the feature/jvo/SIRI-1022-Blob-Conversion branch December 19, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bugfix Contains only a small fix for an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants