Skip to content

Commit b11c271

Browse files
review comments
1 parent 27f8363 commit b11c271

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import java.util.concurrent.TimeUnit;
4242
import java.util.concurrent.atomic.AtomicBoolean;
4343

44+
import org.apache.commons.lang3.StringUtils;
4445
import org.apache.hadoop.classification.VisibleForTesting;
4546
import org.apache.hadoop.fs.azurebfs.constants.FSOperationType;
4647
import org.apache.hadoop.fs.azurebfs.contracts.exceptions.AbfsInvalidChecksumException;
@@ -205,7 +206,7 @@ private AbfsClient(final URL baseUrl,
205206
if (!metricFormat.toString().equals(EMPTY_STRING)) {
206207
String metricAccountName = abfsConfiguration.getMetricAccount();
207208
String metricAccountKey = abfsConfiguration.getMetricAccountKey();
208-
if (!metricAccountName.equals(EMPTY_STRING) && !metricAccountKey.equals(EMPTY_STRING)) {
209+
if (StringUtils.isNotEmpty(metricAccountName) && StringUtils.isNotEmpty(metricAccountKey)) {
209210
isMetricCollectionEnabled = true;
210211
abfsCounters.initializeMetrics(metricFormat);
211212
int dotIndex = metricAccountName.indexOf(AbfsHttpConstants.DOT);
@@ -218,8 +219,7 @@ private AbfsClient(final URL baseUrl,
218219
metricAccountName.substring(0, dotIndex),
219220
metricAccountKey);
220221
} catch (IllegalArgumentException e) {
221-
throw new IOException(
222-
"Exception while initializing metric credentials " + e);
222+
throw new IOException("Exception while initializing metric credentials ", e);
223223
}
224224
}
225225
}

0 commit comments

Comments
 (0)