saxenapranav commented on code in PR #6314:
URL: https://github.com/apache/hadoop/pull/6314#discussion_r1526280571
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsRestOperation.java:
##########
@@ -487,26 +491,39 @@ private boolean executeHttpOperation(final int retryCount,
*/
@VisibleForTesting
public void signRequest(final AbfsHttpOperation httpOperation, int
bytesToSign) throws IOException {
- switch(client.getAuthType()) {
- case Custom:
- case OAuth:
- LOG.debug("Authenticating request with OAuth2 access token");
-
httpOperation.getConnection().setRequestProperty(HttpHeaderConfigurations.AUTHORIZATION,
- client.getAccessToken());
- break;
- case SAS:
- // do nothing; the SAS token should already be appended to the query
string
- httpOperation.setMaskForSAS(); //mask sig/oid from url for logs
- break;
- case SharedKey:
- default:
- // sign the HTTP request
- LOG.debug("Signing request with shared key");
- // sign the HTTP request
- client.getSharedKeyCredentials().signRequest(
- httpOperation.getConnection(),
- bytesToSign);
- break;
+ if (client.isSendMetricCall()) {
+ AbfsConfiguration abfsConfiguration = client.getAbfsConfiguration();
+ String metricAccountName = abfsConfiguration.getMetricAccount();
+ int dotIndex = metricAccountName.indexOf(AbfsHttpConstants.DOT);
+ if (dotIndex <= 0) {
+ throw new InvalidUriException(
+ metricAccountName + " - account name is not fully qualified.");
+ }
+ String metricAccountKey = abfsConfiguration.getMetricAccountKey();
+ SharedKeyCredentials sharedKeyCredentials = new
SharedKeyCredentials(metricAccountName.substring(0, dotIndex),
metricAccountKey);
Review Comment:
taken.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]