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

OAK-11267 - Upgrade Azure SDK V8 to V12 for oak-blob-azure #1861

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

andreeastroe96
Copy link

No description provided.

@kwin
Copy link
Member

kwin commented Nov 13, 2024

Every larger PR needs a JIRA ticket in https://issues.apache.org/jira/projects/OAK!

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public final class UtilsV12 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the classes with version v8 should have in the name V8 and the classes with the new version (v 12) should have the name with no version

@andreeastroe96
Copy link
Author

Every larger PR needs a JIRA ticket in https://issues.apache.org/jira/projects/OAK!

Hi! I linked this PR with this JIRA issue: https://issues.apache.org/jira/browse/OAK-11267 . Please let me know if something else is required.

@kwin
Copy link
Member

kwin commented Nov 13, 2024

Every larger PR needs a JIRA ticket in https://issues.apache.org/jira/projects/OAK!

Hi! I linked this PR with this JIRA issue: https://issues.apache.org/jira/browse/OAK-11267 . Please let me know if something else is required.

Please read https://jackrabbit.apache.org/oak/docs/participating.html. Currently the commit message does not reference the Oak issue.

@andreeastroe96 andreeastroe96 changed the title GRANITE-53956 Upgrade Azure SDK V8 to V12 for oak-blob-azure OAK-11267 - Upgrade Azure SDK V8 to V12 for oak-blob-azure Nov 13, 2024
@anchela
Copy link
Contributor

anchela commented Nov 13, 2024

@kwin , maybe it's just style.... but to me your review comments don't come across as welcoming (see https://apache.org/foundation/policies/conduct). @andreeastroe96 is a new contributor to the project and there is IMHO no need to be angry... a friendly reminder will do magic.

@kwin
Copy link
Member

kwin commented Nov 13, 2024

@anchela You are right.
@andreeastroe96 Sorry, if I came across rude. That was not intended. Just be aware that this is the ASF Jackrabbit context so neither AEM nor GRANITE nor any other restricted references should be used here for everyone to be able to follow/review accordingly. Thanks.

private Properties properties;
private AzureBlobContainerProvider azureBlobContainerProvider;
private int concurrentRequestCount = DEFAULT_CONCURRENT_REQUEST_COUNT;
private RetryPolicy retryPolicy;
private RequestRetryOptions retryOptions;
private Integer requestTimeout;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not used anymore.

}
requestOptions.setConcurrentRequestCount(concurrentRequestCount);
if (enableSecondaryLocation) {
requestOptions.setLocationMode(LocationMode.PRIMARY_THEN_SECONDARY);
Copy link

@ierandra ierandra Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you removed the secondary location concept. How was this implemented in azure sdk v12 ? because I cannot see it anywhere


enableSecondaryLocation = PropertiesUtil.toBoolean(
boolean enableSecondaryLocation = PropertiesUtil.toBoolean(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this used?

@@ -199,19 +169,18 @@ public void init() throws DataStoreException {
}
LOG.info("Using concurrentRequestsPerOperation={}", concurrentRequestCount);

retryPolicy = Utils.getRetryPolicy(properties.getProperty(AzureConstants.AZURE_BLOB_MAX_REQUEST_RETRY));
retryOptions = Utils.getRetryOptions(properties.getProperty(AzureConstants.AZURE_BLOB_MAX_REQUEST_RETRY));
if (properties.getProperty(AzureConstants.AZURE_BLOB_REQUEST_TIMEOUT) != null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this check here since requestTimeout is not use anywhere?

if (!blob.exists()) {
addLastModified(blob);

BlobRequestOptions options = new BlobRequestOptions();
options.setConcurrentRequestCount(concurrentRequestCount);
Copy link

@ierandra ierandra Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you removed this and didn't replaced in azure sdk 12. you can use com.azure.storage.blob.models.ParallelTransferOptions and BlockBlobClient.uploadWithResponse

@@ -807,22 +677,26 @@ private static String stripMetaKeyPrefix(String name) {
return name;
}

private static void addLastModified(CloudBlockBlob blob) {
blob.getMetadata().put(LAST_MODIFIED_KEY, String.valueOf(System.currentTimeMillis()));
private static void addLastModified(BlockBlobClient blockBlobClient) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the method name is not what actually does

httpDownloadURIExpirySeconds,
headers,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed?

Copy link
Author

@andreeastroe96 andreeastroe96 Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the comments on the V8 version:

/* set empty headers as blank string due to a bug in Azure SDK
* Azure SDK considers null headers as 'null' string which corrupts the string to sign and generates an invalid
* sas token
* */

those headers were empty due to a bug in the Azure SDK.
I read in the documentation that the bug was solved in azure sdk 12, therefore, I thought it would not be a breaking change to remove those headers since there was no actual logic implemented around them

@@ -874,24 +748,23 @@ URI createHttpDownloadURI(@NotNull DataIdentifier identifier,
}

String key = getKeyName(identifier);
SharedAccessBlobHeaders headers = new SharedAccessBlobHeaders();
headers.setCacheControl(String.format("private, max-age=%d, immutable", httpDownloadURIExpirySeconds));
BlobHttpHeaders headers = new BlobHttpHeaders()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this used since you removed it at line 894?

@@ -1260,41 +1117,19 @@ protected T computeNext() {

private boolean loadItems() {
long start = System.currentTimeMillis();
ClassLoader contextClassLoader = currentThread().getContextClassLoader();
try {
currentThread().setContextClassLoader(getClass().getClassLoader());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you removed all this logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants