|
@@ -641,6 +641,8 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
static final String AZURE_OUTPUT_STREAM_BUFFER_SIZE_PROPERTY_NAME =
|
|
static final String AZURE_OUTPUT_STREAM_BUFFER_SIZE_PROPERTY_NAME =
|
|
"fs.azure.output.stream.buffer.size";
|
|
"fs.azure.output.stream.buffer.size";
|
|
|
|
|
|
|
|
+ public static final String SKIP_AZURE_METRICS_PROPERTY_NAME = "fs.azure.skip.metrics";
|
|
|
|
+
|
|
private class NativeAzureFsInputStream extends FSInputStream {
|
|
private class NativeAzureFsInputStream extends FSInputStream {
|
|
private InputStream in;
|
|
private InputStream in;
|
|
private final String key;
|
|
private final String key;
|
|
@@ -1035,13 +1037,15 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
store = createDefaultStore(conf);
|
|
store = createDefaultStore(conf);
|
|
}
|
|
}
|
|
|
|
|
|
- // Make sure the metrics system is available before interacting with Azure
|
|
|
|
- AzureFileSystemMetricsSystem.fileSystemStarted();
|
|
|
|
- metricsSourceName = newMetricsSourceName();
|
|
|
|
- String sourceDesc = "Azure Storage Volume File System metrics";
|
|
|
|
instrumentation = new AzureFileSystemInstrumentation(conf);
|
|
instrumentation = new AzureFileSystemInstrumentation(conf);
|
|
- AzureFileSystemMetricsSystem.registerSource(metricsSourceName, sourceDesc,
|
|
|
|
|
|
+ if(!conf.getBoolean(SKIP_AZURE_METRICS_PROPERTY_NAME, false)) {
|
|
|
|
+ // Make sure the metrics system is available before interacting with Azure
|
|
|
|
+ AzureFileSystemMetricsSystem.fileSystemStarted();
|
|
|
|
+ metricsSourceName = newMetricsSourceName();
|
|
|
|
+ String sourceDesc = "Azure Storage Volume File System metrics";
|
|
|
|
+ AzureFileSystemMetricsSystem.registerSource(metricsSourceName, sourceDesc,
|
|
instrumentation);
|
|
instrumentation);
|
|
|
|
+ }
|
|
|
|
|
|
store.initialize(uri, conf, instrumentation);
|
|
store.initialize(uri, conf, instrumentation);
|
|
setConf(conf);
|
|
setConf(conf);
|
|
@@ -2207,8 +2211,10 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
|
|
|
long startTime = System.currentTimeMillis();
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
|
|
- AzureFileSystemMetricsSystem.unregisterSource(metricsSourceName);
|
|
|
|
- AzureFileSystemMetricsSystem.fileSystemClosed();
|
|
|
|
|
|
+ if(!getConf().getBoolean(SKIP_AZURE_METRICS_PROPERTY_NAME, false)) {
|
|
|
|
+ AzureFileSystemMetricsSystem.unregisterSource(metricsSourceName);
|
|
|
|
+ AzureFileSystemMetricsSystem.fileSystemClosed();
|
|
|
|
+ }
|
|
|
|
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("Submitting metrics when file system closed took "
|
|
LOG.debug("Submitting metrics when file system closed took "
|