[ 
https://issues.apache.org/jira/browse/HADOOP-18457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17608290#comment-17608290
 ] 

ASF GitHub Bot commented on HADOOP-18457:
-----------------------------------------

steveloughran commented on code in PR #4907:
URL: https://github.com/apache/hadoop/pull/4907#discussion_r977634550


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClientThrottlingIntercept.java:
##########
@@ -55,10 +55,10 @@ private synchronized void 
setIsAutoThrottlingEnabled(boolean autoThrottlingEnabl
   // Hide default constructor
   public AbfsClientThrottlingIntercept(String accountName) {
     setIsAutoThrottlingEnabled(true);
-    LOG.debug("Client-side throttling is enabled for the ABFS file system.");
     this.readThrottler = new AbfsClientThrottlingAnalyzer("read");
     this.writeThrottler = new AbfsClientThrottlingAnalyzer("write");
     this.accountName = accountName;
+    LOG.debug("Client-side throttling is enabled for the ABFS file system for 
the account : " + "{}", accountName);

Review Comment:
   nit: remove the + and just merge the two strings.



##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsOperationMetrics.java:
##########
@@ -19,22 +19,29 @@
 package org.apache.hadoop.fs.azurebfs.services;
 
 import java.util.concurrent.atomic.AtomicLong;
+
 /**
  * Stores Abfs operation metrics during each analysis period.
  */
 class AbfsOperationMetrics {
 
-  private AtomicLong bytesFailed;
+  // No of bytes which could not be transferred due to a failed operation

Review Comment:
   nit, make these javadocs, and add a "." at the end of each string to keep 
javadoc tool happy.



##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsRestOperation.java:
##########
@@ -242,6 +242,13 @@ private void completeExecute(TracingContext tracingContext)
   private boolean executeHttpOperation(final int retryCount,
     TracingContext tracingContext) throws AzureBlobFileSystemException {
     AbfsHttpOperation httpOperation = null;
+    String accountName = this.client.getAbfsConfiguration().getAccountName();

Review Comment:
   remove the this. ; even better, save client.getAbfsConfiguration() to a 
variable and reuse



##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/ConfigurationKeys.java:
##########
@@ -38,6 +38,7 @@ public final class ConfigurationKeys {
   public static final String FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME = 
"fs.azure.account.key";
   public static final String FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME_REGX = 
"fs\\.azure\\.account\\.key\\.(.*)";
   public static final String FS_AZURE_SECURE_MODE = "fs.azure.secure.mode";
+  public static final String FS_AZURE_ACCOUNT_IS_SINGLETON_ENABLED = 
"fs.azure.account.singleton.enabled";

Review Comment:
   is this the right key? something about throttling would be more informative



##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsOperationMetrics.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.fs.azurebfs.services;
+
+import java.util.concurrent.atomic.AtomicLong;
+/**
+ * Stores Abfs operation metrics during each analysis period.
+ */
+class AbfsOperationMetrics {
+
+  private AtomicLong bytesFailed;
+
+  private AtomicLong bytesSuccessful;
+
+  private AtomicLong operationsFailed;
+
+  private AtomicLong operationsSuccessful;
+
+  private long endTime;
+
+  private long startTime;
+
+  AbfsOperationMetrics(long startTime) {
+    this.startTime = startTime;
+    this.bytesFailed = new AtomicLong();
+    this.bytesSuccessful = new AtomicLong();
+    this.operationsFailed = new AtomicLong();
+    this.operationsSuccessful = new AtomicLong();
+  }
+
+  AtomicLong getBytesFailed() {
+    return bytesFailed;
+  }
+
+  AtomicLong getBytesSuccessful() {
+    return bytesSuccessful;
+  }
+
+  AtomicLong getOperationsFailed() {
+    return operationsFailed;
+  }
+
+  AtomicLong getOperationsSuccessful() {
+    return operationsSuccessful;
+  }
+
+  long getEndTime() {
+    return endTime;
+  }
+
+  void setEndTime(final long endTime) {
+    this.endTime = endTime;
+  }
+
+  long getStartTime() {
+    return startTime;
+  }
+}

Review Comment:
   sorry, i meant a newline *after the final }*. if you look at the github 
review it is flagging the lack of a final newline as something it doesn't like





> ABFS: Support for account level throttling
> ------------------------------------------
>
>                 Key: HADOOP-18457
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18457
>             Project: Hadoop Common
>          Issue Type: Sub-task
>    Affects Versions: 3.3.4
>            Reporter: Anmol Asrani
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.0
>
>
> To add support for throttling at account level



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to