This is an automated email from the ASF dual-hosted git repository.
htowaileb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new ad8e562b70 [NO ISSUE][EXT]: Set log option for Azure SDK
ad8e562b70 is described below
commit ad8e562b706178d381e49c788de81bcc3ed8fb7f
Author: Hussain Towaileb <[email protected]>
AuthorDate: Thu Feb 6 09:05:15 2025 +0300
[NO ISSUE][EXT]: Set log option for Azure SDK
Ext-ref: MB-62038
Change-Id: I00cf3c3d8ea839701bafae8863e49c6653c14c76
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19387
Reviewed-by: Hussain Towaileb <[email protected]>
Reviewed-by: Michael Blow <[email protected]>
Integration-Tests: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
---
.../clients/azure/blobstorage/AzBlobStorageCloudClient.java | 2 ++
.../external/util/azure/blob_storage/AzureConstants.java | 10 ++++++++++
.../asterix/external/util/azure/blob_storage/AzureUtils.java | 2 ++
3 files changed, 14 insertions(+)
diff --git
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java
index 84d68e343a..0a6753478c 100644
---
a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java
+++
b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java
@@ -50,6 +50,7 @@ import
org.apache.asterix.cloud.clients.profiler.IRequestProfilerLimiter;
import org.apache.asterix.cloud.clients.profiler.RequestLimiterNoOpProfiler;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.exceptions.RuntimeDataException;
+import org.apache.asterix.external.util.azure.blob_storage.AzureConstants;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.io.FileReference;
import org.apache.hyracks.control.nc.io.IOManager;
@@ -393,6 +394,7 @@ public class AzBlobStorageCloudClient implements
ICloudClient {
private static BlobContainerClient buildClient(AzBlobStorageClientConfig
config) {
BlobContainerClientBuilder blobContainerClientBuilder =
new
BlobContainerClientBuilder().containerName(config.getBucket()).endpoint(getEndpoint(config));
+
blobContainerClientBuilder.httpLogOptions(AzureConstants.HTTP_LOG_OPTIONS);
configCredentialsToAzClient(blobContainerClientBuilder, config);
BlobContainerClient blobContainerClient =
blobContainerClientBuilder.buildClient();
blobContainerClient.createIfNotExists();
diff --git
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java
index 9ade27baeb..01ee148574 100644
---
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java
+++
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java
@@ -18,6 +18,9 @@
*/
package org.apache.asterix.external.util.azure.blob_storage;
+import com.azure.core.http.policy.HttpLogDetailLevel;
+import com.azure.core.http.policy.HttpLogOptions;
+
/*
* Note: Azure Blob and Azure Datalake use identical authentication, so they
are using the same properties.
* If they end up diverging, then properties for AzureBlob and AzureDataLake
need to be created.
@@ -27,6 +30,13 @@ public class AzureConstants {
throw new AssertionError("do not instantiate");
}
+ public static final HttpLogOptions HTTP_LOG_OPTIONS = new HttpLogOptions();
+ static {
+ HTTP_LOG_OPTIONS.setLogLevel(HttpLogDetailLevel.BASIC);
+ HTTP_LOG_OPTIONS.addAllowedQueryParamName("restype");
+ HTTP_LOG_OPTIONS.addAllowedQueryParamName("comp");
+ HTTP_LOG_OPTIONS.addAllowedQueryParamName("prefix");
+ }
/*
* Asterix Configuration Keys
*/
diff --git
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
index fb594b9406..ac407f4dc8 100644
---
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
+++
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
@@ -115,6 +115,8 @@ public class AzureUtils {
// Client builder
BlobServiceClientBuilder builder = new BlobServiceClientBuilder();
+ builder.httpLogOptions(AzureConstants.HTTP_LOG_OPTIONS);
+
int timeout = appCtx.getExternalProperties().getAzureRequestTimeout();
RequestRetryOptions requestRetryOptions = new
RequestRetryOptions(null, null, timeout, null, null, null);
builder.retryOptions(requestRetryOptions);