File tree Expand file tree Collapse file tree
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141import java .util .concurrent .TimeUnit ;
4242import java .util .concurrent .atomic .AtomicBoolean ;
4343
44+ import org .apache .commons .lang3 .StringUtils ;
4445import org .apache .hadoop .classification .VisibleForTesting ;
4546import org .apache .hadoop .fs .azurebfs .constants .FSOperationType ;
4647import 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 }
You can’t perform that action at this time.
0 commit comments