@Override public synchronized void close() throws IOException { if (isClosed) { return; } // Call the base close() to close any resources there. super.close(); // Close the store to close any resources there - e.g. the bandwidth // updater thread would be stopped at this time. store.close(); // Notify the metrics system that this file system is closed, which may // trigger one final metrics push to get the accurate final file system // metrics out. long startTime = System.currentTimeMillis(); if(!getConf().getBoolean(SKIP_AZURE_METRICS_PROPERTY_NAME, false)) { AzureFileSystemMetricsSystem.unregisterSource(metricsSourceName); AzureFileSystemMetricsSystem.fileSystemClosed(); } LOG.debug("Submitting metrics when file system closed took {} ms.", (System.currentTimeMillis() - startTime)); isClosed = true; }
@Override public synchronized void close() throws IOException { if (isClosed) { return; } // Call the base close() to close any resources there. super.close(); // Close the store to close any resources there - e.g. the bandwidth // updater thread would be stopped at this time. store.close(); // Notify the metrics system that this file system is closed, which may // trigger one final metrics push to get the accurate final file system // metrics out. long startTime = System.currentTimeMillis(); if(!getConf().getBoolean(SKIP_AZURE_METRICS_PROPERTY_NAME, false)) { AzureFileSystemMetricsSystem.unregisterSource(metricsSourceName); AzureFileSystemMetricsSystem.fileSystemClosed(); } if (LOG.isDebugEnabled()) { LOG.debug("Submitting metrics when file system closed took " + (System.currentTimeMillis() - startTime) + " ms."); } isClosed = true; }