-
Notifications
You must be signed in to change notification settings - Fork 414
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
base: trunk
Are you sure you want to change the base?
Conversation
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 { |
There was a problem hiding this comment.
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
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. |
f46fa09
to
e33c861
Compare
@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. |
@anchela You are right. |
e33c861
to
2949118
Compare
.../java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobContainerProvider.java
Show resolved
Hide resolved
.../java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobContainerProvider.java
Show resolved
Hide resolved
...-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/Utils.java
Show resolved
Hide resolved
.../java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobContainerProvider.java
Show resolved
Hide resolved
private Properties properties; | ||
private AzureBlobContainerProvider azureBlobContainerProvider; | ||
private int concurrentRequestCount = DEFAULT_CONCURRENT_REQUEST_COUNT; | ||
private RetryPolicy retryPolicy; | ||
private RequestRetryOptions retryOptions; | ||
private Integer requestTimeout; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this used?
.../main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java
Show resolved
Hide resolved
...-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/Utils.java
Show resolved
Hide resolved
...-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/Utils.java
Show resolved
Hide resolved
...-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/Utils.java
Show resolved
Hide resolved
...-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/Utils.java
Show resolved
Hide resolved
@@ -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) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
.../main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java
Show resolved
Hide resolved
.../main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java
Show resolved
Hide resolved
httpDownloadURIExpirySeconds, | ||
headers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this removed?
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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?
No description provided.