|
@@ -387,9 +387,8 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore {
|
|
|
if (null == instrumentation) {
|
|
|
throw new IllegalArgumentException("Null instrumentation");
|
|
|
}
|
|
|
-
|
|
|
this.instrumentation = instrumentation;
|
|
|
- this.bandwidthGaugeUpdater = new BandwidthGaugeUpdater(instrumentation);
|
|
|
+
|
|
|
if (null == this.storageInteractionLayer) {
|
|
|
this.storageInteractionLayer = new StorageInterfaceImpl();
|
|
|
}
|
|
@@ -405,7 +404,13 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore {
|
|
|
//
|
|
|
if (null == conf) {
|
|
|
throw new IllegalArgumentException(
|
|
|
- "Cannot initialize WASB file system, URI is null");
|
|
|
+ "Cannot initialize WASB file system, conf is null");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!conf.getBoolean(
|
|
|
+ NativeAzureFileSystem.SKIP_AZURE_METRICS_PROPERTY_NAME, false)) {
|
|
|
+ //If not skip azure metrics, create bandwidthGaugeUpdater
|
|
|
+ this.bandwidthGaugeUpdater = new BandwidthGaugeUpdater(instrumentation);
|
|
|
}
|
|
|
|
|
|
// Incoming parameters validated. Capture the URI and the job configuration
|
|
@@ -1782,11 +1787,14 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore {
|
|
|
selfThrottlingWriteFactor);
|
|
|
}
|
|
|
|
|
|
- ResponseReceivedMetricUpdater.hook(
|
|
|
- operationContext,
|
|
|
- instrumentation,
|
|
|
- bandwidthGaugeUpdater);
|
|
|
-
|
|
|
+ if(bandwidthGaugeUpdater != null) {
|
|
|
+ //bandwidthGaugeUpdater is null when we config to skip azure metrics
|
|
|
+ ResponseReceivedMetricUpdater.hook(
|
|
|
+ operationContext,
|
|
|
+ instrumentation,
|
|
|
+ bandwidthGaugeUpdater);
|
|
|
+ }
|
|
|
+
|
|
|
// Bind operation context to receive send request callbacks on this operation.
|
|
|
// If reads concurrent to OOB writes are allowed, the interception will reset
|
|
|
// the conditional header on all Azure blob storage read requests.
|
|
@@ -2561,7 +2569,10 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore {
|
|
|
|
|
|
@Override
|
|
|
public void close() {
|
|
|
- bandwidthGaugeUpdater.close();
|
|
|
+ if(bandwidthGaugeUpdater != null) {
|
|
|
+ bandwidthGaugeUpdater.close();
|
|
|
+ bandwidthGaugeUpdater = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Finalizer to ensure complete shutdown
|