>From Hussain Towaileb <[email protected]>: Hussain Towaileb has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19387 )
Change subject: [NO ISSUE][EXT]: Set log option for Azure SDK ...................................................................... [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]> --- M asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java 3 files changed, 29 insertions(+), 0 deletions(-) Approvals: Michael Blow: Looks good to me, approved Hussain Towaileb: Looks good to me, but someone else must approve Jenkins: Verified; Verified Anon. E. Moose #1000171: 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 84d68e3..0a67534 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.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 @@ 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 9ade27b..01ee148 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 @@ 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 fb594b9..ac407f4 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 @@ // 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); -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19387 To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I00cf3c3d8ea839701bafae8863e49c6653c14c76 Gerrit-Change-Number: 19387 Gerrit-PatchSet: 2 Gerrit-Owner: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-MessageType: merged
